Hi all,
I’m writing a shader in hlsl and my current problem is that I fight with the count of interpolated vars I have in sm3.0
my current input in the pixel shader is this
float4 Pos: POSITION;
float2 TexCoord0 : TEXCOORD0;
float3 Normal : NORMAL; // tangent space
float4 Tangent : TANGENT;
float3 CamVec : TEXCOORD1;
float4 VertCol : TEXCOORD2;
float DistanceToCam : TEXCOORD3; // used to blend out the rimlight based on the camera distance
float3 tLightDirArray[MaxLights] : TEXCOORD4;
// TEXCOORD5 used with 2 lights
// TEXCOORD6 used with 3 lights
// TEXCOORD7 used with 4 lights
float3 wCamVec : TEXCOORD5;
float3 wNormal : TEXCOORD6;
float3 wTangent : TEXCOORD7;
float faceDir : VFACE;
I would love to use up to 3 lights but atm I can only pass one light as I’m already at the limit…
Now my question is… Is there another way of supporting more lights and could I drop some of the vars and calculate them in the pixel shader without killing the performance?
the Tangent var carries info from the model so I need it
the w… vars are for the reflection stuff (cubemap) and some custom stuff I do in the shader
To make it short. I need the vars somehow in the pixel shader, so dropping some of them wouldn’t be a useful option.