Archived

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

Aggrix

Textures With Windows

Recommended Posts

I made textures for the sides of a house with alpha channels for the windows. I want the using to be able to look through the windows and see the other sides of the house(inside). I use quads for the house. I draw the front, right, left then the back of the house. The back is the only side that can see the other inside sides(because I made it last). The left can only see the front and right and so on. I tried using glDepthMask but that makes the whole side transparent. I hope you understand this. Any ideas on how I would make each side be able to see the other inside sides? Thnx

Share this post


Link to post
Share on other sites
I *think* that if you render all house with one call, you''ll get what you want. At least this is how it is in D3D. Otherwise, you can 1) sort walls and draw them back-to-front or 2) use stencil buffer, but I have no clue how.

Share this post


Link to post
Share on other sites
Your problem might be that you have not drawn the back wall or that you have not disabled GL_CULL_FACE.

-----------------------------
Sometimes a Guru meditation must be followed by a Vulcan neck grip.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Maybe you should look in to alpha testing, not alpha blending. The good thing is that you don''t have to depth sort, but the bad thing is that the transparency is "all or nothing" - that is, no semitransparency. It might be what you''re looking for.

Share this post


Link to post
Share on other sites
The blending works, its just that with some sides I can''t see the others sides. The front is drawn drawn first, so the other sides dont exist yet (to the front) so i cant see anything. I might have to do something like IndirectX side (draw everyhting at once) but don''t know if it is possible with OpenGL. I checked and CULL_FACE is off. Is there any other way to do this? (if any)

Share this post


Link to post
Share on other sites
It''s a z-buffer problem. When you draw the wall, opengl thinks that the window is solid, so it updates the z-buffer. Then, when you draw something behind the window, opengl looks at the z-buffer and says, "I can''t draw this because there is something that''s blocking it".

What you need to do is draw the walls in the order of farthest away to closest

Share this post


Link to post
Share on other sites
thanx for the replies

I forgot to mention that you can rotate the house. So if you rotate to the back of the house, you cant see anyhing through the back wall''s windows (because now I draw that first).

Any other ideas?

Share this post


Link to post
Share on other sites