DXGL r181 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r180
|
r181
|
r182
>
Date:
18:46, 24 June 2012
Author:
admin
Status:
new
Tags:
Comment:
Add attenuation factors to point/spot lights
Modified paths:
/ddraw/shadergen.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/shadergen.cpp
—
—
@@ -324,7 +324,8 @@
325
325
vec3 H = normalize(L + vec3(0.0, 0.0, 1.0));\n\
326
326
float NdotL = max(dot(N,L),0.0);\n\
327
327
float NdotH = max(dot(N,H),0.0);\n\
328
-diffuse += light.diffuse*NdotL;\n\
328
+float attenuation = 1.0/(light.constant+(d*light.linear)+((d*d)*light.quad));\n\
329
+diffuse += light.diffuse*NdotL*attenuation;\n\
329
330
ambient += light.ambient;\n\
330
331
}\n";
331
332
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version