Skip to content
This repository was archived by the owner on Oct 4, 2022. It is now read-only.

Bad render target in snow displacement #449

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yuriy0
Copy link

@yuriy0 yuriy0 commented Dec 3, 2019

stereoL and stereoR are not resized automatically in
CDeferredShading::CreateDeferredMaps, so it's very likely that stereo{L/R} are
different sizes than the other gbuffer render targets! This breaks things since
all render targets must be the same size.

Also, stereoR is overwritten by SSDO in between snow accumulation and snow
displacement passes. We cannot use stereoR here even if it was the right size.

Issue #, if available:

Description of changes:
This patch changes the snow displacement render pass to use its own dedicated texture called $SnowDisplacement instead of trying to re-use CTexture::s_ptexStereoR which doesn't work for several reasons (see above).

It might be the case that there's some other texture which already exists which we can re-use. In this case, this is extremely fragile, because the snow displacement texture is written to right after the z-pass but then used to actually perform snow displacement after deferred tiled lighting, opaque and transparent passes (e.g. water, emissive pass, decals, fog, particles). Any of these draw calls could clobber any "global" texture that we attempt to re-use as the snow displacement RT. So using a dedicated texture is the most robust possible solution.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

stereoL and stereoR are not resized automatically in
CDeferredShading::CreateDeferredMaps, so it's very likely that stereo{L/R} are
different sizes than the other gbuffer render targets! This breaks things since
all render targets must be the same size

Also, stereoR is overwritten by SSDO in between snow accumulation and snow
displacement passes. We cannot use stereoR here even if it was the right size
@sourjon
Copy link

sourjon commented Dec 4, 2019

Thanks @yuriy0 ! We appreciate all of your submissions!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants