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

Function PopulatePerFramePSData

trinity/Wod/WodBakingScene.cpp:33–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33static void PopulatePerFramePSData( Tr2PerFramePSData& data )
34{
35 // 0
36 memset( &data, 0, sizeof( Tr2PerFramePSData ) );
37
38 // column_major for shaders
39 Matrix viewProj = Tr2Renderer::GetViewTransform() * Tr2Renderer::GetProjectionTransform();
40 data.ViewProjectionMat = Transpose( viewProj );
41 // attention: need the transposed, but shader also needs column_major, so it is transpose(transpose(m)) == m
42 data.ViewInverseTransposeMat = Tr2Renderer::GetInverseViewTransform();
43
44 // Hard code diffuse
45 data.sunDiffuseColor.r = 0.0f;
46 data.sunDiffuseColor.g = 0.0f;
47 data.sunDiffuseColor.b = 0.0f;
48 data.sunDiffuseColor.a = 1.0f;
49
50 // Hard code specular
51 data.sunSpecularColor.r = 0.8f;
52 data.sunSpecularColor.g = 0.8f;
53 data.sunSpecularColor.b = 0.8f;
54 data.sunSpecularColor.a = 1.0f;
55
56 // Hard code ambient
57 data.sceneAmbientColor.r = 0.0f;
58 data.sceneAmbientColor.g = 0.0f;
59 data.sceneAmbientColor.b = 0.0f;
60 data.sceneAmbientColor.a = 0.0f;
61
62 data.sunDirWorld.x = 0.0f;
63 data.sunDirWorld.y = 0.0f;
64 data.sunDirWorld.z = 1.0f;
65
66 data.cullDirection = 1.0f;
67 data.shScale = 1.0f;
68}
69
70WodBakingScene::WodBakingScene( IRoot* lockobj /*= NULL */ ) :
71 m_visualizeMethod( VM_NONE )

Callers 15

RenderFullForwardMethod · 0.85
RenderShadowsMethod · 0.85
RenderMethod · 0.85
SetupCascadedShadowsMethod · 0.85
BeginRenderMethod · 0.85
UpdateImpostorsMethod · 0.85
RenderReflectionPassMethod · 0.85
RenderShadowsMethod · 0.85
EndRenderMethod · 0.85
Render3DUIMethod · 0.85

Calls 3

GetViewTransformFunction · 0.85
GetProjectionTransformFunction · 0.85
TransposeFunction · 0.85

Tested by

no test coverage detected