View Full Version : LiGhtninG and textures
09-12-2005, 02:17 AM
I've got a free form object and texture puttinG on it. And one liGht source. How can i make my texture to chanGe it pixels liGhtness accordinG to the location of the liGht source.
09-12-2005, 04:50 AM
uh you should fix your g key :)
i can only guess what you want to do but you're probably talking about normal mapping. you will need to write shaders for that. here you can find tutorials on this technique: http://www.ultimategameprogramming.com/
09-12-2005, 10:17 AM
Oh, thank you. :)
I will try it right now.
09-22-2005, 01:25 AM
Sorry, i have to do this without shaders.
Maybe i should repeat my question more simple.
I have an object with texture and light source. Light source has no effect on texture. How can i do that?
You need to calculate the normals for each vertex in your model, and then you'll be able light your object from any angle.
Read this for starters:
09-22-2005, 05:06 AM
Also, you need to make sure that your texturing environment is set up as GL_MODULATE.
I think the default is GL_DECAL which does a straight replace of the fragment color with the texture sample. This will obliterate any lighting calculations since lighting is done first.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.