Bump mapping light
How I can move the light source of the ATI_text_fragment_shader Bumpmapping?
I have to move it in the shading program or in the app code?
Thanx
I have to move it in the shading program or in the app code?
Thanx
I have readed the apple DOT3 example. Seems like the function glMultMatrixf change the light direction. But how glMultMatrixf work?
There's lots of useful OpenGL information in the Redbook; an out-of-date but still useful version is available at the bottom of the page here:
http://www.gamedev.net/reference/list.asp?categoryid=31
http://www.gamedev.net/reference/list.asp?categoryid=31
glMultMatrixf is a way to directly change the current matrix stack, either the model-view or the projection matrix, depending on what is current. It is a direct route to matrix alteration, as compared to the indirect -- though probably more useful, and apparently these days equally efficient -- approach of calling glTranslatef(), glScalef(), and glRotatef().
The pros will correct me if I'm wrong, but as far as I know, you change the light(s) location(s) in the usual way. The light energy on the surface originates at your OpenGL light sources (you know, LIGHT0, LIGHT1, LIGHT2). So you do not have to use shaders.
Change the light by using glLightfv(GL_LIGHT*, GL_POSITION, light_positition). light_position is an array of four GLfloats, corresponding to the light's position in object co-ordinates. "This location is transformed by the modelview matrix and stored in eye coordinates." (Red Book, page 187).
The pros will correct me if I'm wrong, but as far as I know, you change the light(s) location(s) in the usual way. The light energy on the surface originates at your OpenGL light sources (you know, LIGHT0, LIGHT1, LIGHT2). So you do not have to use shaders.
Change the light by using glLightfv(GL_LIGHT*, GL_POSITION, light_positition). light_position is an array of four GLfloats, corresponding to the light's position in object co-ordinates. "This location is transformed by the modelview matrix and stored in eye coordinates." (Red Book, page 187).
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Transforming directional light to eye space in GLSL | Coyote | 4 | 4,774 |
Dec 8, 2009 03:16 PM Last Post: Coyote |
|
| OpenGL Blending for 2D Light Effects | metacollin | 10 | 10,565 |
Jun 6, 2009 12:51 AM Last Post: NelsonMandella |
|
| light attenuation | NelsonMandella | 2 | 3,181 |
Jun 4, 2009 03:28 PM Last Post: reubert |
|
| 2d light shadows | KiroNeem | 2 | 2,952 |
Sep 9, 2005 01:12 PM Last Post: KiroNeem |
|
| DOT3 Bump (Normal)Mapping Example | isgoed | 5 | 8,421 |
Apr 11, 2005 12:09 AM Last Post: isgoed |
|

