For a project of mine i converted a per-pixel Spotlight shader to 3dgs .fx and at this process i think i found a bug at vecLightDir.
light1.dir = float3(vecLightDir[0].x, vecLightDir[0].y, vecLightDir[0].z);
At this line of my .fx file i tried every combination that could be, for a possible difference at 3dgs and hlsl vector.
(***.X,***.Y,***.Z)
(***.X,***.Z,***.Y)
(***.Y,***.X,***.Z)
(***.Z,***.X,***.Y)
(***.Y,***.Z,***.X)
(***.Z,***.Y,***.X)
But at evry of them i encountered wrong results. Because of that i added these lines to the action of the shadered model at my script:
while(me!=NULL)
{
if(car != NULL)
{
vec_set(temp,vector(1,0,0));
vec_rotate(temp,car.pan);
vec_normalize(temp,1);
my.skill41 = floatv(temp.x);
my.skill42 = floatv(temp.y);
my.skill43 = floatv(temp.z);
my.skill44 = floatv(0.8);
}
wait(1);
}
And changed the line at my .fx file like this:
light1.dir = float3(vecSkill41.x, vecSkill41.z, vecSkill41.y);
And the shader gave the correct results. Also changing vecSkill41.x to vecLightDir[0].x and vecSkill41.z to vecLightDir[0].y
light1.dir = float3(vecLightDir[0].x, vecLightDir[0].y, vecSkill41.y);
doesn't disrupt the correct render.
It seems there is something wrong with vecLightDir[0].z ...Wrong Result SS
Right Result SS
PS: I use version 7.70...