开发者

JOGL Textures are semi-transparent

开发者 https://www.devze.com 2023-04-10 03:42 出处:网络
Sorry if this is a simple fix, but I can\'t seem to find the solution. I\'ve created a box that is textured by making four quads. However, when I rotate the box around to see how it rendered, the tex

Sorry if this is a simple fix, but I can't seem to find the solution.

I've created a box that is textured by making four quads. However, when I rotate the box around to see how it rendered, the textures that should be should not be visible are displayed on the top of the other textures.

I think this has to do with the order in which they are rendered. I render the front face of the box first, so that when I rotate to the back, the front texture is displayed over the back开发者_如何学Python.

I recall seeing something about 'culling' but I can't find any documentation. Any help to point me in the right direction would be greatly appreciated!


First Make sure you enabled Depth test and also 'z' values of the quads in the box are correct. Your problem seems like you are using same depth values for the quads or just having depth test disabled.

A quick search gave me this link.Hope it will help. http://www.leolol.com/drupal/tutorials/3d-graphics-jogl-opengl-etc/jogl-lesson-4-3d-shapes-and-rotation-opengl

PS: your title for this post doesn't support your question :(


This sounds (although looking would be better, meaning some code) rather like a depth testing issue than a culling issue. Are you sure you enabled depth testing (glEnable(GL_DEPTH_TEST)) and retrieved a context with a depth buffer?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号