Skip to main content
GameDev.net gamedev.net
🔒 Locked

sun light

Started by giugio Apr 2, 2011 at 9:36 AM 0 replies 1.4k views
Original Post
giugio
giugio
Hello.
I would develop a hlsl or cg shader that simulates the sun light ,in phong.
What kind of light i can use?
Thanks.
DrunkMonkey25
DrunkMonkey25
From Programming with DX9: A Shader Approach by Frank Luna, chapter 10 section 2:

"A directional light, or parallel light, approximates a light source that is very far away. Consequently, we can approximate all incoming light rays as parallel to each other. The common example of a real directional light source is the sun..."

He goes on to present calculating normals and demonstrates a vertex shader. Phong shading is covered in section 10, and the lighting calculations are easily moved to the pixel shader.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.