I am writing GLSL shaders for my Java3D application. They work fine, and I can pass uniform variables ok, but what I don't get is since Java3D controls the rendering order, how I can have multiple ShaderAppearances and know when to send uniform data to the current shader. Is there a callback mechanism I need to be using? I assume I have to pass the uniforms by using ShaderAttributeSet.put(ShaderAttributeValue) but when?
I think I just figured it out. It seems then when Java3D switches between shader programs if sends the associated uniform data to the video card automatically. When you call ShaderAttributeSet.put(ShaderAttributeValue) it doesn't send the data until later, and then sends it every time that shader program is reloaded.