Skip to content

[Fogbugz 1329173] Fixing wrong pyramid color dimensions when hardware DRS is on. #4346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed an issue where runtime debug window UI would leak game objects.
- Fixed NaNs when denoising pixels where the dot product between normal and view direction is near zero (case 1329624).
- Fixed ray traced reflections that were too dark for unlit materials. Reflections are now more consistent with the material emissiveness.
- Fixed pyramid color being incorrect when hardware dynamic resolution is enabled.

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,13 @@ public int RenderColorGaussianPyramid(CommandBuffer cmd, Vector2Int size, Textur
cmd.ClearRenderTarget(false, true, Color.black);
}

float sourceScaleX = (float)size.x / source.width;
float sourceScaleY = (float)size.y / source.height;
bool isHardwareDrsOn = DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled();
var hardwareTextureSize = new Vector2Int(source.width, source.height);
if (isHardwareDrsOn)
hardwareTextureSize = DynamicResolutionHandler.instance.ApplyScalesOnSize(hardwareTextureSize);

float sourceScaleX = (float)size.x / (float)hardwareTextureSize.x;
float sourceScaleY = (float)size.y / (float)hardwareTextureSize.y;

// Copies src mip0 to dst mip0
m_PropertyBlock.SetTexture(HDShaderIDs._BlitTexture, source);
Expand Down