set the depth buffer's clear value

What it says on the tin: a place to discuss proposed new features.
Post Reply
cyrfer
Orc
Posts: 424
Joined: Wed Aug 01, 2007 8:13 pm
Location: Venice, CA, USA
x 2

set the depth buffer's clear value

Post by cyrfer » Mon Oct 05, 2009 10:18 pm

Hi,
I'm trying to do some sanity testing while writing shaders. It would be great if I could specify the clear value of the depth buffer so I can check it in my shader. In OpenGL, this is done with 'glClearDepth' as far as I can tell, not sure about D3D. It seems like the right place would be in the Viewport class. Maybe the interface would look like this?

Code: Select all

@param value the value to initialize all pixels in the depth buffer with
void Viewport::setDepthClear(double value);
Thanks :)
0 x

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7152
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 19

Re: set the depth buffer's clear value

Post by Kojack » Tue Oct 06, 2009 1:18 am

If you don't mind clearing manually rather than using the auto clear, you can call Viewport::clear which takes a colour, depth and stencil value to clear the buffer with.
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Re: set the depth buffer's clear value

Post by haffax » Tue Oct 06, 2009 11:36 am

I see, Viewport::clear is new in SVN trunk. I added it to the changelog in the CthugaNotes in the wiki.

Anyway, having a getter/setter for a depth value is still nice and not hard to do and doesn't need any adjustments design wise.
Cryfer, if you still need it, best implement it yourself and submit a patch.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4146
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 268
Contact:

Re: set the depth buffer's clear value

Post by dark_sylinc » Thu Mar 04, 2010 5:14 am

haffax wrote:Anyway, having a getter/setter for a depth value is still nice and not hard to do and doesn't need any adjustments design wise.
Cryfer, if you still need it, best implement it yourself and submit a patch.
I'm not Cyfer, but done.
0 x

Post Reply