Sign in to follow this  

Need help on basic transparency and lighting in GLUT...

Recommended Posts

Hi Guys !! This is my first post here, so please help me out people...:D I have recently started learning GLUT, and have been on a mission to create this scene in GLUT....I have gotten about half way though, but now I am facing some serious problems....please hear me out... I am trying to create this image in GLUT: Now, I have done some work on it the background gradient (going from white to purple)...I loaded a texture for that...actually I tried to implement it though lighting, but that didnt work for me... Basically, the two major problems I am facing now are these: 1) I dont quite know how to create clouds that are in the bottom half of the picture..... I thought of using clouds 'layers'... Here is the basic idea I thought of: a) I make some cloud textures in photoshop b) I load these textures in GLUT c) I tell GLUT to make the cloud 'layers' transparent, based on the texture color at a specific pixel..If its 100% white, then it should be completely transparent...if its a light blue colour (like in the picture above), then it should be opaque....I dont know how to implement this in GLUT though... 2) The second question I have is this: Can lighting be only used on 3D shapes ? Can't it be used on 2D shapes like GL_QUADS, GL_POLYGON ?? I can get light to fall on 2D shapes like GL_QUADS, etc...but I canNOT get the light to distribute on the *un*evenly...What I mean to say is that, the light just spreads out on the surface of GL_QUADS uniformly eveywhere....whereas it should actually be brighter on areas nearer to the light source (like in real life)... If someone can show me how to use proper lighting on 2D shapes like GL_QUADS, I would be really greatful... Also, here is my project (not finished though):

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this