OverlayNode and shaders

classic Classic list List threaded Threaded
9 messages Options
jwils jwils
Reply | Threaded
Open this post in threaded view
|

OverlayNode and shaders

Hello,

I'm not sure if this is more of a general OpenSceneGraph question, but I thought I would give it a shot here in case anyone was trying something similar.  I am using OverlayNodes on osgEarth for various kinds of overlays, and this has been working just fine.  Separately, I have used a shader in order to brighten/darken the map, and that has worked fine as well.  Merging the two, however, does not seem to work.  If I add an OverlayNode and use the shader, the shader makes it so the OverlayNode cannot be seen.  Without the shader, the OverlayNode appears just fine.

My general structure is that I have the OverlayNode inserted directly below the CoordinateSystemNode of osgEarth.  I have attached the shader to the top level node of osgEarth, but I've also tried going beneath the OverlayNode and the problem still occurs.  Does anyone have any thoughts on what I might be doing wrong?  Thanks for your help!
Mathieu MARACHE Mathieu MARACHE
Reply | Threaded
Open this post in threaded view
|

Re: OverlayNode and shaders

Hi,

OverlayNodes use shader on some techniques used. You might be
replacing it's shader with your darkening shader. The OverlayNode
shader is used to reproject the texture on the object.

On a side-node I did some tryouts using osgEarth and OverlayNodes and
all worked fine only if I used The MultiPass Technique of osgEarth...

HTH
--
Mathieu
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



2009/9/29 jwils (via Nabble) <[hidden email]>:

> Hello,
>
> I'm not sure if this is more of a general OpenSceneGraph question, but I
> thought I would give it a shot here in case anyone was trying something
> similar.  I am using OverlayNodes on osgEarth for various kinds of overlays,
> and this has been working just fine.  Separately, I have used a shader in
> order to brighten/darken the map, and that has worked fine as well.  Merging
> the two, however, does not seem to work.  If I add an OverlayNode and use
> the shader, the shader makes it so the OverlayNode cannot be seen.  Without
> the shader, the OverlayNode appears just fine.
>
> My general structure is that I have the OverlayNode inserted directly below
> the CoordinateSystemNode of osgEarth.  I have attached the shader to the top
> level node of osgEarth, but I've also tried going beneath the OverlayNode
> and the problem still occurs.  Does anyone have any thoughts on what I might
> be doing wrong?  Thanks for your help!
>
> ________________________________
> View message @
> http://n2.nabble.com/OverlayNode-and-shaders-tp3732644p3732644.html
> To start a new topic under osgEarth, email
> [hidden email]
> To unsubscribe from osgEarth, click here.
>
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: OverlayNode and shaders

In reply to this post by jwils
Also, keep in mind that osgEarth used one texture unit per image layer (in multitexture mode; not so in multipass mode). So you could try setting the OverlayNode's texture unit to avoid conflicts.

Glenn
Glenn Waldron / Pelican Mapping
vaibhav vaibhav
Reply | Threaded
Open this post in threaded view
|

Re: OverlayNode and shaders

In reply to this post by Mathieu MARACHE
Hi,

How good is the performance of multipass Vs Multitexture.

Thanks
jwils jwils
Reply | Threaded
Open this post in threaded view
|

Re: OverlayNode and shaders

In reply to this post by gwaldron
Thank you for the responses.  I just tried switching the texture units, but I didn't have any luck.  I have one image layer, so when I made the texture unit 0, my overlayNode got mixed in as map tiles.  When I made it anything else, my overlayNode did not appear.  I'm going to give multipass a shot...can that be specified in the earth file, or is it only available in the API?
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: OverlayNode and shaders

Hi,

How many image layers are you using?  Try specifying the last unit on your card (so if you have 4 texture units, try setting the unit to 3).

You can specify multipass in the .earth file by specifying <multipass>true</multipass> in the map element.

The multipass technique is still a work in progress, so any feedback would be appreciated.

Thanks,

Jason

On Thu, Oct 1, 2009 at 10:26 AM, jwils (via Nabble) <[hidden email]> wrote:
Thank you for the responses.  I just tried switching the texture units, but I didn't have any luck.  I have one image layer, so when I made the texture unit 0, my overlayNode got mixed in as map tiles.  When I made it anything else, my overlayNode did not appear.  I'm going to give multipass a shot...can that be specified in the earth file, or is it only available in the API?


View message @ http://n2.nabble.com/OverlayNode-and-shaders-tp3732644p3749404.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.


jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: OverlayNode and shaders

In reply to this post by jwils
Sorry, made a mistake, you turn on multipass using:
<layering_technique>multipass</layering_technique>

Not <multipass>true</multipass>

Thanks,

Jason

On Thu, Oct 1, 2009 at 10:39 AM, Jason Beverage <[hidden email]> wrote:
Hi,

How many image layers are you using?  Try specifying the last unit on your card (so if you have 4 texture units, try setting the unit to 3).

You can specify multipass in the .earth file by specifying <multipass>true</multipass> in the map element.

The multipass technique is still a work in progress, so any feedback would be appreciated.

Thanks,

Jason


On Thu, Oct 1, 2009 at 10:26 AM, jwils (via Nabble) <[hidden email]> wrote:
Thank you for the responses.  I just tried switching the texture units, but I didn't have any luck.  I have one image layer, so when I made the texture unit 0, my overlayNode got mixed in as map tiles.  When I made it anything else, my overlayNode did not appear.  I'm going to give multipass a shot...can that be specified in the earth file, or is it only available in the API?


View message @ http://n2.nabble.com/OverlayNode-and-shaders-tp3732644p3749404.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.



jwils jwils
Reply | Threaded
Open this post in threaded view
|

Re: OverlayNode and shaders

In reply to this post by jasonbeverage
I'm using one image layer...I just tried specifying the last texture unit (3) for the overlayNode, and still the same results.  I set the multipass technique, and my earth disappeared, but I'm a bit behind the trunk, so I may try an update.  Thank you for everyone's help.
jwils jwils
Reply | Threaded
Open this post in threaded view
|

Re: OverlayNode and shaders

I'm actually thinking this is a problem with my lack of knowledge on shaders...basically, I was only grabbing the texture osgEarth was using and doing my shading with that texture.  After doing some reading, I definitely need to at least grab the other texture in my shader and somehow factor that in as well.  The texture coordinates seem to be throwing me for a loop at the moment, but this doesn't appear to be osgEarth related at all...thanks for your help!