May 20, 20215 yr Hi, I'm making a simple post-processing shader for P3D v5, which requries depth input. However after drawing the depth buffer to the screen, I noticed that it's basically the grayscale version of the color buffer, instead of the expected depth buffer. Am I doing something wrong? This is the shader code: #include "Quad.sh" Texture2D<float4> srcTex; Texture2D<float> srcDepth; float4 PsSSAOMain(PsQuad vert) : SV_Target { uint2 texture_dimensions; srcDepth.GetDimensions(texture_dimensions.x, texture_dimensions.y); int3 texture_coordinates = int3(vert.texcoord * texture_dimensions, 0); float depth = srcDepth.Load(texture_coordinates); return float4(depth, depth, depth, 1.0); } This is the XML file for configuration: <?xml version="1.0" encoding="UTF-8"?> <SimBase.Document Type="AceXML" version="1,0"> <PostProcessEffects.PostProcessDefinition> <EffectName>SSAO</EffectName> <ShaderFileName>SSAO.psh</ShaderFileName> <ShaderEntryPoint>PsSSAOMain</ShaderEntryPoint> <ColorRequest>TRUE</ColorRequest> <DepthRequest>TRUE</DepthRequest> </PostProcessEffects.PostProcessDefinition> </SimBase.Document> This is the result I'm getting: It doesn't look like the depth buffer at all. Thanks in advance. PC specs: i5-12400F, RTX 3070 Ti and 32 GB of RAM. Simulators I'm using: X-Plane 12, Microsoft Flight Simulator (2020) and FlightGear.
Archived
This topic is now archived and is closed to further replies.