@@ -265,34 +265,16 @@ void GameApp::drawRenderItems(GraphicsContext& gfxContext, std::vector<RenderIte
265265 }
266266}
267267
268- void GameApp::setLightContantsBuff (GraphicsContext& gfxContext, bool inMirror /* = false */ )
268+ void GameApp::setLightContantsBuff (GraphicsContext& gfxContext)
269269{
270- if (!inMirror)
271- {
272- // 设置通用的常量缓冲区
273- PassConstants psc;
274- psc.viewProj = Transpose (m_ViewProjMatrix);
275- psc.eyePosW = m_Camera.GetPosition ();
276- psc.ambientLight = { 0 .25f , 0 .25f , 0 .35f , 1 .0f };
277- psc.Lights [0 ].Direction = { 0 .0f , -1 .0f , 0 .0f };
278- psc.Lights [0 ].Strength = { 1 .0f , 1 .0f , 0 .9f };
279- gfxContext.SetDynamicConstantBufferView (1 , sizeof (psc), &psc);
280- }
281- else
282- {
283- // 设置镜子中的光照,偷个懒,直接设置了
284- PassConstants psc;
285- psc.viewProj = Transpose (m_ViewProjMatrix);
286- psc.eyePosW = m_Camera.GetPosition ();
287- psc.ambientLight = { 0 .25f , 0 .25f , 0 .35f , 1 .0f };
288- psc.Lights [0 ].Direction = { 0 .57735f , -0 .57735f , -0 .57735f };
289- psc.Lights [0 ].Strength = { 0 .6f , 0 .6f , 0 .6f };
290- psc.Lights [1 ].Direction = { -0 .57735f , -0 .57735f , -0 .57735f };
291- psc.Lights [1 ].Strength = { 0 .3f , 0 .3f , 0 .3f };
292- psc.Lights [2 ].Direction = { 0 .0f , -0 .707f , 0 .707f };
293- psc.Lights [2 ].Strength = { 0 .15f , 0 .15f , 0 .15f };
294- gfxContext.SetDynamicConstantBufferView (1 , sizeof (psc), &psc);
295- }
270+ // 设置通用的常量缓冲区
271+ PassConstants psc;
272+ psc.viewProj = Transpose (m_ViewProjMatrix);
273+ psc.eyePosW = m_Camera.GetPosition ();
274+ psc.ambientLight = { 0 .25f , 0 .25f , 0 .35f , 1 .0f };
275+ psc.Lights [0 ].Direction = { 0 .0f , -1 .0f , -1 .0f };
276+ psc.Lights [0 ].Strength = { 1 .0f , 1 .0f , 0 .9f };
277+ gfxContext.SetDynamicConstantBufferView (1 , sizeof (psc), &psc);
296278}
297279
298280void GameApp::buildLandGeo ()
0 commit comments