Hi Marcus, As a general note, osgShadow is still in its early days, it is still quite primitive, and will evolve.- and it will evolve by users pushing it and adding to it over time.
The best solution would be to have osgShadow::ShadowMap internally manage multiple RTT Camera's itself, one per light source. This will require mods to the existing ShadowMap code. An alternative would be to write your own ShadowTechnique based on the existing ShadowMap. Note, one awkward area that will be solved by just having one 'ShadowMap' that handles multiple lights is that it'll be able to set up the shaders to do the multiple light sources. Robert. On 6/25/07, Marcus Fritzen <[EMAIL PROTECTED]> wrote:
Hello @ all, I have some more questions about that. First, I understand how to get more than one shadow ;) The Problem is, how to realize it with the osgShadowMap implementation. So I studied the source code of osgShadow. Like Bob said, I need more than one ShadowMap. So I have to create another ShadowMap and set the textureUnit of this new one to another value, e.g. 2. So to get it work I should need also a new shadowed Scene, or? Because if I would use the one I have for my first shadowMap it would have the same lightPosition. Am I right? So I guess I need two ShadowMaps and two ShadowedScenes and then blending them in my program with a fragment shader. Another question is, how do I get the two textures as input for the blending shader out of the two shadowedScenes? I hope these are not such stupid questions ;) Greets, Marcus Bob Kuehne schrieb: > On Jun 19, 2007, at 8:51 AM, Marcus Fritzen wrote: > >> I am trying shadowing my scene with more than one lightsoure. >> Therefore I create just another lightsource and addchild these also >> to my shadowedScene. The result is, that only the last lightsources >> is used. Is it possible to use more than one lightsource at the same >> time? > > hi marcus, > > yes, you can have as many shadows generated as you like, assuming you > have card memory and performance available to generate and render with > these. here's what happens: > > 1) generating each shadow map requires a rendering of the > scene and storage of depth info > > 2) generating the shadowed scene involves using each of these > shadow maps and blending of their results. it's simplest > to do this via a shader. > > so, depending on what code you're using to render the final scene, > you'll need > to adjust both the shadow generators (to bind to alternate texture > units), and > also the shader/blend state (to use these multiple shadow textures.) > > bob > > > _______________________________________________ > osg-users mailing list > [email protected] > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > -- ---------------------------------------------------------------- Marcus Fritzen E-mail: [EMAIL PROTECTED] University Koblenz Mobil: +491786867360 Triererstr. 105, 56072 Koblenz, HIWI FB4 Herr Jackel ---------------------------------------------------------------- _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
