Re: [osg-users] osgShadows

2009-12-09 Thread Adrian Egli OpenSceneGraph (3D)
Hi all , hi nick

i wrote the PSSM shadow. There is some problem in the implementation, may
you can solve the problem in the OSG core, i didn't have enough time, nor
the idea how we can remove the problem.
but try with osgshadow --pssm --SingleThreaded --debug-color your_model.osg
, it works only good with single threaded osg :-( this is the biggest
problem

if you use with shader, reimplement the GLSL shader for pssm. see
at the header:
/**
 * you can overwrite the fragment shader if you like to modify it
yourself, own fragment shader can be used
 */
class OSGSHADOW_EXPORT FragmentShaderGenerator : public
osg::Referenced {
public:
/**
 * generate the GLSL fragement shader
 */
virtual std::string generateGLSL_FragmentShader_BaseTex(bool
debug, unsigned int splitCount,double textureRes, bool filtered, unsigned
int nbrSplits,unsigned int textureOffset);
};

replace the shader with this class. but all together within this code. have
a look into the implementation. for further idea, please contact me at
adrian.egli (*...@***) gmail.com

/adrian


2009/12/9 Trajce Nikolov 

> I tried both.
>
> PSSM gives some artifacts (see the attached image) - the white in the
> background, also, some flickering of the shadow on the models.
>
> Nick
>
> http://www.linkedin.com/in/tnikolov
> Sent from Gümüşsuyu, İstanbul, Turkey
>
> On Wed, Dec 9, 2009 at 12:27 PM, Wojciech Lewandowski <
> lewandow...@ai.com.pl> wrote:
>
>>  Hi,
>>
>> Cascaded Shadow Maps is the same as Parallel Split Shadow Map. PSSM is
>> implemented in osgShadow. Also LispSM could work for you scenario.
>>
>> Cheers,
>> Wojtek Lewandowski
>>
>>
>>
>>
>>
>>  *From:* Trajce Nikolov 
>> *Sent:* Wednesday, December 09, 2009 10:19 AM
>> *To:* OpenSceneGraph Users 
>> *Subject:* Re: [osg-users] osgShadows
>>
>> Hi Harold,
>>
>> yes, my light source is the "sun". No other lights in the scene yet. And
>> the results are not good. I will do research on the "cascade shadowmaps" and
>> will try to implement it. Thanks for the hint
>>
>> Nick
>>
>> http://www.linkedin.com/in/tnikolov
>> Sent from Gümüşsuyu, İstanbul, Turkey
>>
>> On Wed, Dec 9, 2009 at 11:13 AM, Harold Comere 
>> wrote:
>>
>>> Hi Nike,
>>>>
>>>
>>> There is many way to get shadows and the shadowing technique choice shall
>>> depend of your scene data.
>>>
>>> The two basic shadowing techniques are :
>>> - shadow maps ( image based )
>>> - shadow volumes ( geometry based )
>>>
>>> Shadow maps are very cheap and easy to implement but will works good only
>>> if your light is not far from what you are shadowing due to the image
>>> approach. So if you have a large terrain with an unique directional light (
>>> as sun ), simple shadowmaps should do an ugly result.
>>> You could try "cascade shadowmaps" which is a technique used a lot in
>>> video games. It uses a kind of shadowmap LOD to avoid image based algorithms
>>> issues and stay cheap.
>>>
>>> Shadow volumes generate very accurate shadows but as it is based on
>>> geometry, if your scene geometry is complex you will experience some perf
>>> issues.
>>>
>>> Again, the shadowing technique choice depends of how many lights you
>>> have, where they are, what you are shadowing etc.
>>> Give a bit more details of your goal and i'm sure some osg pro will bring
>>> to you the ideal solution using osg :)
>>>
>>> Regards,
>>> Harold
>>>
>>> ___
>>> 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
>>
>>
>> ___
>> 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
>
>


-- 

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


Re: [osg-users] osgShadows

2009-12-09 Thread Wojciech Lewandowski
Hi Nick,

