MCPcopy Create free account
hub / github.com/carbonengine/trinity / SetProjectionDerivedValues

Function SetProjectionDerivedValues

trinity/Tr2Renderer.cpp:186–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void 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
210void CreateFallbackTexturesWithColor( uint32_t color, Tr2TextureAL* outputTextures, Tr2PrimaryRenderContext& renderContext )

Callers 5

AdjustProjectionMethod · 0.85
SetOrthoProjectionMethod · 0.85
PopProjectionMethod · 0.85

Calls 2

LengthFunction · 0.85

Tested by

no test coverage detected