Fix artifacts due to light shape culling and use depth test to improve perf

This commit is contained in:
Wojtek Figat
2024-04-14 23:44:08 +02:00
parent 00f2a0b825
commit 25f3cef8c3
7 changed files with 113 additions and 114 deletions

View File

@@ -16,30 +16,15 @@
class ReflectionsPass : public RendererPass<ReflectionsPass>
{
private:
PACK_STRUCT(struct Data {
ShaderEnvProbeData PData;
Matrix WVP;
ShaderGBufferData GBuffer;
});
AssetReference<Shader> _shader;
GPUPipelineState* _psProbeNormal;
GPUPipelineState* _psProbeInverted;
GPUPipelineState* _psCombinePass;
GPUPipelineState* _psProbe = nullptr;
GPUPipelineState* _psProbeInside = nullptr;
GPUPipelineState* _psCombinePass = nullptr;
AssetReference<Model> _sphereModel;
AssetReference<Texture> _preIntegratedGF;
public:
/// <summary>
/// Init
/// </summary>
ReflectionsPass();
public:
/// <summary>
/// Perform reflections pass rendering for the input task.
/// </summary>
@@ -48,7 +33,6 @@ public:
void Render(RenderContext& renderContext, GPUTextureView* lightBuffer);
public:
// [RendererPass]
String ToString() const override;
bool Init() override;
@@ -56,15 +40,14 @@ public:
#if COMPILE_WITH_DEV_ENV
void OnShaderReloading(Asset* obj)
{
_psProbeNormal->ReleaseGPU();
_psProbeInverted->ReleaseGPU();
_psProbe->ReleaseGPU();
_psProbeInside->ReleaseGPU();
_psCombinePass->ReleaseGPU();
invalidateResources();
}
#endif
protected:
// [RendererPass]
bool setupResources() override;
};