Search the Community
Showing results for tags 'deffered rendering'.
-
Hi, How to reconstruct true depth value from depth buffer obtained during rendering shading? Assuming that the format of the depth texture is RBA8 and we have the same image obtained from the texture how to get depth value in world cordinates ? Ive found the function : float getDeferredDepth(half4 deferred) { float3 factor = float3(16711680.0f / 8388608.0f,65280.0f / 8388608.0f,255.0f / 8388608.0f); #ifndef MULTISAMPLE_0 deferred.x -= floor(deferred.x * (510.0f / 256.0f)) * (128.0f / 255.0f); #endif float distance = 1.0f - dot(deferred.xyz,factor); return distance * distance; } in the shader but i dont know why it doesnt work when i do the same computations on the CPU. Should i use integer pixel format or float one ? Can somone briefly explain the sense of these computations? Thanks
-
Hi, Im stucked on this problem for a while now. When no multisampling is set i grab buffers content of deferred : ///////////////////////////////// // deferred textures ///////////////////////////////// RenderDeferred deferred; create_deferred(&deferred); in method void RenderRenderer::render_world(const char *materials,int shadows) just after rendering to texture is finished ( i render buffers on the screen + save to the image ) in both cases texture content is empty. Its strange because when multisampling is on engine.app->getMultisample()> 0 ) the content is correct. Im really stucked on this. Thanks,