Trouble in shader

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
EViruS
Posts: 19
Joined: Sat Jul 07, 2007 8:32 pm

Trouble in shader

Post by EViruS »

Why irrlicht post message:
HLSL Variable to set not found: 'weightABC'. Available variables are:
'worldViewProj' Registers:[begin:0, count:4]
My shader:
float4x4 worldViewProj : WorldViewProjection;
float4 weightABC : weightABC;

Code in OnSetConstant:
_services->setVertexShaderConstant("weightABC", reinterpret_cast<f32 *>(&m_MapWeights), 3);

//where core::vector3df m_MapWeights;
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You're not using it in your code. That's also covered in several other threads on shaders in the forums.
EViruS
Posts: 19
Joined: Sat Jul 07, 2007 8:32 pm

Post by EViruS »

message deleted by author
Last edited by EViruS on Mon Jul 09, 2007 7:44 pm, edited 1 time in total.
EViruS
Posts: 19
Joined: Sat Jul 07, 2007 8:32 pm

Post by EViruS »

message deleted by author
Last edited by EViruS on Mon Jul 09, 2007 7:41 pm, edited 1 time in total.
EViruS
Posts: 19
Joined: Sat Jul 07, 2007 8:32 pm

Post by EViruS »

hybrid wrote:You're not using it in your code. That's also covered in several other threads on shaders in the forums.
Thx. I found my mistake.
The weightABC is pixel shader constant. So it means that correct constant setup provided by services->setPixelShaderConstant
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, the warning just said "the name is not existing in the code". Since both programs are in one file it's not that obvious, but it's apparently true - these are two completely separate programs.
Post Reply