Re: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene

2015-05-29 Thread Robert Osfield
Hi Robert,

On 29 May 2015 at 03:41, Robert Graf muzzlebu...@gmail.com wrote:
 Do you or anyone else here know if the view dependent shadow map in the OSG 
 is based on the method of the following master thesis?

I read a number of different papers, tried different implementations
and came up with an approach that worked well for decent range of
scenes.  The technique also embodies several approaches - it supports
multiple shadow maps and perspective shadow maps.  It essentially
boils down to rendering the scene from the light source direction,
adjusting the frustum to provide better correlation between shadow
texels and final screen space projection of the shadow map - all depth
texture based shadow techniques use this broad approach, the different
boils down to the management of the view frustum of the shadow render
pass.

Robert
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene

2015-05-28 Thread Robert Graf
Thanks for the guidance on this Robert, it is great to know!

Do you or anyone else here know if the view dependent shadow map in the OSG is 
based on the method of the following master thesis? Understanding the 
methodology of the technique will help me better understand the code in order 
to modify it.

http://dcgi.felk.cvut.cz/theses/2010/hinkjan

Thanks a bunch!
-Robert

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63879#63879





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene

2015-05-25 Thread Robert Osfield
Hi Robert,

osgShadow doesn't currently have an ShadowTechniques that support
multiple light sources, the closest to this is the
ViewDependentShadowMap with it's support for multiple shadow maps,
which currently is related to it's support of depth partitioning of
the shadow map, but I've had it in mind that this would be generalized
at a later date to support multiple light sources as well.   This
would require support in the shaders as well as the .cpp.

Have a look at how it's implemented.  You could implement your own
ShadowTechinque using a similar approach, or subclass from
ViewDependentShadowMap.  I wouldn't recommend the approach you are
suggesting though, using multiple ShadowedScene's would just
complicate implementation and usage.

Robert.

On 25 May 2015 at 02:26, Robert Graf muzzlebu...@gmail.com wrote:
 Howdy all,

 What is a way to have a ShadowedScene update just its shadow texture unit in 
 the pre-render for its children, and not have its children rendered during 
 the main viewer pass?

 I'd like to set up multiple lights, each with its own shadow map. Each 
 light/shadowmap combination will be a ShadowedScene. These ShadowedScene's 
 will be pre-rendered, each in their own shadow map texture unit. Then in the 
 main viewer pass, a custom fragment shader will use the different shadow map 
 texture units for shadowing. For the main viewer pass, only the regular scene 
 will be rendered, not any of the shadowed_scene's.

 The scene would look something like this:

 - root
 |--- shadowed_scene1
 | |--- scene
 |--- shadowed_scene2
 | |--- scene
 |--- shadowed_scene3
 | |--- scene
 |--- scene

 Thanks!
 -Robert

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=63804#63804





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene

2015-05-24 Thread Robert Graf
Howdy all,

What is a way to have a ShadowedScene update just its shadow texture unit in 
the pre-render for its children, and not have its children rendered during the 
main viewer pass?

I'd like to set up multiple lights, each with its own shadow map. Each 
light/shadowmap combination will be a ShadowedScene. These ShadowedScene's will 
be pre-rendered, each in their own shadow map texture unit. Then in the main 
viewer pass, a custom fragment shader will use the different shadow map texture 
units for shadowing. For the main viewer pass, only the regular scene will be 
rendered, not any of the shadowed_scene's.

The scene would look something like this:

- root
|--- shadowed_scene1
| |--- scene
|--- shadowed_scene2
| |--- scene
|--- shadowed_scene3
| |--- scene
|--- scene

Thanks!
-Robert

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63804#63804





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene

2015-05-18 Thread Robert Graf
Howdy all,
What are some approaches for using the OSG to render a scene with 6 
shadow-casting spot lights using the ShadowMap technique?

A couple of ideas that came to mind:

1) Use multiple ShadowedScene's with each one having a ShadowMap technique that 
sets a unique shadow texture unit for each shadow map. ShadowMap has a function 
setTextureUnit() for doing this. Could these shadowed scenes be rendered in a 
pre-pass, such as under a slave camera or RenderBins, and have the resulting 
shadow texture units be available for a main-pass fragment shader?

