- Timestamp:
- 09/02/08 00:56:48 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp
r2892 r2893 124 124 mLight = light; 125 125 126 const float xlen = Magnitude(mSceneBox.Diagonal() );//* 0.5f);127 const float ylen = Magnitude(mSceneBox.Diagonal() );//* 0.5f);126 const float xlen = Magnitude(mSceneBox.Diagonal() * 0.5f); 127 const float ylen = Magnitude(mSceneBox.Diagonal() * 0.5f); 128 128 129 129 mShadowCam->SetDirection(light->GetDirection()); … … 131 131 // set position so that we can see the whole scene 132 132 Vector3 pos = mSceneBox.Center(); 133 pos.z = mSceneBox.Max().z; 133 134 pos -= light->GetDirection() * Magnitude(mSceneBox.Diagonal() * 0.5f); 135 //pos.z = mSceneBox.Max().z; 134 136 //mShadowCam->SetPosition(pos - Magnitude(mSceneBox.Diagonal() * light->GetDirection())); 135 137 mShadowCam->SetPosition(pos); … … 148 150 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 149 151 150 glPolygonOffset(1.0f, 40.0f);152 glPolygonOffset(1.0f, 2000.0f); 151 153 glEnable(GL_POLYGON_OFFSET_FILL); 152 154 … … 158 160 glLoadIdentity(); 159 161 160 glOrtho(+xlen, -xlen, +ylen, -ylen, 0.0f, 100);//Magnitude(mSceneBox.Diagonal()));162 glOrtho(+xlen, -xlen, +ylen, -ylen, 0.0f, Magnitude(mSceneBox.Diagonal())); 161 163 162 164 … … 267 269 void ShadowMapping::Render(RenderTraverser *traverser, Camera *cam) 268 270 { 271 #if 0 269 272 Matrix4x4 cam_inverse_modelview; 270 273 … … 391 394 glDisable(GL_LIGHTING); 392 395 glDisable(GL_ALPHA_TEST); 396 #endif 393 397 } 394 398
Note: See TracChangeset
for help on using the changeset viewer.