DXGL r309 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r308‎ | r309 | r310 >
Date:19:11, 13 January 2013
Author:admin
Status:new
Tags:
Comment:
Add range to point lights.
Modified paths:
  • /ddraw/shadergen.cpp (modified) (history)

Diff [purge]

Index: ddraw/shadergen.cpp
@@ -342,6 +342,7 @@
343343 vec3 pos3 = pos.xyz / pos.w;\n\
344344 vec3 V = light.position - pos3;\n\
345345 float d = length(V);\n\
 346+if(d > light.range) return;\n\
346347 V = normalize(V);\n\
347348 float attenuation = 1.0/(light.constant+(d*light.linear)+((d*d)*light.quad));\n\
348349 float NdotV = max(0.0,dot(N,V));\n\