2) Make a local clone of ShadowMap, and modify it to support 6 lights with a 
dedicated shadow texture unit for each light. A fragment shader would be added 
using the ShadowMap.addShader() method, that does per-pixel lighting and does 
look-ups into all 6 shadow texture units.

3) Make a local clown of ShadowedScene, and modify it so that _shadowSettings 
and _shadowTechnique are dynamic arrays, effectively allowing multiple 
ShadowSettings/ShadowTechnique pairs to be inserted. Each inserted ShadowMap 
technique would be assigned a unique texture unit number. This has a number of 
questionable architecture issues.

Something similar to #1 above would be ideal, without modifying OSG much, but 
may not be possible. #2 seems like it should work, but would require some 
development. #3 sounds like it would be over-complicated or unfitting for the 
OSG framework.

Any thoughts or opinions?

Thanks guys!
-Robert Graf

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63762#63762





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene

2010-09-28 Thread Werner Modenbach
Let's take an example:

ShadowTechnique SHADOWMAP

It creates a texture and installs a shader program which makes shadow effects 
by using the created texture.
So what you think happens by the second shadowScene?
On traversal it will create a new texture, by default install it in the same 
texture unit, and install a shader using just this newly created shadow 
texture.
What you expect is a shader program using 2 shadow textures. But this one you 
have to write yourself.

- Werner -


On Tuesday 28 September 2010 06:29:50 Saravanan Sivaprahasam wrote:
 Thanks for the reply.
 
 But could any one explain me why it is not possible to add two
 osgShadow::ShadowedScene  to the root node
 
 
 Thank you!
 
 Cheers,
 Saravanan
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=32115#32115
 
 
 
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
TEXION Software Solutions

TEXION GmbH -  Rotter Bruch 26a  -  D 52068 Aachen - HRB 14999 Aachen
Fon: +49 241 475757-0, Fax: +49 241 475757-29, web: http://www.texion.eu

Geschäftsführer/Managing Director: Werner Modenbach
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Shadows : Creating multiple osgShadow::ShadowedScene

2010-09-27 Thread Saravanan Sivaprahasam
Hi,

   I'm rendering shadows using osgShadow::ShadowMap method. For large outdoor 
scenes with various objects, the rendered shadows look pixelated and self 
shadows on objects are not correct. I've increased the shadow map resolution to 
4096, but still it is not correct. 

  So i have created two shadowed scenes (osgShadow::ShadowedScene ) each having 
a separate light source and shadow map of 4096 resolution. The second 
osgShadow::ShadowedScene that is added (last) as a child to root node is 
getting rendered, while the first shadowed scene added to root is not getting 
rendered. 

Please provide some suggestions to get the shadows rendered correctly 

Thank you!

Cheers,
Saravanan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32093#32093





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene

2010-09-27 Thread Wojciech Lewandowski

Hi Saravanan,

Try other shadowing techniques, Parallel Split Shadow Maps (pssm) or Light 
Space Perspective Shadow Maps (lispsm). They should be better suited for 
your case.


Cheers,
Wojtek Lewandowski


--
From: Saravanan Sivaprahasam saransivapraha...@rediffmail.com
Sent: Monday, September 27, 2010 2:18 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene


Hi,

  I'm rendering shadows using osgShadow::ShadowMap method. For large 
outdoor scenes with various objects, the rendered shadows look pixelated 
and self shadows on objects are not correct. I've increased the shadow map 
resolution to 4096, but still it is not correct.


 So i have created two shadowed scenes (osgShadow::ShadowedScene ) each 
having a separate light source and shadow map of 4096 resolution. The 
second osgShadow::ShadowedScene that is added (last) as a child to root 
node is getting rendered, while the first shadowed scene added to root is 
not getting rendered.


Please provide some suggestions to get the shadows rendered correctly

Thank you!

Cheers,
Saravanan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32093#32093





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene

2010-09-27 Thread Saravanan Sivaprahasam
Thanks for the reply. 

But could any one explain me why it is not possible to add two 
osgShadow::ShadowedScene  to the root node


Thank you!

Cheers,
Saravanan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32115#32115





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org