[solved] InvalidParametersException for custom parameter in material file for shader Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
Pellaeon
Gremlin
Posts: 186
Joined: Thu Apr 28, 2011 12:23 pm
x 20

[solved] InvalidParametersException for custom parameter in material file for shader

Post by Pellaeon »

Ogre Version: 1.11.5
Operating System: Win10 x64
Render System: DX9

Hi,

in my material (see attachements) I use custom parameters for a shader. When looking into the log I got the following

Code: Select all

10:53:29: Ogre::InvalidParametersException::InvalidParametersException: Parameter called energyColor does not exist.  in GpuProgramParameters::_findNamedConstantDefinition at d:\projects\cpp\ogre-1.11.5\ogremain\src\ogregpuprogramparams.cpp (line 1679)
10:53:29: Error: ScriptCompiler - invalid parameters in energyMat.material(40): Parameter called energyColor does not exist. 
10:53:29: Ogre::InvalidParametersException::InvalidParametersException: Parameter called energyColor does not exist.  in GpuProgramParameters::_findNamedConstantDefinition at d:\projects\cpp\ogre-1.11.5\ogremain\src\ogregpuprogramparams.cpp (line 1679)
10:53:29: Error: ScriptCompiler - invalid parameters in energyMat.material(40): Parameter called energyColor does not exist. 
10:53:29: Ogre::InvalidParametersException::InvalidParametersException: Parameter called energyColor does not exist.  in GpuProgramParameters::_findNamedConstantDefinition at d:\projects\cpp\ogre-1.11.5\ogremain\src\ogregpuprogramparams.cpp (line 1679)
10:53:29: Error: ScriptCompiler - invalid parameters in energyMat.material(40): Parameter called energyColor does not exist. 
10:53:29: Ogre::InvalidParametersException::InvalidParametersException: Parameter called energyColor does not exist.  in GpuProgramParameters::_findNamedConstantDefinition at d:\projects\cpp\ogre-1.11.5\ogremain\src\ogregpuprogramparams.cpp (line 1679)
10:53:29: Error: ScriptCompiler - invalid parameters in energyMat.material(40): Parameter called energyColor does not exist. 
10:53:29: Ogre::InvalidParametersException::InvalidParametersException: Parameter called energyColor does not exist.  in GpuProgramParameters::_findNamedConstantDefinition at d:\projects\cpp\ogre-1.11.5\ogremain\src\ogregpuprogramparams.cpp (line 1679)
10:53:29: Error: ScriptCompiler - invalid parameters in energyMat.material(40): Parameter called energyColor does not exist. 
But the materials seems to work. What must I change in my material to eliminate these errors? What is my fault?
Attachments
energyMat.hlsl
(1014 Bytes) Downloaded 22 times
energyMat.material
(1.4 KiB) Downloaded 19 times
Last edited by Pellaeon on Thu Jan 24, 2019 1:10 pm, edited 1 time in total.

paroj
OGRE Team Member
OGRE Team Member
Posts: 1192
Joined: Sun Mar 30, 2014 2:51 pm
x 466
Contact:

Re: InvalidParametersException for custom parameter in material file for shader

Post by paroj »

energyColor is unused in the shader and thus removed by the HLSL compiler. Therefore Ogre cannot see it and throws the error. Just remove that parameter altogether.

Post Reply