Skip to content

Instantly share code, notes, and snippets.

@skogler
Last active December 20, 2015 23:29
Show Gist options
  • Save skogler/6213088 to your computer and use it in GitHub Desktop.
Save skogler/6213088 to your computer and use it in GitHub Desktop.
Ogre GLSL uniform struct problem
// definition in GLSL fragment shader:
#version 120
struct Light
{
vec4 positionObjSpace;
vec4 specular;
vec4 diffuse;
};
uniform Light mygloballight;
// Passing param in .program file:
fragment_program SplattingFpBase glsl
{
source resources/ogre/scripts/programs/SplatFp.glsl
default_params
{
param_named_auto mygloballight.positionObjSpace light_position_object_space 0
param_named_auto mygloballight.diffuse light_diffuse_colour 0
param_named_auto mygloballight.specular light_specular_colour 0
}
}
// Ogre log output
[15:20:20] INFO (Ogre) Parsing script resources/ogre/scripts/programs/Splat.program
[15:20:20] INFO (Ogre) Problem parsing the following GLSL Uniform: ' Light mygloballight' in file SplattingFp/1
[15:20:20] FAILURE (Ogre) OGRE EXCEPTION(2:InvalidParametersException): Parameter called mygloballight.positionObjSpace does not exist. in GpuProgramParameters::_findNamedConstantDefinition at /home/sko/workspace/worldforge/work/build/deps/ogre/OgreMain/src/OgreGpuProgramParams.cpp (line 1637)
[15:20:20] INFO (Ogre) Compiler error: invalid parameters in resources/ogre/scripts/programs/Splat.program(11): setting of constant failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment