Hi, I want to implement custom line style. I know about LineStipple and LineWidget, but I want to create something more complicated than that, for example this repeating pattern: ____|____
My current solution is custom line geometry created instead of GL_LINE - start -> end. The upside is, that it now can shift and works with GL_LINE_STRIP and I can create for example Circle with this pattern and it is really fast. But my problem is, that if I have a really big scene with almost all lines with custom style, it eats more than 4GB of memory and I ran out of video memory too, if I use VBO or DisplayList. Is there a typical solution for this ? I found two other methods: 1) Texture - texture a line with custom texture Problems: a) is it possible to draw textured line ? b) is it possible to shift texture ? c) is it possible to create texture from some template* ? 2) Shader - create geometry shader, that will create pattern from two line points in GPU. Problems: a) implementing even dashed line is not that easy b) which shader is better to use ? Geometry or Fragment ? - geometry with inserting new primitives or fragment shader with variable holding position to line vertices - i'm pretty sure, I will have to use triangles in that case for line width and some complex patterns. c) is it posible to create shader from some template* ? Problems i 1 and 2: a) it's really hard to pick pattern geometry with intersector, if I dont have any, but that is something I can live without. b) it's a long way to implement one solution and what about performance *: template - like CreatePattern: size = 5.0, from 0.0 to 2.0 line, than a point on 2.5 position, and than line from 3.0 to 5.0, will create this: ____ . ____ So what do you recommend or is there better solution ? ... Thank you! Cheers, Filip ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43768#43768 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

