Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualNyssa

Posted 14 February 2013 - 03:23 AM

Also, 

 
    float texelSize = 0.0001; // correct value?

 

I think instead you want:

float texelSize = 1.0 / textureSize; //eg: 1.0 / 1024.0

I think maybe our over thinking the problem though :)

 

So you want the normals of the billboard to always face the light I'm assuming? So you could do something like the following in the vertex shader:

//note : swap mul order depending on your matrices
float3 normal = mul(viewMatrix, lightWorldPosition - billboardedVertexPos);
normal = normalize(normal);

#1Nyssa

Posted 14 February 2013 - 03:10 AM

Also, 

 
    float texelSize = 0.0001; // correct value?

 

I think instead you want:

float texelSize = 1.0 / textureSize; //eg: 1.0 / 1024.0

PARTNERS