- Timestamp:
- 09/02/08 09:07:45 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp
r2888 r2894 637 637 void Bvh::RecomputeBounds() 638 638 { 639 // clear old list640 mTestNodes.clear();641 642 639 // collect all nodes 643 640 BvhNodeContainer nodes; … … 662 659 663 660 // recreate indices used for indirect mode rendering 664 if (mIndices) 665 CreateIndices(); 661 if (mIndices) CreateIndices(); 666 662 } 667 663 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.h
r2825 r2894 65 65 */ 66 66 virtual ~BvhNode(); 67 /** Returns unique id for this node.68 */69 //inline int GetId() {return mId;}70 67 /** Depth of this node in the tree. 71 68 */ … … 167 164 168 165 ///////// 169 // used for view frustum culling166 //-- used for view frustum culling 170 167 171 168 int mPlaneMask; … … 619 616 620 617 //////////////////////// 621 618 619 /// the bounding box of the bvh 620 AxisAlignedBox3 mBox; 622 621 /// the root of the hierarchy 623 622 BvhNode *mRoot; … … 627 626 size_t mGeometrySize; 628 627 629 630 ////////////////631 632 628 /// the current camera 633 629 Camera *mCamera; 630 631 632 //////////////// 633 //-- tigher bounds termination criteria 634 635 /** maximal depth from which children are fetched for 636 testing instead of the current node 637 */ 638 int mMaxDepthForTestingChildren; 639 /// threshold for computing tighter bounds 640 float mAreaRatioThreshold; 641 642 643 //////////////// 644 //-- statistics 645 646 BvhStats mBvhStats; 647 /// the overall number of nodes 648 int mNumNodes; 649 /// the number of "virtual" (=actually used) nodes 650 int mNumVirtualNodes; 651 652 653 //////////// 654 //-- rendering stuff 655 656 /// these proxy nodes are tested instead of the current node 657 BvhNodeContainer mTestNodes; 658 /// the indices used for vbo index buffering 659 unsigned int *mTestIndices; 660 /// a pointer to the end of the indices array 661 int mCurrentIndicesPtr; 662 /// the vbo id 663 unsigned int mVboId; 634 664 /// a vertex array used if working with indexed arrays (without vbo) 635 665 Vector3 *mVertices; 636 666 /// indices used for draw array rendering 637 667 unsigned int *mIndices; 638 639 /** maximal depth from which children are fetched for640 testing instead of the current node641 */642 int mMaxDepthForTestingChildren;643 644 float mAreaRatioThreshold;645 646 647 BvhStats mBvhStats;648 649 BvhNodeContainer mTestNodes;650 651 unsigned int *mTestIndices;652 /// a pointer to the end of the indices array653 int mCurrentIndicesPtr;654 655 int mNumNodes;656 657 /// the bounding box658 AxisAlignedBox3 mBox;659 660 int mNumVirtualNodes;661 662 //////////////663 664 unsigned int mVboId;665 668 }; 666 669 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredShader.cpp
r2893 r2894 176 176 177 177 void DeferredShader::Render(FrameBufferObject *fbo, 178 const Matrix4x4 &matViewing, 179 ShadowMapping *shadowMapping) 178 ShadowMap *shadowMap) 180 179 { 181 180 cgGLEnableProfile(RenderState::sCgFragmentProfile); … … 201 200 glOrtho(-offs, offs, -offs, offs, 0, 1); 202 201 203 FirstPassShadow(fbo, matViewing, shadowMapping);202 FirstPassShadow(fbo, shadowMap); 204 203 AntiAliasing(fbo); 205 204 … … 328 327 329 328 void DeferredShader::FirstPassShadow(FrameBufferObject *fbo, 330 const Matrix4x4 &matViewing, 331 ShadowMapping *shadowMapping) 329 ShadowMap *shadowMap) 332 330 { 333 331 GLuint colorsTex = fbo->GetColorBuffer(0)->GetTexture(); 334 332 GLuint positionsTex = fbo->GetColorBuffer(1)->GetTexture(); 335 333 GLuint normalsTex = fbo->GetColorBuffer(2)->GetTexture(); 336 GLuint shadowMap = shadowMapping->mFbo->GetDepthTex(); 337 /* 338 static Matrix4x4 biasMatrix(0.5f, 0.0f, 0.0f, 0.0f, 339 0.0f, 0.5f, 0.0f, 0.0f, 340 0.0f, 0.0f, 0.5f, 0.0f, 341 0.5f, 0.5f, 0.5f, 1.0f); //bias from [-1, 1] to [0, 1] 342 */ 343 344 static Matrix4x4 biasMatrix(0.5f, 0.0f, 0.0f, 0.5f, 345 0.0f, 0.5f, 0.0f, 0.5f, 346 0.0f, 0.0f, 0.5f, 0.5f, 347 0.0f, 0.0f, 0.0f, 1.0f); //bias from [-1, 1] to [0, 1] 348 349 Matrix4x4 inverseView = matViewing; 350 inverseView.Invert(); 351 352 Matrix4x4 lightProjView = shadowMapping->mLightViewMatrix * shadowMapping->mLightProjectionMatrix; 353 354 //cout << "matview:\n" << matViewing << endl; 355 //cout << "proj:\n" << shadowMapping->mLightProjectionMatrix << endl; 356 cout << "view:\n" << shadowMapping->mLightViewMatrix << endl; 357 358 // compute combined matrix that transforms pixels into light texture space 359 /*Matrix4x4 shadowMatrix = biasMatrix * 360 shadowMapping->mLightProjectionMatrix * 361 shadowMapping->mLightViewMatrix * 362 inverseView; 363 */ 364 //Matrix4x4 shadowMatrix = //inverseView * lightProjView * biasMatrix;* 365 Matrix4x4 shadowMatrix = lightProjView*biasMatrix; 366 //inverseView; 367 cout << "combined:\n" << shadowMatrix << endl; 334 GLuint shadowTex = shadowMap->GetShadowTexture(); 335 336 Matrix4x4 shadowMatrix; 337 shadowMap->GetTextureMatrix(shadowMatrix); 368 338 369 339 fbo->Bind(); … … 386 356 cgGLEnableTextureParameter(sNormalsTexShadowParam); 387 357 388 cgGLSetTextureParameter(sShadowMapParam, shadow Map);358 cgGLSetTextureParameter(sShadowMapParam, shadowTex); 389 359 cgGLEnableTextureParameter(sShadowMapParam); 390 360 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredShader.h
r2893 r2894 12 12 13 13 class FrameBufferObject; 14 class ShadowMap ping;14 class ShadowMap; 15 15 class Matrix4x4; 16 16 … … 37 37 static void Init(CGcontext context); 38 38 39 void Render(FrameBufferObject *fbo, ShadowMap *shadowMap); 39 40 40 void Render(FrameBufferObject *fbo,41 const Matrix4x4 &matViewing,42 ShadowMapping *shadowMapping);43 41 44 42 protected: 45 43 46 44 void FirstPass(FrameBufferObject *fbo); 47 void FirstPassShadow(FrameBufferObject *fbo, 48 const Matrix4x4 &matViewing, 49 ShadowMapping *shadowMapping); 45 46 void FirstPassShadow(FrameBufferObject *fbo, ShadowMap *shadowMap); 50 47 51 48 void AntiAliasing(FrameBufferObject *fbo); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp
r2893 r2894 79 79 80 80 81 ShadowMap ping::ShadowMapping(const AxisAlignedBox3 &sceneBox, int size):82 mSceneBox(sceneBox), mSize(size) 81 ShadowMap::ShadowMap(int size, const AxisAlignedBox3 &sceneBox, Camera *cam): 82 mSceneBox(sceneBox), mSize(size), mCamera(cam) 83 83 { 84 84 mFbo = new FrameBufferObject(size, size, FrameBufferObject::DEPTH_32, true); … … 91 91 92 92 93 ShadowMapping::~ShadowMapping() 94 { 95 //if (sCgShadowProgram) cgDestroyProgram(sCgShadowProgram); 93 ShadowMap::~ShadowMap() 94 { 96 95 DEL_PTR(mFbo); 97 96 } 98 97 99 98 100 void ShadowMapping::Init(CGcontext context) 101 {/* 102 sCgShadowProgram = 103 cgCreateProgramFromFile(context, 104 CG_SOURCE, 105 "src/shaders/shadow.cg", 106 RenderState::sCgFragmentProfile, 107 "main", 108 NULL); 109 110 if (sCgShadowProgram != NULL) 111 { 112 cgGLLoadProgram(sCgShadowProgram); 113 sShadowParam = cgGetNamedParameter(sCgShadowProgram, "shadowMap"); 114 } 115 else 116 cerr << "shadow program failed to load" << endl; 117 */ 118 PrintGLerror("init"); 119 } 120 121 122 void ShadowMapping::ComputeShadowMap(Light *light, RenderTraverser *traverser) 99 100 void ShadowMap::ComputeShadowMap(Light *light, RenderTraverser *traverser) 123 101 { 124 102 mLight = light; … … 133 111 134 112 pos -= light->GetDirection() * Magnitude(mSceneBox.Diagonal() * 0.5f); 135 //pos.z = mSceneBox.Max().z;136 //mShadowCam->SetPosition(pos - Magnitude(mSceneBox.Diagonal() * light->GetDirection()));137 113 mShadowCam->SetPosition(pos); 138 114 … … 160 136 glLoadIdentity(); 161 137 138 // setup projection 162 139 glOrtho(+xlen, -xlen, +ylen, -ylen, 0.0f, Magnitude(mSceneBox.Diagonal())); 163 140 … … 168 145 glLoadIdentity(); 169 146 170 147 // setup shadow camera 171 148 mShadowCam->SetupCameraView(); 172 mShadowCam->GetModelViewMatrix(mLightViewMatrix); 173 174 mShadowCam->GetProjectionMatrix(mLightProjectionMatrix); 175 //glGetFloatv(GL_MODELVIEW_MATRIX, (float *)mLightProjectionMatrix.x); 149 150 ////////////// 151 //-- compute texture matrix 152 153 Matrix4x4 lightView, lightProj; 154 155 mShadowCam->GetModelViewMatrix(lightView); 156 mShadowCam->GetProjectionMatrix(lightProj); 157 158 static Matrix4x4 biasMatrix(0.5f, 0.0f, 0.0f, 0.5f, 159 0.0f, 0.5f, 0.0f, 0.5f, 160 0.0f, 0.0f, 0.5f, 0.5f, 161 0.0f, 0.0f, 0.0f, 1.0f); //bias from [-1, 1] to [0, 1] 162 163 Matrix4x4 lightProjView = lightView * lightProj; 164 mTextureMatrix = lightProjView * biasMatrix; 165 166 167 ///////////// 168 //-- render scene into shadow map 176 169 177 170 traverser->RenderScene(); … … 192 185 193 186 delete [] data; 194 */187 */ 195 188 PrintGLerror("shadow map"); 196 189 … … 198 191 } 199 192 200 /* 201 void ShadowMapping::Render(RenderTraverser *traverser, Camera *cam) 202 { 203 Matrix4x4 cam_proj; 204 Matrix4x4 cam_inverse_modelview; 205 206 const float bias[16] = 207 {0.5f, 0.0f, 0.0f, 0.0f, 208 0.0f, 0.5f, 0.0f, 0.0f, 209 0.0f, 0.0f, 0.5f, 0.0f, 210 0.5f, 0.5f, 0.5f, 1.0f }; 211 212 213 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 214 215 // update the camera, so that the user can have a free look 216 glMatrixMode(GL_MODELVIEW); 217 glLoadIdentity(); 218 219 glMatrixMode(GL_PROJECTION); 220 glLoadIdentity(); 221 222 cam->SetupCameraView(); 223 224 // store the inverse of the resulting modelview matrix for the shadow computation 225 glGetFloatv(GL_MODELVIEW_MATRIX, (float *)cam_inverse_modelview.x); 226 cam_inverse_modelview.Invert(); 227 228 // bind shadow map 229 glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, mFbo->GetDepthTex()); 230 231 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); 232 //glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_COMPARE_MODE, GL_NONE); 233 234 PrintGLerror("texture"); 235 236 //float light_m[16]; 237 238 // compute a matrix that transforms from camera eye space to light clip space 239 // and pass it to the shader through the OpenGL texture matrices, since we 240 // don't use them now 241 glEnable(GL_TEXTURE_2D); 242 glMatrixMode(GL_TEXTURE); 243 244 glLoadMatrixf(bias); 245 glMultMatrixf((float *)mShadowMatrix.x); 246 247 // multiply the light's (bias * crop * proj * modelview) by the inverse camera modelview 248 // so that we can transform a pixel as seen from the camera 249 glMultMatrixf((float *)cam_inverse_modelview.x); 250 251 252 cgGLEnableProfile(RenderState::sCgFragmentProfile); 253 cgGLBindProgram(sCgShadowProgram); 254 255 cgGLSetTextureParameter(sShadowParam, mFbo->GetDepthTex()); 256 cgGLEnableTextureParameter(sShadowParam); 257 258 // finally, draw the scene 259 traverser->RenderScene(); 260 261 cgGLDisableTextureParameter(sShadowParam); 262 263 PrintGLerror("shadow"); 264 } 265 */ 266 267 268 //Called to draw scene 269 void ShadowMapping::Render(RenderTraverser *traverser, Camera *cam) 270 { 271 #if 0 272 Matrix4x4 cam_inverse_modelview; 273 274 //Calculate texture matrix for projection 275 //This matrix takes us from eye space to the light's clip space 276 //It is postmultiplied by the inverse of the current view matrix when specifying texgen 277 static Matrix4x4 biasMatrix(0.5f, 0.0f, 0.0f, 0.0f, 278 0.0f, 0.5f, 0.0f, 0.0f, 279 0.0f, 0.0f, 0.5f, 0.0f, 280 0.5f, 0.5f, 0.5f, 1.0f); //bias from [-1, 1] to [0, 1] 281 282 /*glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 283 284 // update the camera, so that the user can have a free look 285 glMatrixMode(GL_MODELVIEW); 286 glLoadIdentity(); 287 288 glMatrixMode(GL_PROJECTION); 289 glLoadIdentity(); 290 291 cam->SetupCameraView(); 292 */ 293 // store the inverse of the resulting modelview matrix for the shadow computation 294 glGetFloatv(GL_MODELVIEW_MATRIX, (float *)cam_inverse_modelview.x); 295 cam_inverse_modelview.Invert(); 296 297 // bind shadow map 298 glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, mFbo->GetDepthTex()); 299 300 // compute a matrix that transforms from camera eye space to light clip space 301 // and pass it to the shader through the OpenGL texture matrices, since we 302 // don't use them now 303 glEnable(GL_TEXTURE_2D); 304 glMatrixMode(GL_TEXTURE); 305 306 glLoadMatrixf((float *)biasMatrix.x); 307 glMultMatrixf((float *)mLightViewMatrix.x); 308 309 // multiply the light's (bias * crop * proj * modelview) by the inverse camera modelview 310 // so that we can transform a pixel as seen from the camera 311 glMultMatrixf((float *)cam_inverse_modelview.x); 312 313 RgbaColor white(1, 1, 1, 0); 314 RgbaColor dark(0.2, 0.2, 0.2, 0); 315 316 glDisable(GL_LIGHTING); 317 318 /*glDisable(GL_LIGHT0); 319 glDisable(GL_LIGHT1); 320 321 //Use dim light to represent shadowed areas 322 glLightfv(GL_LIGHT1, GL_POSITION, mLight->GetDirection()); 323 glLightfv(GL_LIGHT1, GL_AMBIENT, (float *)&dark.r); 324 glLightfv(GL_LIGHT1, GL_DIFFUSE, (float *)&white.r); 325 //glLightfv(GL_LIGHT1, GL_SPECULAR, black); 326 glEnable(GL_LIGHT1); 327 glEnable(GL_LIGHTING);*/ 328 329 PrintGLerror("firstpass"); 330 331 // finally, draw the scene 332 traverser->RenderScene(); 333 334 335 glEnable(GL_LIGHTING); 336 337 338 //3rd pass 339 //Draw with bright light 340 //glLightfv(GL_LIGHT1, GL_DIFFUSE, (float *)&white.r); 341 //glLightfv(GL_LIGHT1, GL_SPECULAR, (float *)&white.r); 342 343 Matrix4x4 textureMatrix = biasMatrix * mLightProjectionMatrix * mLightViewMatrix; 344 345 Matrix4x4 texMatT = Transpose(textureMatrix); 346 347 //Set up texture coordinate generation. 348 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); 349 glTexGenfv(GL_S, GL_EYE_PLANE, texMatT.x[0]); 350 glEnable(GL_TEXTURE_GEN_S); 351 352 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); 353 glTexGenfv(GL_T, GL_EYE_PLANE, texMatT.x[1]); 354 glEnable(GL_TEXTURE_GEN_T); 355 356 glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); 357 glTexGenfv(GL_R, GL_EYE_PLANE, texMatT.x[2]); 358 glEnable(GL_TEXTURE_GEN_R); 359 360 glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); 361 glTexGenfv(GL_Q, GL_EYE_PLANE, texMatT.x[3]); 362 glEnable(GL_TEXTURE_GEN_Q); 363 364 //Bind & enable shadow map texture 365 glBindTexture(GL_TEXTURE_2D, mFbo->GetDepthTex()); 366 glEnable(GL_TEXTURE_2D); 367 368 //Enable shadow comparison 369 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE); 370 371 //Shadow comparison should be true (ie not in shadow) if r<=texture 372 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL); 373 374 //Shadow comparison should generate an INTENSITY result 375 glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY); 376 377 //Set alpha test to discard false comparisons 378 glAlphaFunc(GL_GEQUAL, 0.99f); 379 glEnable(GL_ALPHA_TEST); 380 381 PrintGLerror("texture"); 382 383 traverser->RenderScene(); 384 385 //Disable textures and texgen 386 glDisable(GL_TEXTURE_2D); 387 388 glDisable(GL_TEXTURE_GEN_S); 389 glDisable(GL_TEXTURE_GEN_T); 390 glDisable(GL_TEXTURE_GEN_R); 391 glDisable(GL_TEXTURE_GEN_Q); 392 393 //Restore other states 394 glDisable(GL_LIGHTING); 395 glDisable(GL_ALPHA_TEST); 396 #endif 193 194 void ShadowMap::GetTextureMatrix(Matrix4x4 &m) const 195 { 196 m = mTextureMatrix; 197 } 198 199 200 unsigned int ShadowMap::GetShadowTexture() const 201 { 202 return mFbo->GetDepthTex(); 397 203 } 398 204 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.h
r2892 r2894 1 #ifndef _ShadowMap ping_H__2 #define _ShadowMap ping_H__1 #ifndef _ShadowMap_H__ 2 #define _ShadowMap_H__ 3 3 4 4 #include "common.h" … … 20 20 class Light; 21 21 22 /** This class implements a shadow mapping algorithm22 /** This class implements a the computation of single shadow map 23 23 */ 24 class ShadowMap ping24 class ShadowMap 25 25 { 26 26 27 public: 27 /** constructor for a deferred shader taking the requested shadow size 28 /** Constructor taking the scene boundig box and the current camera. 29 The shadow map has resolution size * size. 28 30 */ 29 ShadowMap ping(const AxisAlignedBox3 &sceneBox, int size);31 ShadowMap(int size, const AxisAlignedBox3 &sceneBox, Camera *cam); 30 32 31 ~ShadowMap ping();32 /** Renders the shadowed scene33 ~ShadowMap(); 34 /** Computes the shadow map 33 35 */ 34 void Render(RenderTraverser *traverser, Camera *cam); 35 /** Initialises shadow mapping and loads the required shaders: 36 This function has to be called only once. 36 void ComputeShadowMap(Light *light, RenderTraverser *traverser); 37 /** Returns computed shadow texture. 37 38 */ 38 static void Init(CGcontext context); 39 unsigned int GetShadowTexture() const; 40 /** Returns computed texture matrix. It must be applied on the 41 the world space positions. 42 43 The texture matrix can be directly applied if the world space position 44 is available (deferred shading), otherwise it must be multiplied with 45 the inverse model matrix. 46 */ 47 void GetTextureMatrix(Matrix4x4 &m) const; 39 48 40 //protected:41 49 42 void ComputeShadowMap(Light *light, RenderTraverser *traverser); 50 protected: 43 51 44 //protected: 45 52 /// the scene bounding box 53 AxisAlignedBox3 mSceneBox; 54 /// fbo storing the shadow texture 46 55 FrameBufferObject *mFbo; 47 56 /// size of the shadow map 48 57 int mSize; 49 58 50 AxisAlignedBox3 mSceneBox;51 52 59 Camera *mShadowCam; 53 54 Matrix4x4 mLightViewMatrix; 55 Matrix4x4 mLightProjectionMatrix; 56 60 /// the texture matrix 61 Matrix4x4 mTextureMatrix; 62 /// the used light 57 63 Light *mLight; 64 /// the scene camera 65 Camera *mCamera; 58 66 }; 59 67 60 68 } // namespace 61 #endif // _ DeferredShader_H__69 #endif // _ShadowMapping_H__ -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp
r2893 r2894 533 533 cgGLSetParameter1f(sExpFactorParam, expFactor); 534 534 535 536 535 // q: should we generate new samples or only rotate the old ones? 537 536 // in the first case, the sample patterns look nicer, but the kernel -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2893 r2894 175 175 176 176 static Matrix4x4 matProjectionView = IdentityMatrix(); 177 static Matrix4x4 matViewing = IdentityMatrix(); 178 179 ShadowMap ping *shadowMapping= NULL;177 178 179 ShadowMap *shadowMap = NULL; 180 180 Light *light = NULL; 181 181 … … 433 433 DeferredShader::Init(sCgContext); 434 434 SsaoShader::Init(sCgContext); 435 ShadowMapping::Init(sCgContext);436 435 437 436 … … 446 445 light = new Light(lightDir, RgbaColor(1, 1, 1, 1)); 447 446 448 shadowMapping = new ShadowMapping(bvh->GetBox(), 4096); 447 const float shadowSize = 4096; 448 shadowMap = new ShadowMap(shadowSize, bvh->GetBox(), camera); 449 449 450 450 // frame time is restarted every frame … … 796 796 ///////////////// 797 797 798 Matrix4x4 mat Projection;798 Matrix4x4 matViewing, matProjection; 799 799 800 800 camera->GetModelViewMatrix(matViewing); … … 904 904 case RenderState::DEFERRED: 905 905 906 shadowMap ping->ComputeShadowMap(light, traverser);906 shadowMap->ComputeShadowMap(light, traverser); 907 907 908 908 if (!fbo) InitFBO(); … … 975 975 //-- render sky 976 976 977 // q: should we render sky after deferred shading? (would conveniently solves some issues)978 // (e.g, skys without shadows)977 // q: should we render sky after deferred shading? 978 // this would conveniently solves some issues (e.g, skys without shadows) 979 979 980 980 RenderSky(); … … 999 999 if (!deferredShader) deferredShader = new DeferredShader(texWidth, texHeight, myfar / 10.0f); 1000 1000 1001 //deferredShader->Render(fbo); 1002 deferredShader->Render(fbo, matViewing, shadowMapping); 1001 deferredShader->Render(fbo, shadowMap); 1003 1002 } 1004 1003 }
Note: See TracChangeset
for help on using the changeset viewer.