But I have an implementation bug or short coming. I am not using a fragment program. ... My line comes out black with occasional stippled white flickering. Is there something I can do to fix this problem?
Use a fragment shader :) Seriously, if you've managed to get your head around the vertex shader, a simple fragment shader should be trivial. If you're just colouring points, then you only need to pass in an RGB value to the vertex, and that gets passed through to the fragment shader; it's exactly the same as passing in any other data, shaders can cope with most per-vertex data you want to throw at them.
Okay, so I have a few problems with this approach: 1) I just tried a trivial test implementation to see what would happen. I made my line a solid green color. This worked and the line came out green instead of that black/white mess. But I just lost all the anti-aliasing OpenGL used to do for me on the line. The rendering now looks terrible. I think I understand why I lost all the anti-aliasing because I'm specifying exact pixel color values. I'm not expecting there to be a good solution to this, so if I'm right, using fragment shaders would be a bad thing for this. 2) Assuming I could fix my anti-aliasing problem somehow, my understanding/imagination of what I can accomplish with shaders is still limited. So one thing I currently offer in CPU land is that I can compute/present color gradient scales such as Rainbow or Heated-Metal. My values are determined by (painfully) finding the minimum and maximum values of my data and I compute the color per-vertex. My understanding of shaders is that there can not be dependencies between pixels, so I still have to do the old painful thing of finding the maximum and minimums in CPU land. But now I also have to pass these values to the fragment program. Is this correct? If so, how do I pass values? (I haven't found a good example of this yet.) 3) I've already invested the time all the time in the CPU land color code. It currently works minus this vertex program color problem, so I don't know if can justify the time doing a rewrite. So is there a way I can continue using the vertex program, but get it to cooperate with my traditional color approach? Thanks, Eric _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
