GU_TRANSFORM_2D Question -- never mind --

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

GU_TRANSFORM_2D Question -- never mind --

Post by subbie »

I wrote a font render based on the example in the sdk yet I have an odd issue. Regardless if I render it prior or after my scene. My text apears behind my 3d objects (have to pan the camera to a spot where no 3d is rendered just to see the text).

The sample renders using sprites/quads and GU_TRANSFORM_2D flag.

Is there some strange render priority between 2d & 3d transformation? Or is there just something simple i need to do to make the font render on top?

-- Edit --
Never mind. I do have to disable depth_test vs just setting the depth_mask.
Last edited by subbie on Fri Aug 18, 2006 6:22 pm, edited 1 time in total.
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

Sounds like a z buffer issue. Try switching to orothogonal rendering then draw your 2d. Or try clearing the depth buffer. ( glClear( GL_DEPTH_BUFFER_BIT) )
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

Kojima wrote:Sounds like a z buffer issue. Try switching to orothogonal rendering then draw your 2d. Or try clearing the depth buffer. ( glClear( GL_DEPTH_BUFFER_BIT) )
--edit--
I need to disable depth_test to solve for it.
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

Either that, or you could set a better z-value on your 2D text, it still applies even though the 3D transform is disabled. Could be nice if you intend to render your 2D hud in layers. Setting your raw Z-value to 1.0f would result in a value of 65535 in the zbuffer.
GE Dominator
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

chp wrote:Either that, or you could set a better z-value on your 2D text, it still applies even though the 3D transform is disabled. Could be nice if you intend to render your 2D hud in layers. Setting your raw Z-value to 1.0f would result in a value of 65535 in the zbuffer.
Well actualy the Z value was 0.0f, So unless maybe my scene was rendered above 0, I am a little confused why text went behind transformed geometry.
Post Reply