I don't know much about PSSM.  I am na author of LispSM implementation. 
However, many osgShadow techniques use shaders and they will not work out of 
the box for all the applications that also use shaders.  In this case one have 
to 1) subsitute shadow shaders to add aplication shader functionality or 2) 
override shadow shaders at the scene root with application shaders that were 
modified to include shadow term computation (using the uniforms theat shadow 
technique sets).  Check forums there was a lot on the subject recently.

Both cases are advanced topics, so one trying to do this usually must have good 
knowledge of C++ (to read and understand the Technique code), GLSL (to modify 
shaders), shadow map algorithm (to know whats important is shaders, NVidia has 
nice presentations). Its steep path but implementing CSM technique in OSG for 
multithreaded/multimonitor from scratch will be much much steeper.

Wojtek





From: Trajce Nikolov 
Sent: Wednesday, December 09, 2009 12:11 PM
To: OpenSceneGraph Users 
Subject: Re: [osg-users] osgShadows


I tried both. 


PSSM gives some artifacts (see the attached image) - the white in the 
background, also, some flickering of the shadow on the models.

Nick

http://www.linkedin.com/in/tnikolov
Sent from G�m��suyu, �stanbul, Turkey 


On Wed, Dec 9, 2009 at 12:27 PM, Wojciech Lewandowski  
wrote:

  Hi,
  �
  Cascaded Shadow Maps is�the same as Parallel Split Shadow Map. PSSM is 
implemented in osgShadow. Also LispSM�could�work for you scenario. 
  �
  Cheers,
  Wojtek Lewandowski
  �
  �
  �
  �


  From: Trajce Nikolov 
  Sent: Wednesday, December 09, 2009 10:19 AM
  To: OpenSceneGraph Users 
  Subject: Re: [osg-users] osgShadows


  Hi Harold, 


  yes, my light source is the "sun". No other lights in the scene yet. And the 
results are not good. I will do research on the "cascade shadowmaps" and will 
try to implement it. Thanks for the hint

  Nick

  http://www.linkedin.com/in/tnikolov
  Sent from G�m��suyu, �stanbul, Turkey 


  On Wed, Dec 9, 2009 at 11:13 AM, Harold Comere  
wrote:

  Hi Nike,


There is many way to get shadows and the shadowing technique choice shall 
depend of your scene data.

The two basic shadowing techniques are :
- shadow maps ( image based )
- shadow volumes ( geometry based )

Shadow maps are very cheap and easy to implement but will works good only 
if your light is not far from what you are shadowing due to the image approach. 
So if you have a large terrain with an unique directional light ( as sun ), 
simple shadowmaps should do an ugly result.
You could try "cascade shadowmaps" which is a technique used a lot in video 
games. It uses a kind of shadowmap LOD to avoid image based algorithms issues 
and stay cheap.

Shadow volumes generate very accurate shadows but as it is based on 
geometry, if your scene geometry is complex you will experience some perf 
issues.

Again, the shadowing technique choice depends of how many lights you have, 
where they are, what you are shadowing etc.
Give a bit more details of your goal and i'm sure some osg pro will bring 
to you the ideal solution using osg :)

Regards,
Harold


___
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



  ___
  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
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgShadows

2009-12-09 Thread Wojciech Lewandowski
Hi,

Cascaded Shadow Maps is the same as Parallel Split Shadow Map. PSSM is 
implemented in osgShadow. Also LispSM could work for you scenario. 

Cheers,
Wojtek Lewandowski






From: Trajce Nikolov 
Sent: Wednesday, December 09, 2009 10:19 AM
To: OpenSceneGraph Users 
Subject: Re: [osg-users] osgShadows


Hi Harold, 


yes, my light source is the "sun". No other lights in the scene yet. And the 
results are not good. I will do research on the "cascade shadowmaps" and will 
try to implement it. Thanks for the hint

Nick

http://www.linkedin.com/in/tnikolov
Sent from Gümüşsuyu, İstanbul, Turkey 


