Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
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.
GlProgramFactory
GlVertexBuffer
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?
bd->SetDrawParam( DRAW_PARAMETER_LINEWIDTH, 2 );
DrawSubBuffer()
DRAW_PARAMETER_LINEWIDTH
(OpenGL only)
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?
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
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!
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!