depth shift and depth clipping

C0ce9390e5c159c2ee036faaa8cdc25d
0
abc9804 101 Oct 18, 2007 at 03:51

What is the depth shift operation? How to write it in OpenGL?
what is the depth chipping and clipping test?How to write it in OpenGL?

8 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Oct 18, 2007 at 04:18

By depth shift I assume you mean depth offset. It’s provided by an OpenGL extension called EXT_polygon_offset, which you can look up.

For depth clipping, just set the near plane and far plane to the appropriate distances.

3c5be51fdeec526e1f232d6b68cc0954
0
Sol_HSA 119 Oct 18, 2007 at 07:53

Alternatively you can use glDepthRange.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Oct 18, 2007 at 16:25

glDepthRange doesn’t actually *clip* depths, just rescales depths from the [0, 1] range into the subrange you specify.

C0ce9390e5c159c2ee036faaa8cdc25d
0
abc9804 101 Oct 19, 2007 at 02:02

In fact, I know the functions about depth buffer in OpenGL as follows:

glDepthMask
glEnable(GL_DEPTH_TEST);
glDisable(GL_DEPTH_TEST);
glDepthFunc(GL_GREATER);
glDepthRange

I don’t know how to implement the above operation with these functions.What other functions exists?How to code?

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Oct 19, 2007 at 16:40

The near and far plane are determined when you set up the projection matrix. Probably using glOrtho, glFrustum, or gluPerspective. As for the depth offset stuff, I already told you you’ll have to look it up yourself, and gave you the specific search term to do so. We’re not going to write code for you, if you want work done you’ll have to do it yourself.

C0ce9390e5c159c2ee036faaa8cdc25d
0
abc9804 101 Oct 22, 2007 at 09:51

Reedbeta,thanks for your reply.

I simply want to study which function can implement the depth shift operation?

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Oct 22, 2007 at 17:34

Okay, you’re not listening to me. I already told you what to search for in my post earlier in this thread. You can find the function yourself easily.

C0ce9390e5c159c2ee036faaa8cdc25d
0
abc9804 101 Oct 23, 2007 at 02:04

I know you told me,EXT_polygon_offset.I have looked it up,but it can not satisfy my need I think.So,I need others’ opinion.

Of course,if you have more opinions,I will thanks a lot.