Commit f0f660b
[Port] [2021.3] Fix HDRP sky rendering when Camera Relative Rendering is disabled
This PR fixes HDRP sky rendering when Camera Relative Rendering is disabled.
`ComputePixelCoordToWorldSpaceViewDirectionMatrix()` in `HDCamera.cs` contains:
```
...
if (useGenericMatrix)
{
var viewSpaceRasterTransform = new Matrix4x4(
new Vector4(2.0f * resolution.z, 0.0f, 0.0f, -1.0f),
new Vector4(0.0f, -2.0f * resolution.w, 0.0f, 1.0f),
new Vector4(0.0f, 0.0f, 1.0f, 0.0f),
new Vector4(0.0f, 0.0f, 0.0f, 1.0f));
var transformT = viewConstants.invViewProjMatrix.transpose * Matrix4x4.Scale(new Vector3(-1.0f, -1.0f, -1.0f));
return viewSpaceRasterTransform * transformT;
}
...
```
Here the view matrix that was used to build `viewConstants.invViewProjMatrix` has translation component if Camera Relative Rendering is disabled when it shouldn't.

Scene View

Game View, bugged

Game View, fixed1 parent 98c140f commit f0f660b
File tree
3 files changed
+77
-5
lines changed- Packages/com.unity.render-pipelines.high-definition
- Runtime/RenderPipeline/Camera
- Tests/Editor
3 files changed
+77
-5
lines changedLines changed: 19 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
1066 | | - | |
| 1066 | + | |
1067 | 1067 | | |
1068 | 1068 | | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | | - | |
| 1071 | + | |
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
| |||
1618 | 1618 | | |
1619 | 1619 | | |
1620 | 1620 | | |
1621 | | - | |
| 1621 | + | |
1622 | 1622 | | |
1623 | 1623 | | |
1624 | 1624 | | |
| |||
1859 | 1859 | | |
1860 | 1860 | | |
1861 | 1861 | | |
| 1862 | + | |
1862 | 1863 | | |
1863 | | - | |
| 1864 | + | |
1864 | 1865 | | |
1865 | 1866 | | |
1866 | 1867 | | |
| |||
1879 | 1880 | | |
1880 | 1881 | | |
1881 | 1882 | | |
1882 | | - | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
1883 | 1897 | | |
1884 | 1898 | | |
1885 | 1899 | | |
| |||
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments