tag:blogger.com,1999:blog-4217826068942535587.post1993837842484806351..comments2023-10-07T11:24:50.610+02:00Comments on Outerra: Logarithmic Depth BufferOuterrahttp://www.blogger.com/profile/01028397138049592535noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-4217826068942535587.post-43669664198268330342012-05-19T07:02:17.249+02:002012-05-19T07:02:17.249+02:00Source code is really just that one line modifying...Source code is really just that one line modifying the value of z, that you put at the end of your vertex shader. Here's what I use:<br /><br /> gl_Vertex = modelviewproj * pos;<br /> gl_Vertex.z = logzbuf(gl_Vertex, invfarplanecoef);<br /><br />Where logzbuf function is:<br /><br />float logzbuf( vec4 xyzw, float invfarplanecoef ) {<br /> return (log(1 + xyzw.w) * invfarplanecoef - 1) * xyzw.w;<br />}<br /><br />invfarplanecoef is a uniform containing precomputed value:<br /><br /> invfarplanecoef = 2.0f / log(farp + 1);<br /><br />with farp being the far plane distance.Outerrahttps://www.blogger.com/profile/01028397138049592535noreply@blogger.comtag:blogger.com,1999:blog-4217826068942535587.post-70626357740643381352012-05-19T06:46:03.764+02:002012-05-19T06:46:03.764+02:00Great solution!
Is there a source code you are wil...Great solution!<br />Is there a source code you are willing to share?<br />It would be highly appreciated.Unknownhttps://www.blogger.com/profile/14574665912401342110noreply@blogger.comtag:blogger.com,1999:blog-4217826068942535587.post-406524285595321732011-07-03T12:45:21.861+02:002011-07-03T12:45:21.861+02:00What a beautiful masterpiece of virtual engineerin...What a beautiful masterpiece of virtual engineering! You guys should be working for the big ones...NaXxhttps://www.blogger.com/profile/11410440718265973499noreply@blogger.comtag:blogger.com,1999:blog-4217826068942535587.post-22517419135311460222010-11-11T23:30:11.490+01:002010-11-11T23:30:11.490+01:00this is damn sexy! :) awesomethis is damn sexy! :) awesomerlyehhttps://www.blogger.com/profile/13701136393990300096noreply@blogger.com