Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Clouds3000

Light and Blending general Questions

This topic is 6392 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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 =)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You might want to use RGBA textures, perhaps in targa format on disk.

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

- Peter

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!