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

on light shaders

Started by Khaos Dragon Mar 18, 2005 at 7:52 PM 3 replies 1.2k views
Original Post
Khaos Dragon
Khaos Dragon
I want to develop a shader based lighting model for my scene, but I have a few initial conceptual questions. Is normal mapping a separate thing from the main lighting model, or is it pretty much a lighting model? As I understand it, the basic process involves passing a light's position and a vertex's position to a shader along with a texture coordinate for color, normal, and spec values which are stored in separate texture units. Does anyone have any pointers?
zedzeek
zedzeek
>>Is normal mapping a separate thing from the main lighting model, or is it pretty much a lighting model?<<
if u mean standard opengl light eg glLightfv(...) then yes its different

>>As I understand it, the basic process involves passing a light's position and a vertex's position to a shader along with a texture coordinate for color, normal, and spec values which are stored in separate texture units.<<

no not for standard normalmapping u need to send for each vertice. vert position, normal, tangent, binormal

theres heaps of info on the web that explains normalmapping have a search :)
Khaos Dragon
Khaos Dragon
Quote:
Original post by zedzeek
>>Is normal mapping a separate thing from the main lighting model, or is it pretty much a lighting model?<<
if u mean standard opengl light eg glLightfv(...) then yes its different
:)


No by lighting model I mean any per pixel based lighting model, not the fixed pipeline one. So I am wondering if normal mapping is a fully fledged lighting model by itself or if it just complements a lighting model.
_the_phantom_
_the_phantom_
well, you can have lighting models without normal mapping.

The standard OpenGL vertex lighting is one lighting model, you might have your own per-vertex lighting model performed in a vertex shader, you then have various per-pixel lighting models of varying degrees of complexity, adding normal mapping to them just increase the realism of the scene, so while its technically a seperate concept its part of the overall lighting model when used in a scene.
qesbit
qesbit
It isn't a lighting model but it is a part of them. There really isn't any other way to do it (on GPUs that I know of) so I guess I would say it is a standard part of per-pixel lighting.

A lighting model is the equation, a normal map is just an input to it.











Topic Locked

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

Sign in to reply to this topic.