Ogre Version: :1.12.1:
Operating System: :Ubuntu 16.04:
Render System: :OpenGL:
Hi
I have an application in which I render the same scene in multiple windows using different cameras.
An object may be visible in one window but not another. To do this I use the entity Ogre::Entity::setVisibilityFlags() (ie Ogre::MovableObject::setVisibilityFlags()) and use appropriate visibility flags for the camera in use.
I can change the object visibility ok and I see the object disappear and reappear as desired - all ok with the exception of the shadows cast by the object which stay visible even when the object isn't. I can turn off the object shadows using Ogre::Entiry::setCastShadows but that applies it to all windows (cameras).
The scene manager uses SHADOWTYPE_TEXTURE_MODULATIVE shadow technique
Is there some way or strategy for turning on/off casting of shadows on a camera basis for a single object?
Come to think about it, shouldn't the shadow not be rendered automatically if the object is not visible by the current camera? Isn't this possibly a bug?
Thanks
[1.12.1] Casting shadows and Object visibility Topic is solved
-
- Gnoblar
- Posts: 24
- Joined: Wed Jul 17, 2019 10:57 am
- x 1
-
- OGRE Team Member
- Posts: 2141
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1151
Re: [1.12.1] Casting shadows and Object visibility
try Viewport::setShadowsEnabled: https://ogrecave.github.io/ogre/vtests1 ... tNoShadows
altough I need to check the mask handling with shows too
edit:
can you try adding:
here https://github.com/OGRECave/ogre/blob/b ... r.cpp#L873
and see whether it just works without other changes?
altough I need to check the mask handling with shows too
edit:
can you try adding:
Code: Select all
shadowView->setVisibilityMask(vp->getVisibilityMask());
and see whether it just works without other changes?
-
- Gnoblar
- Posts: 24
- Joined: Wed Jul 17, 2019 10:57 am
- x 1
Re: [1.12.1] Casting shadows and Object visibility
Great! That worked perfectly!
Many thanks paroj
Many thanks paroj
paroj wrote: ↑Sat Mar 28, 2020 4:59 pm can you try adding:here https://github.com/OGRECave/ogre/blob/b ... r.cpp#L873Code: Select all
shadowView->setVisibilityMask(vp->getVisibilityMask());
and see whether it just works without other changes?