I have a geomtry scene that some nodes have texture and others have not. What is confusing me is How to deal with this case in one fragment program?
I mean, If I use texture with some nodes, but when rendering other nodes without texture, what value will I get?
I think I can solve it by sorting the nodes in terms of texture. When I render the nodes with texture, I use one FP, And I render the nodes without texture ,I use another FP. Have any other Method to solve it?
you can pass an argument to your FP to switch between different path within the FP, but sorting your geometry and loading a different FP is BY FAR the most efficient way to deal with your “problem”…
We have currently 58 fragment programs, and still counting …
Originally posted by zhq424:
Have any other Method to solve it?
Maybe you could set up a small(2x2) “empty” texture and use that as the texture for the nodes that don’t have a real texture bound to it. The definition of empty depends on what you do with the result. Addition=use black, modulation=use white. Just a thought.
glBindTexture(0) will enable a white texture.
It should work with your fragment program …