Advertisement

Light and Blending general Questions

Started by February 13, 2001 04:09 PM
7 comments, last by Clouds3000 23 years, 9 months ago
Could some of you guys that know what they're talkin' about give me a few hints on the following questions. -When I enable blending, I may have a texture mapped object, but after I have binded the texure and before I draw it I state glColor4f(1.0f,1.0f,1.0f,1.0f); And I can still see through it? If I lower the alpha value it becomes more transparent but i thought that 1.0f was opaque? Everytime I enable blending all my objects on screen become transparent? -When I enable lighting, I may put the ambient lights value at (1.0f,1.0f,1.0f,1.0f) which is it's brightest,...yea? But it is still twice as dark if lighting is disabled? And if on a cube I also type in its normals, willa diffuse light source work properly if the user is moving, like 1st person style? If not, how and where can I learn this. Help is well appreciated cause I love OpenGl and this site Rocks!! Edited by - Clouds3000 on February 13, 2001 5:11:31 PM
A/
to make objects not blend use either
glBlendFunc(GL_ONE,GL_ZERO)
or
glDisable(GL_BLENDING)

B/
try
ambient (2.0f,2.0f,2.0f,2.0f) then

http://members.xoom.com/myBollux
Advertisement
A/
I want some of my objects to blend, but some to be solid, both these functions you gave me disable it completely. It is not possible to blend only some objects and not others, must I use proper transparency. You see I want to load a bitmap onto a quad and remove the blackness around it using blending. But when I do this the whole level becomes transparent.

B/
You''re a genius =)
You might want to use RGBA textures, perhaps in targa format on disk.

That way, you can store the transparency in the texture.

- Peter
Thanks for the advice guys but I got it working, just was enabling the blending at the wrong place.

BUT,....about the normals questions. I enabled Diffuse light and the walls of my level light up differently as I approach and walk away fom them so I presume that the lighting/normals thing is reletive to my position or something........?
How can I Diffuse light and have it working so that it still diffuses correctly as I move around the level.

Sorry for being a pain in the ass.
start of frame
position camera
position lights (must be done every time u move the camera, thus do it every frame)

http://members.xoom.com/myBollux
Advertisement
Thanks,......
and finally, does anyone know what the code for inverse COS using the math.h library is?
I can COS something but dunno how to COS-1 it, (tried cos-1,...doesn''t work)

Thanks guys
Try ArcCos()
acos( number in radians )

http://members.xoom.com/myBollux

This topic is closed to new replies.

Advertisement