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

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

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

Post by Pellaeon » Thu Jan 24, 2019 10:57 am

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 11 times
energyMat.material
(1.4 KiB) Downloaded 11 times
Last edited by Pellaeon on Thu Jan 24, 2019 1:10 pm, edited 1 time in total.
0 x

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

Re: InvalidParametersException for custom parameter in material file for shader

Post by paroj » Thu Jan 24, 2019 11:52 am

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.
0 x

Post Reply