Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Issues using GL Vertex Buffers

    Cinema 4D SDK
    r20 c++
    2
    5
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rsodreR
      rsodre
      last edited by rsodre

      Hello,

      I was not happy with the performance using BaseDraw::LineStripBegin() / BaseDraw::LineStrip() / BaseDraw::LineStripEnd() to draw thousands of strands on the viewport, so I tried using GlProgramFactory and GlVertexBuffer from gl.h, exemplified on the sdk source gl_test_object.cpp. The performance improved was amazing, viewport fps raised up to 3 times.

      But those functions are marked as undocumented, and I hope that's very different from the private, that shall never be commented, because some issues arised that I'm unable to solve.

      First, bd->SetDrawParam( DRAW_PARAMETER_LINEWIDTH, 2 ); does not work when drawing with DrawSubBuffer().
      DRAW_PARAMETER_LINEWIDTH is marked in the docs as (OpenGL only), but actually looks like is the inverse.
      How can I set like width for DrawSubBuffer()?
      What OpenGL does DRAW_PARAMETER_LINEWIDTH refers to?

      And some lines seem broken, with gaps in between, usually on concave surfaces. Looks like some depth precision problem.
      How to control depth read/write using those functions?
      0_1547605445470_Screen Shot 2019-01-16 at 00.17.48.png

      rsodreR 1 Reply Last reply Reply Quote 0
      • a_blockA
        a_block
        last edited by

        Hello,

        again it's me who has provide the unsatisfactory answer. We currently have nothing more to contribute to this topic besides the examples you have already found. I am terribly sorry.

        Cheers,
        Andreas

        1 Reply Last reply Reply Quote 1
        • rsodreR
          rsodre @rsodre
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • rsodreR
            rsodre
            last edited by

            Just found my problem, nothing to do with the drawing API...

            bd->SetDrawParam( DRAW_PARAMETER_SETZ, DRAW_Z_ALWAYS );
            

            It was setting the depth fragment on all the strands, occluding itself sometimes!

            1 Reply Last reply Reply Quote 2
            • a_blockA
              a_block
              last edited by

              Hi Roger,

              I'm glad you were able to identify the issue and made some progress. And thanks for taking the time to share your findings with the forum. Much appreciated!

              Cheers,
              Andreas

              1 Reply Last reply Reply Quote 0
              • First post
                Last post