Rendering a scene consisting of models with about 1800 Polys, 3 different shadow lights and the terrain render off the examples source.
Using 30 Models I get about
4-5 Frames @ 380'000 Polys when using OpenGL
20-21 Frames @ 385'000 Polys using Direct3D9
And now the wicked thing with lesser polys - 10 Models (astonished about D3D)
10-11 Frames @ 165'000 Polys with OpenGL
11-12 Frames @ 165'000 Polys using D3D9
Finally 3 Models
41-47 Frames @ 42'900 Polys with OGL
41-47 Frames @ 42'900 Polys with OGL
30 Frames @ 42'9000 Polys with D3D9
Last but not least: rendering 30 Models with the standard Scene Manager
23-25 Frames @ 54600 Polys with OGL
123-124 Frames @ 54600 Polys with D3D9
With XEffects active I am using the 8_PCF Filter and 1024x1024 shadow
map at a 1024x768 screen resolution.
Machine specs are:
Intel Core2 @ 2.40GHz
2GByte Ram
ATI Radeon X1950Pro
Windows XP SP3
To note is, that I get trouble with drawing to the RenderTargetTexture with D3D - Texture bigger than ScreenRTT. Perhaps that could boost some frames too, if I wasn't that lazy to fix it. *shrugs*
Furthermore, my animation system lags and kills a good handful of frames too. But I hope you see the difference.
By the way, can someone recommand any precise code profiling tools?
Now to my questions that are buzzing my brains;
For each model that has a shadowNode attached to it, the polycount increases for this model by the approximate factor of ten. I didn't got deep into your code but how can I reduce the polycount for your shadow maps - if even possible?
Also I tried to simulate some day/night change using an orthogonal light. The light is placed relatively far outside the map and it produces strange artifacts when the map is stretched too far and over too many planes blurs the shadows. May this be change by the fov or the near and far value?
I'll post a screen shot, when needed.
Code: Select all
effect->addShadowLight(
SShadowLight(
vector3df(0,0,0), // position
vector3df(5, 0, 5), // target
SColor(255, 120, 120, 230),
50.0f, // nearValue
500.0f, // farValue
90.0f * DEGTORAD, // field of view
true // directional
)
);
matrix4 projMat;
projMat.buildProjectionMatrixOrthoLH(1024,768,10,1000);
effect->getShadowLight(0).setProjectionMatrix(projMat);
// adding a simple fly straight animator for testing purpose
light2->addAnimator(smgr->createFlyStraightAnimator(vector3df(0,280,-300), vector3df(0,280,300), 60*1000, true));
// this is encapsulated in the main loop to set the light's position similar to the examples provided
vMat.makeIdentity();
vMat.buildCameraLookAtMatrixLH(light2->getPosition(), models[0].getPosition(), vector3df(0,1,0));
effect->getShadowLight(2).setViewMatrix(vMat);
Then my very plea to you blindside - appreciating your hard work and great research - why, o why rendering lights in a frustrating frustum?!? Can't you override this and handle shadowing each object in a global space?
It's indeed great for demos or small interior environments. But then imagine a room with a single torch in its middle touching the whole room in its light...
Anyway, keep your creations up! You're doing good dude.