> 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.)
Textures. If you have a line that needs a gradient texture, create one on the fly, it only needs to be a 1d texture, and assign relevant texture coordinates to the vertices of the line. If you have several lines that need different gradients, you can be more efficient by creating a 2D texture with each row representing one gradient. You do have to be careful with texture sampling by using nearest neighbour* rather than anything fancy, and you have to make sure your texture coordinates are in the middle of a texel (OpenGL samples texels in the centre IIRC, the docs will tell you otherwise). > 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? Generally, once you've abandoned the fixed-function pipeline, there's no mixing and matching; it's all or nothing. But I assure you, once you get past the pain, programmable shaders are just _soooo_ sexy!** Obviously real-world time-contraints can often stymie a programmer's desire to do the The Best Thing, and force you to stick with the simplest/cheapest/quickest option. John Donovan Sony Computer Entertainment Europe http://www.scee.com * My memory's hazy (and the docs are too far away), can you specify nearest neighbour for one axis, and linear for another? ** That's sexy in a geeky way; I have a girlfriend and most of my friends are flesh-and-blood, not virtual. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify [EMAIL PROTECTED] This footnote also confirms that this email message has been checked for all known viruses. ********************************************************************** Sony Computer Entertainment Europe _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
