Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actuallipsryme

Posted 11 September 2012 - 01:11 PM

Nope, still not correct somehow : /

Also with this algorithm the z direction seems to be inverted.

Added video showcasing the problem:
http://www.youtube.com/watch?v=xKjusqHV0q8&feature=youtu.be
(Diffuse only)
Directional light source is shining towards (0, 0, -1) so only the front face of the cube should be lit.

And here's the pixel shader code:
  float4 encodedNormals = NormalTarget.Sample(PointSampler, input.UV);
  float3 N = decode(encodedNormals);
  float3 LightDir = mul(_LightDirection, View);
  float NdotL = saturate(dot(N, -LightDir));
  lighting.rgb = float3(NdotL, NdotL, NdotL);

#6lipsryme

Posted 11 September 2012 - 01:08 PM

Nope, still not correct somehow : /

Also with this algorithm the z direction seems to be inverted.

Added video showcasing the problem:
http://www.youtube.com/watch?v=xKjusqHV0q8&feature=youtu.be

Directional light source is shining towards (0, 0, -1) so only the front face of the cube should be lit.

And here's the pixel shader code:
  float4 encodedNormals = NormalTarget.Sample(PointSampler, input.UV);
  float3 N = decode(encodedNormals);
  float3 LightDir = mul(_LightDirection, View);
  float NdotL = saturate(dot(N, -LightDir));
  lighting.rgb = float3(NdotL, NdotL, NdotL);

#5lipsryme

Posted 11 September 2012 - 01:08 PM

Nope, still not correct somehow : /

Also with this algorithm the z direction seems to be inverted.

Added video showcasing the problem:
http://www.youtube.com/watch?v=xKjusqHV0q8&feature=youtu.be

Directional is shining towards (0, 0, -1) so only the front face of the cube should be lit.

And here's the pixel shader code:
  float4 encodedNormals = NormalTarget.Sample(PointSampler, input.UV);
  float3 N = decode(encodedNormals);
  float3 LightDir = mul(_LightDirection, View);
  float NdotL = saturate(dot(N, -LightDir));
  lighting.rgb = float3(NdotL, NdotL, NdotL);

#4lipsryme

Posted 11 September 2012 - 01:07 PM

Nope, still not correct somehow : /

Also with this algorithm the z direction seems to be inverted.

Added video showcasing the problem:


And here's the pixel shader code:
  float4 encodedNormals = NormalTarget.Sample(PointSampler, input.UV);
  float3 N = decode(encodedNormals);
  float3 LightDir = mul(_LightDirection, View);
  float NdotL = saturate(dot(N, -LightDir));
  lighting.rgb = float3(NdotL, NdotL, NdotL);

#3lipsryme

Posted 11 September 2012 - 01:06 PM

Nope, still not correct somehow : /

Also with this algorithm the z direction seems to be inverted.

Added video showcasing the problem:

#2lipsryme

Posted 11 September 2012 - 01:01 PM

Nope, still not correct somehow : /

Also with this algorithm the z direction seems to be inverted.

PARTNERS