| 184 | } |
| 185 | |
| 186 | void SetProjectionDerivedValues() |
| 187 | { |
| 188 | s_projectionRawTransform = s_projectionTransform; |
| 189 | |
| 190 | // Apply scaling and offset to projection matrix. If the viewport extends |
| 191 | // the render target we need to clip the viewport and thus scale+offset the |
| 192 | // projection. |
| 193 | s_projectionTransform = s_projectionTransform * s_viewport2projectionAdjustment; |
| 194 | |
| 195 | // Cache inverse projection matrix |
| 196 | s_inverseProjectionTransform = Inverse( s_projectionTransform ); |
| 197 | |
| 198 | Vector4 corner( 1.f, 1.f, 1.f, 1.f ); |
| 199 | corner = Transform( corner, s_inverseProjectionTransform ); |
| 200 | Vector3 viewCorner( corner.x / corner.w, corner.y / corner.w, corner.z / corner.w ); |
| 201 | s_frustumRadius = Length( viewCorner ); |
| 202 | |
| 203 | // Ensure TriVariable store is aware of the projection transform. Used by some debugging shaders. |
| 204 | s_projectionMatrixVar = s_projectionTransform; |
| 205 | s_projectionMatrixInvVar = s_inverseProjectionTransform; |
| 206 | UpdateViewProjectionTransform(); |
| 207 | } |
| 208 | |
| 209 | |
| 210 | void CreateFallbackTexturesWithColor( uint32_t color, Tr2TextureAL* outputTextures, Tr2PrimaryRenderContext& renderContext ) |
no test coverage detected