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?
depth shift and depth clipping
Started by abc9804, Oct 18 2007 03:51 AM
8 replies to this topic
#1
Posted 18 October 2007 - 03:51 AM
#2
Posted 18 October 2007 - 04:18 AM
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.
For depth clipping, just set the near plane and far plane to the appropriate distances.
reedbeta.com - developer blog, OpenGL demos, and other projects
#3
Posted 18 October 2007 - 07:53 AM
Alternatively you can use glDepthRange.
http://iki.fi/sol - my schtuphh
#4
Posted 18 October 2007 - 04:25 PM
glDepthRange doesn't actually *clip* depths, just rescales depths from the [0, 1] range into the subrange you specify.
reedbeta.com - developer blog, OpenGL demos, and other projects
#5
Posted 19 October 2007 - 02:02 AM
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?
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?
#6
Posted 19 October 2007 - 04:40 PM
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.
reedbeta.com - developer blog, OpenGL demos, and other projects
#7
Posted 22 October 2007 - 09:51 AM
Reedbeta,thanks for your reply.
I simply want to study which function can implement the depth shift operation?
I simply want to study which function can implement the depth shift operation?
#8
Posted 22 October 2007 - 05:34 PM
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.
reedbeta.com - developer blog, OpenGL demos, and other projects
#9
Posted 23 October 2007 - 02:04 AM
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.
Of course,if you have more opinions,I will thanks a lot.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