On Wed, Dec 9, 2009 at 11:13 AM, Harold Comere  wrote:

Hi Nike,


  There is many way to get shadows and the shadowing technique choice shall 
depend of your scene data.

  The two basic shadowing techniques are :
  - shadow maps ( image based )
  - shadow volumes ( geometry based )

  Shadow maps are very cheap and easy to implement but will works good only if 
your light is not far from what you are shadowing due to the image approach. So 
if you have a large terrain with an unique directional light ( as sun ), simple 
shadowmaps should do an ugly result.
  You could try "cascade shadowmaps" which is a technique used a lot in video 
games. It uses a kind of shadowmap LOD to avoid image based algorithms issues 
and stay cheap.

  Shadow volumes generate very accurate shadows but as it is based on geometry, 
if your scene geometry is complex you will experience some perf issues.

  Again, the shadowing technique choice depends of how many lights you have, 
where they are, what you are shadowing etc.
  Give a bit more details of your goal and i'm sure some osg pro will bring to 
you the ideal solution using osg :)

  Regards,
  Harold


  ___
  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
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgShadows

2009-12-09 Thread Trajce Nikolov
Hi Harold,

yes, my light source is the "sun". No other lights in the scene yet. And the
results are not good. I will do research on the "cascade shadowmaps" and
will try to implement it. Thanks for the hint

Nick

http://www.linkedin.com/in/tnikolov
Sent from Gümüşsuyu, İstanbul, Turkey

On Wed, Dec 9, 2009 at 11:13 AM, Harold Comere wrote:

> Hi Nike,
>>
>
> There is many way to get shadows and the shadowing technique choice shall
> depend of your scene data.
>
> The two basic shadowing techniques are :
> - shadow maps ( image based )
> - shadow volumes ( geometry based )
>
> Shadow maps are very cheap and easy to implement but will works good only
> if your light is not far from what you are shadowing due to the image
> approach. So if you have a large terrain with an unique directional light (
> as sun ), simple shadowmaps should do an ugly result.
> You could try "cascade shadowmaps" which is a technique used a lot in video
> games. It uses a kind of shadowmap LOD to avoid image based algorithms
> issues and stay cheap.
>
> Shadow volumes generate very accurate shadows but as it is based on
> geometry, if your scene geometry is complex you will experience some perf
> issues.
>
> Again, the shadowing technique choice depends of how many lights you have,
> where they are, what you are shadowing etc.
> Give a bit more details of your goal and i'm sure some osg pro will bring
> to you the ideal solution using osg :)
>
> Regards,
> Harold
>
> ___
> 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] osgShadows

2009-12-09 Thread Harold Comere
>
> Hi Nike,
>

There is many way to get shadows and the shadowing technique choice shall
depend of your scene data.

The two basic shadowing techniques are :
- shadow maps ( image based )
- shadow volumes ( geometry based )

Shadow maps are very cheap and easy to implement but will works good only if
your light is not far from what you are shadowing due to the image approach.
So if you have a large terrain with an unique directional light ( as sun ),
simple shadowmaps should do an ugly result.
You could try "cascade shadowmaps" which is a technique used a lot in video
games. It uses a kind of shadowmap LOD to avoid image based algorithms
issues and stay cheap.

Shadow volumes generate very accurate shadows but as it is based on
geometry, if your scene geometry is complex you will experience some perf
issues.

Again, the shadowing technique choice depends of how many lights you have,
where they are, what you are shadowing etc.
Give a bit more details of your goal and i'm sure some osg pro will bring to
you the ideal solution using osg :)

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


[osg-users] osgShadows

2009-12-09 Thread Trajce Nikolov
Hi,

I am having a scene, large terrain and moving models. What is the best
approach to have the scene shadowed? I tried couple of techniques, but the
results are not good. Any hints ?

Thanks!
Nick

http://www.linkedin.com/in/tnikolov
Sent from Gümüşsuyu, İstanbul, Turkey
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org