From: Ove K. <ov...@tr...> - 2001-03-01 20:35:45
|
I just looked at what Half-Life does when gl_ztrick is enabled... gl_ztrick 1: glDepthFunc(GL_LEQUAL) glDepthRange(0, 0, 0, 1.749995) ... glLoadIdentity() glRotatef(-90, 1, 0, 0) glRotatef(90, 0, 0, 1) glRotatef(0, 1, 0, 0) glRotatef(0, 0, 1, 0) glRotatef(-77.393188, 0, 0, 1) ... glDepthFunc(GL_GEQUAL) glDepthRange(0, 1.875, 0, 1.75) ... glLoadIdentify() glRotatef(-90, 1, 0, 0) glRotatef(90, 0, 0, 1) glRotatef(0, 1, 0, 0) glRotatef(0, 0, 1, 0) glRotatef(-77.393188, 0, 0, 1) ... gl_ztrick 0: glDepthFunc(GL_LEQUAL) glDepthRange(0, 0, 0, 1.875) ... glLoadIdentify() glRotatef(-90, 1, 0, 0) glRotatef(90, 0, 0, 1) glRotatef(0, 1, 0, 0) glRotatef(0.99, 0, 1, 0) glRotatef(-81.084595, 0, 0, 1) ... Couldn't see a whole lot of other significant differences. Does this give you any clues? |
From: Ove K. <ov...@ar...> - 2001-03-01 21:00:29
|
Oh, just noticed something else. The frame setup sequence is like: glDepthFunc glDepthRange glMatrixMode glLoadIdentity glViewport glFrustum glCullFace glMatrixMode glLoadIdentity glRotate glTranslate and I looked into the Mesa sources, where _mesa_DepthRange ... ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0); ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0 + n); is overwritten by gl_Viewport ... ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual->DepthMaxF; ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual->DepthMaxF; Maybe someone should determine what the correct code should be... |
From: Miles P. <je...@tu...> - 2001-03-01 21:39:34
|
that'd be nice. then i could finally play! hurray -miles On Thu, 1 Mar 2001, Ove Kaaven wrote: > Oh, just noticed something else. The frame setup sequence is like: > > glDepthFunc > glDepthRange > glMatrixMode > glLoadIdentity > glViewport > glFrustum > glCullFace > glMatrixMode > glLoadIdentity > glRotate > glTranslate > > and I looked into the Mesa sources, where > > _mesa_DepthRange > ... > ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0); > ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0 + n); > > is overwritten by > > gl_Viewport > ... > ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual->DepthMaxF; > ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual->DepthMaxF; > > Maybe someone should determine what the correct code should be... > > > _______________________________________________ > Dri-devel mailing list > Dri...@li... > http://lists.sourceforge.net/lists/listinfo/dri-devel > |
From: Brian P. <br...@va...> - 2001-03-05 15:23:04
|
Ove Kaaven wrote: > > Oh, just noticed something else. The frame setup sequence is like: > > glDepthFunc > glDepthRange > glMatrixMode > glLoadIdentity > glViewport > glFrustum > glCullFace > glMatrixMode > glLoadIdentity > glRotate > glTranslate > > and I looked into the Mesa sources, where > > _mesa_DepthRange > ... > ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0); > ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0 + n); > > is overwritten by > > gl_Viewport > ... > ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual->DepthMaxF; > ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual->DepthMaxF; > > Maybe someone should determine what the correct code should be... Try moving the _mesa_DepthRange() code into gl_Viewport() and test it. That could very well be the solution. -Brian |
From: Miles P. <je...@tu...> - 2001-03-05 23:08:45
|
If that does work, make sure to send a message to the list so it'll be in the next CVS.. being able to play halflife would be nice :) -miles On Mon, 5 Mar 2001, Brian Paul wrote: > Ove Kaaven wrote: > > > > Oh, just noticed something else. The frame setup sequence is like: > > > > glDepthFunc > > glDepthRange > > glMatrixMode > > glLoadIdentity > > glViewport > > glFrustum > > glCullFace > > glMatrixMode > > glLoadIdentity > > glRotate > > glTranslate > > > > and I looked into the Mesa sources, where > > > > _mesa_DepthRange > > ... > > ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0); > > ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0 + n); > > > > is overwritten by > > > > gl_Viewport > > ... > > ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual->DepthMaxF; > > ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual->DepthMaxF; > > > > Maybe someone should determine what the correct code should be... > > Try moving the _mesa_DepthRange() code into gl_Viewport() and test it. > That could very well be the solution. > > -Brian > > _______________________________________________ > Dri-devel mailing list > Dri...@li... > http://lists.sourceforge.net/lists/listinfo/dri-devel > |
From: Ove K. <ov...@ar...> - 2001-03-05 23:16:52
|
On Mon, 5 Mar 2001, Miles Peterson wrote: > If that does work, make sure to send a message to the list so it'll be in > the next CVS.. being able to play halflife would be nice :) Sigh... you haven't paid much attention, have you? You *are* able to play, just type "gl_ztrick 0" in the half-life console. The point of this exercise was to figure out why that was necessary, what kind of bug would cause it to render incorrectly if you don't disable ztrick. And I was considering trying to do what Brian proposed long ago already (before he suggested it, since after all, it's quite obvious), but hadn't got around to it yet, and might not for a few more days... |
From: Miles P. <je...@tu...> - 2001-03-06 01:19:26
|
if you havent noticed my posts, i get 8fps with gl_ztrick 0. thanks, gg. -miles On Tue, 6 Mar 2001, Ove Kaaven wrote: > > On Mon, 5 Mar 2001, Miles Peterson wrote: > > > If that does work, make sure to send a message to the list so it'll be in > > the next CVS.. being able to play halflife would be nice :) > > Sigh... you haven't paid much attention, have you? You *are* able to play, > just type "gl_ztrick 0" in the half-life console. The point of this > exercise was to figure out why that was necessary, what kind of bug would > cause it to render incorrectly if you don't disable ztrick. > > And I was considering trying to do what Brian proposed long ago already > (before he suggested it, since after all, it's quite obvious), but hadn't > got around to it yet, and might not for a few more days... > > |