Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 01 Dec 2006
Offline Last Active Feb 24 2012 07:40 AM

Posts I've Made

In Topic: 2D performance problem

31 January 2012 - 04:29 AM

Issuing draw calls per quad can quickly become a CPU bottleneck, especially on older machines. Follow the advice of SimonForsman, focus on batching multiple quads that use the same texture in a single VBO. This should greatly improve your performance on older computers.

In Topic: How GLSL know if texture is unbinded?

18 August 2010 - 11:09 PM

AFAIK GLSL doesn't know that you haven't bound a texture to the sampler, causing it to use black as the texture color. A solution could be to use a different shader for single texturing. Alternatively if you want to use only 1 shader you can bind a small white texture (1x1) to GL_TEXTURE1 when you only have one regular texture.

In Topic: [D3D9 C++] - Transparent meshes hiding parts of themselves!

10 August 2010 - 12:53 AM

Original post by Tom KQT
I just add two thoughts as addition to Marco's second post (not correcting him, just specifying):

- Those two draw commands will be axactly the same, you don't need to sub-set your mesh any special way.

- This simple solution will work also for "complex" meshes as long as they are convex. It won't work properly for concave meshes.
Now the question is how "complex" a convex mesh can be :D

Thanks that's exactly what I meant, but clearer ;-)

In Topic: [D3D9 C++] - Transparent meshes hiding parts of themselves!

09 August 2010 - 11:43 PM

My solution was as follows:

-> Turn on front face culling
-> Draw cube (this will always draw the inside of the cube)
-> Turn on back face culling
-> Draw cube (this will draw outside of the cube)

However this solution is only suitable for relatively simple shapes such as cubes. If your meshes are more complex you need more advanced solutions to achieve correct transparent rendering. Using simple submeshes and sort them is possible, you can also look into more advanced techniques such as depth peeling.
For more information: NVIDIA website

In Topic: [D3D9 C++] - Transparent meshes hiding parts of themselves!

09 August 2010 - 08:24 PM

In your transparency pass, render the back faces first (cull front faces) and render the front faces after that (cull back faces). If you just disable culling the render order depends on the order of the faces in the mesh (so sometimes it looks correct and sometimes it doesn't).

Also you mention front2back, I assume you meant back-to-front for the transparency pass?