I am having a problem with Evolved's Normal Mapping Shader.
Evolved's Demo works perfectly and I can load both the model and textures I am trying to use into the demo, and they work there too.
In my game however, I can't seem to properly reproduce the effect.
For some reason the players body (the only object that the shader is being applied to) is always pure black. Always.
It's as if all the shaders variables are at 0.
I am using Sparky's Collision. But it is not being applied to the Object i am using the shader on.
Here is a snipet of the code I am applying to the object to attach the shader:
Assume the object and texture is loaded and MyObjNum stores the object index, and the texture image index (purposely the same).
load effect "Shaders/NormalMapping.fx",1,0
NormalImg = Actor_GetFreeObj()
Load Image "BmpBody" + "tile_n.bmp", NormalImg
SpecImg = Actor_GetFreeObj()
Load Image "BmpBody" + "Normalize.dds", SpecImg, 2
Load Image "BmpBody" + "Skin.png", MyObjNum
If Image Exist(NormalImg) = 0 then Hud_Break("Normal Map Not Found!")
If Image Exist(SpecImg) = 0 then Hud_Break("Spec Map Not Found!")
set object effect MyObjNum,1
Texture Object MyObjNum, 0, MyObjNum
Texture Object MyObjNum, 1, NormalImg
Texture Object MyObjNum, 2, SpecImg
vec = make vector4(1)
set vector4 1, 5, 5, 5, 1
set effect constant vector 1,"LightPosition",1
set vector4 1, 255,255,255, 0
set effect constant vector 1,"LightColor",1
set vector4 1, 3000,0,0,0
set effect constant vector 1,"LightRange",1
set vector4 1, 255, 255, 255, 30
set effect constant vector 1,"Ambient", 1
------------------
[Custom Signature]