Help understanding error message? Topic is solved

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


jwwalker
Goblin
Posts: 247
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 18

Help understanding error message?

Post by jwwalker »

I'm porting some custom material shaders from Metal to HLSL, and I got an error message
that I don't understand:

Code: Select all

17:04:57: Parsing script JWStereo.material
17:04:57: OGRE EXCEPTION(5:ItemIdentityException): Parameter called pixelWidth does not exist. Known names are:  in GpuProgramParameters::_findNamedConstantDefinition at D:\MoreCode\Ogre\ogre-next-fork\OgreMain\src\OgreGpuProgramParams.cpp (line 2209)
17:05:03: Compiler error: invalid parameters in JWStereo.material(277): setting of constant failed
17:05:03: OGRE EXCEPTION(5:ItemIdentityException): Parameter called pixelHeight does not exist. Known names are:  in GpuProgramParameters::_findNamedConstantDefinition at D:\MoreCode\Ogre\ogre-next-fork\OgreMain\src\OgreGpuProgramParams.cpp (line 2209)

This is saying that a parameter specified in a fragment_program_ref object of the material
script is not being found in a shader program, right? The Ogre log doesn't say which
HLSL file it's looking at, but all of the HLSL files referenced by this material script
begin with

Code: Select all

Texture2D<float4> colorLeft : register(t0);
Texture2D<float> depthLeft	: register(t1);
Texture2D<float4> colorRight : register(t2);
Texture2D<float> depthRight	: register(t3);

uniform int     pixelWidth;
uniform int     pixelHeight;

so I can't see why Ogre can't find pixelWidth and pixelHeight.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2106
Joined: Sun Mar 30, 2014 2:51 pm
x 1132

Re: Help understanding error message?

Post by paroj »

HLSL can just remove the uniforms, if they are unused in the shader. Then Ogre will not see them.

jwwalker
Goblin
Posts: 247
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 18

Re: Help understanding error message?

Post by jwwalker »

Thanks, that was it!