   Passing parameters from Game to Shaders
  I have been dabbling writing some custom shaders in Gamebryo.and have got some parameters working, that artists can edit in Maya, such as pulse frequencies for glows... specularity, reflectivity etc.....This all works ok.But how to I make parameters that can be set in game code? that get sent to one or all shaders please.For example...How can I effect a shader's glow texture's brightness or alpha translucency via game code?Or how do I change a global fog value via game code, so it effects all shaders at the same time ?There seems to be one or two existing variables like this that can be passed to all shaders.... such as "Time"But I don't know how to set these up in game code, or make the paramaters accessible to the shaders as attributes.does anyone have any ideas on how to do this.Even better if you know how to do this within GameBryoany help appreciated...cheers   
  Which shader-language are you coding in, and for what platform?All of those parameters should be easy to set in any language, google for a simple tutorial on the subject. There's plenty. :)   ;  .FX  language, in PC GameBryo 2.3I know it should be easy... but I can't seem to find anything in Gamebryo docs, or examples...hence the problem[Edited by - JonnyHilly on January 2, 2008 1:43:39 PM];  .FX is just what you're saving the file as, not the language.I Haven't worked with Gamebryo but if it's DirectX HLSL (which used the .FX extension as the standard) then when you're setting up the Effect you can define an Effect Pool which allows you to share variables between shaders.At least with DirectX to set variable in shaders from code, you simply call the effects SetValue function   ;  finally figured it out...its quite easy once you know how..just had a hard time finding a simple description or example...//setup Custom Shader global Atribute NiShaderFactory::RegisterGlobalShaderConstant("ShaderAttributeName",NiShaderAttributeDesc::ATTRIB_TYPE_FLOAT, //see NiShaderAttributeDesc.h    sizeof(float), (const void*) &floatVariable);That sets up the attribute, as a global, that code can change.and can be updated with NiShaderFactory::UpdateGlobalShaderConstantin the shader code, setup the variable in the usual way.    float variableName    <  string VarType = "Predefined";  string DefinedMapping = "ShaderAttributeName";    > = { 1.0f};   //comment here