URSC and SSAO; Getting PSX Shaders to Work with Ambient Occlusion

Godot Version

4.5.0

Question

Had a question about the spatial shaders from Zorochase’s Ultimate Retro Shader Collection (GitHub - Zorochase/ultimate-retro-shader-collection: Shaders bringing 5th-gen console aesthetics to Godot 4.) and the in-engine environmental post-processing effects: can anyone identify what part of the shader code causes the SSAO to not be visible in-game/in the preview viewer, despite the Advanced SSAO viewer showing the shadowing working as-intended? Would it be possible to enable the SSAO ambient shadowing alongside the vertex jitter and affine texture mapping? The specific part of the GitHub package that controls the shaders’ visuals is common.gdshaderinc.


Figured it out with the help of RisingThumb over in the func_godot Discord community! Had to add this to the uniforms section of the shader code:

uniform sampler2D texture_ambient_occlusion : hint_default_white, filter_linear_mipmap, repeat_enable;
uniform vec4 ao_texture_channel = vec4(1.0, 0.0, 0.0, 0.0);
uniform float ao_light_affect : hint_range(0.0, 1.0, 0.01) = 1;

and this to the fragment section:

    // Ambient Occlusion: Enabled
    AO = dot(texture(texture_ambient_occlusion, uv), ao_texture_channel);
    AO_LIGHT_AFFECT = ao_light_affect;
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.