Jump to content
  • Advertisement

Corey Weinheimer

  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Corey Weinheimer

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Corey Weinheimer

    Alpha Blending Depth Problem

    I have a related problem with alpha blending textured transparent objects in OpenGl. This is my approach: 1) Enable Depth Buffering 2) Enable Front Face Culling 3) Draw meshes of solid objects 4) Break Transparent Meshes into Triangles 5) Sort tranparent triangles by distance 6) Enable Alpha Blending (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) 7) Disable Culling 8) Draw transparent triangles from back to front with depth buffering still enabled. This works great for everything but the back side of the transparent objects. When I place the first object in the view, it draws the triangles for the first object exactly as they should be drawn. ie. a box looks like a clear box. When I place a second tranparent object behind the first one, some of the triangles from the farthest wall of each object disappear. The triangles from all the other sides (front, top, left, right, bottom) look great. I've also tried front culling, drawing the triangle, back culling, and then redrawing the same triangle. That seems to give the same effect as just disabling culling. Any ideas what's going on and how I should attempt to fix the problem?
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!