This repository was archived by the owner on Oct 4, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-useCTexture::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.