Horde3D
http://www.horde3d.org/forums/

User shader constants
http://www.horde3d.org/forums/viewtopic.php?f=2&t=262
Page 1 of 1

Author:  Manny [ 24.03.2008, 12:53 ]
Post subject:  User shader constants

Hi,

Is there currently a 'approved' method of adding your own shader constants? I could do this simply by adding constants to the ShaderContext, but I'd rather not have to change the actual Horde code to do this. Similarly I don't want to expose the shader context to the app itself but do require the ability to set constants based on input for example. Ideally I'd be able to add things in a similar way to how the integrationlib currently functions so I don't have to explose Horde's internals, or make changes to Horde that I then have to integrate with each new release.

Cheers!

Author:  marciano [ 24.03.2008, 17:44 ]
Post subject: 

You can use arbitrarily named vec4-uniforms in your shaders. You just need to define them in the material file that references your shader. Please have a look at the material format specification for the syntax.

Author:  AcidFaucet [ 24.03.2008, 20:08 ]
Post subject: 

Horde3D::setMaterialUniform(resource handle, uniform name, a, b, c, d);

Though 0.14 doesn't have private duplication of resources so setting a material uniform will affect everything that uses the material. That's all in the next release.

Author:  marciano [ 24.03.2008, 20:34 ]
Post subject: 

Horde3D::setMaterialUniform sets the uniform globally for a material. There is also Horde3D::setMeshUniform with which you can overwrite a uniform for a single mesh.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/