From 4e9cc110d7cf3226861eee7ce563891a99bcfd1a Mon Sep 17 00:00:00 2001 From: Turanszki Janos Date: Sat, 3 Jul 2021 18:09:05 +0200 Subject: [PATCH] fix: ambient occlusion affects hair particle --- WickedEngine/shaders/hairparticlePS.hlsl | 12 ++++++++++++ WickedEngine/wiVersion.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/WickedEngine/shaders/hairparticlePS.hlsl b/WickedEngine/shaders/hairparticlePS.hlsl index 55cd6968b..f53b5e445 100644 --- a/WickedEngine/shaders/hairparticlePS.hlsl +++ b/WickedEngine/shaders/hairparticlePS.hlsl @@ -19,12 +19,24 @@ GBuffer main(VertexToPixel input) V /= dist; float emissive = 0; + const uint2 pixel = input.pos.xy; + const float2 ScreenCoord = pixel * g_xFrame_InternalResolution_rcp; + Surface surface; surface.create(g_xMaterial, color, 0); surface.P = input.pos3D; surface.N = input.nor; surface.V = V; surface.pixel = input.pos.xy; + +#ifndef PREPASS +#ifndef ENVMAPRENDERING +#ifndef TRANSPARENT + surface.occlusion *= texture_ao.SampleLevel(sampler_linear_clamp, ScreenCoord, 0).r; +#endif // TRANSPARENT +#endif // ENVMAPRENDERING +#endif // PREPASS + surface.update(); Lighting lighting; diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index 117193a87..681d3108d 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wiVersion // minor features, major updates, breaking compatibility changes const int minor = 56; // minor bug fixes, alterations, refactors, updates - const int revision = 58; + const int revision = 59; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);