[Solved] Light wastefully render pass to very far mesh?

Problems building or running the engine, queries about how to use features etc.
Post Reply
hyyou
Gremlin
Posts: 173
Joined: Wed Feb 03, 2016 2:24 am
x 17
Contact:

[Solved] Light wastefully render pass to very far mesh?

Post by hyyou »

I have created :-
  • 1. an object with 1 point lights (marked as an orange circle in image)
    2. a cube mesh
    3. a simple plane as a very-far-away background.
theCull3.png
theCull3.png (10.65 KiB) Viewed 236 times
I noticed that the far plane is also partially "lit" (Forward Rendering as grey in shader).

This implies that Ogre 1.10 doesn't AABB cull for point light, does it? i.e. ...
Meshes that are very far from every lights can still receive some point-light passes.

The waste is more severe in the real scene with more lights and meshes, is this the designed behavior?

My research and guesswork

1.

Code: Select all

setForward3D(...)
may be a solution?
However, I don't find mSceneManager->setForwared3D(...) in c++ editor's context clue. :oops:

2.

Code: Select all

setAttuation( range, ....)
Reduction in range, e.g. to 0.000001f, doesn't reduce batch count. How does that happen!?!

3. This contradicts a post in "Max Range of a Light" http://www.ogre3d.org/forums/viewtopic.php?f=2&t=54959
Reference: weakly related link (just in case) "a lot of lights" http://www.ogre3d.org/forums/viewtopic.php?f=25&t=83983

Solution
The stencil light is the cause.
If I delete this line, Ogre3D will do its best culling.

Code: Select all

mSceneMgr->setShadowTechnique(Ogre::ShadowTechnique::SHADOWTYPE_STENCIL_ADDITIVE);
setForward3D(...) is for Ogre 2.x
Post Reply