maciek.mostowski Posted February 5, 2014 Posted February 5, 2014 Another similar question. From my understunding depth = getDeferredDepth(deferred_depth)*s_depth_range.y returns distance betwen camera position and the point (even in ortho). Unlike "traditional" depth values which return z values in the camera cordinates. How to reconstruct z values in eye cordinates? The method i invented was doing that was multiplying inverseProjectionMatrix to the point (IN.texcoord_0.x*2.0 - 1.0 ,2.0 * (1.0 - IN.texcoord_0.y) -1.0, 0.0, 1.0 ). (obtained y,x values doesn't depend from depth value) In obtained vertex values vertex.x / vertex.w , vertex.x/vertex.w are x and y cordinates of the point in eye space. so z*z will be equal to depth*depth - x*x - y*y.. It's not very straight forward method. Is there any easier way to do that in unigine?
frustum Posted February 6, 2014 Posted February 6, 2014 data/samples/shaders/post_coordinate_00 sample reconstructs world coordinate from the deferred depth buffer.
maciek.mostowski Posted February 6, 2014 Author Posted February 6, 2014 Ok thanks, my previous calculations were wrong. Its a bit cryptic - position reconstruction in unigine.
Recommended Posts