Skip to main content

Multiple ShaderAppearances - passing uniforms???

1 reply [Last post]
hooyacrusty
Offline
Joined: 2012-11-07
Points: 0

Hi,

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?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hooyacrusty
Offline
Joined: 2012-11-07
Points: 0

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.