Commit 9d4a304
[Port] [2022.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 a59444a commit 9d4a304
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 | |
|---|---|---|---|
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | | - | |
| 1137 | + | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
1142 | | - | |
| 1142 | + | |
1143 | 1143 | | |
1144 | 1144 | | |
1145 | 1145 | | |
| |||
1720 | 1720 | | |
1721 | 1721 | | |
1722 | 1722 | | |
1723 | | - | |
| 1723 | + | |
1724 | 1724 | | |
1725 | 1725 | | |
1726 | 1726 | | |
| |||
1957 | 1957 | | |
1958 | 1958 | | |
1959 | 1959 | | |
| 1960 | + | |
1960 | 1961 | | |
1961 | | - | |
| 1962 | + | |
1962 | 1963 | | |
1963 | 1964 | | |
1964 | 1965 | | |
| |||
1977 | 1978 | | |
1978 | 1979 | | |
1979 | 1980 | | |
1980 | | - | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
1981 | 1995 | | |
1982 | 1996 | | |
1983 | 1997 | | |
| |||
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