Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Depth buffer access from P3D post-processing system

Featured Replies

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:

finrop4.png

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.