OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

color interpolation at tile boundaries even with --no-interpolate-imagery


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> VirtualPlanetBuilder [vpb]
View previous topic :: View next topic  
Author Message
creature (Ethan Fahy)
Appreciator


Joined: 07 Sep 2011
Posts: 142

PostPosted: Thu May 30, 2013 2:17 pm    Post subject:
color interpolation at tile boundaries even with --no-interpolate-imagery
Reply with quote

I use osgdem with the --no-interpolate-imagery and --no-mipmap optiosn to wrap geotiff imagery onto my terrain complex. However, the unsigned int rgb channels contain index values to be used in lookup tables in the shader, not real imagery. Because of this, it is important that the color values contained in the input geotiffs be carried all the way through the osgdem process without any interpolation.

I modified the src for VPB to force NEAREST for the textures, and use the --no-interpolate-imagery and --no-mipmap options to try to keep any interpolation from happening. For the most part, everything works and I am able to get the correct index values in my shader. The exception is at tile boundaries of the osgdem-generated terrain complex.

To test this, I used a geotiff that only had values of 13 and 15 in it and generated an osgdem terrain. In my shader, I decode those index values and color the terrain grees in the value is either 13 or 15, and red if it's 14. The entire terrain is green except at the tile boundaries where spots of red show up. This leads me to believe that interpolation is happening at the tile boundaries. Am I correct in this assumption? Any thoughts on how I might prevent this from happening? Thanks.

-Ethan
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10862

PostPosted: Thu May 30, 2013 2:52 pm    Post subject:
color interpolation at tile boundaries even with --no-interpolate-imagery
Reply with quote

Hi Ethan,

You are correct, VPB does texture colour and normal equalization at
tile boundary to avoid the tile boundaries being obvious. The code is
written specifically for RGB/RGBA data and was never written with the
idea that int data would be used.

In your case one would need to turn off the boundary equalization for
the imagery.

Robert.

On 30 May 2013 15:17, Ethan Fahy <> wrote:
Quote:
I use osgdem with the --no-interpolate-imagery and --no-mipmap optiosn to wrap geotiff imagery onto my terrain complex. However, the unsigned int rgb channels contain index values to be used in lookup tables in the shader, not real imagery. Because of this, it is important that the color values contained in the input geotiffs be carried all the way through the osgdem process without any interpolation.

I modified the src for VPB to force NEAREST for the textures, and use the --no-interpolate-imagery and --no-mipmap options to try to keep any interpolation from happening. For the most part, everything works and I am able to get the correct index values in my shader. The exception is at tile boundaries of the osgdem-generated terrain complex.

To test this, I used a geotiff that only had values of 13 and 15 in it and generated an osgdem terrain. In my shader, I decode those index values and color the terrain grees in the value is either 13 or 15, and red if it's 14. The entire terrain is green except at the tile boundaries where spots of red show up. This leads me to believe that interpolation is happening at the tile boundaries. Am I correct in this assumption? Any thoughts on how I might prevent this from happening? Thanks.

-Ethan

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








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
creature (Ethan Fahy)
Appreciator


Joined: 07 Sep 2011
Posts: 142

PostPosted: Thu May 30, 2013 3:01 pm    Post subject:
Reply with quote

Thank you Robert. I should assume this is a change I'd make in the VPB src and not a command line option (that I'm missing) in osgdem correct?

-Ethan
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10862

PostPosted: Thu May 30, 2013 3:11 pm    Post subject:
color interpolation at tile boundaries even with --no-interpolate-imagery
Reply with quote

Hi Ethan,

On 30 May 2013 16:01, Ethan Fahy <> wrote:
Quote:
Thank you Robert. I should assume this is a change I'd make in the VPB src and not a command line option (that I'm missing) in osgdem correct?

I have just checked the source and there is no option to
enable/disable the calls the boundary equalization code. You'd need
to look to adding this and an option that enables/disables it. You'd
want to keep the height field equalization enabled, but disable the
equalization for the non RGBA/RGB image layers. The relevant code
looks to be in VirtualPlanetBuilder/src/vpb/DestinationTile.cpp, in
the void DestinationTile::equalizeEdge(Position position) method. I
expect you'd want to individual turn on/off the equalization for each
image layer.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
creature (Ethan Fahy)
Appreciator


Joined: 07 Sep 2011
Posts: 142

PostPosted: Thu May 30, 2013 5:49 pm    Post subject:
Reply with quote

Thanks Robert I'll have a look.

I was going to start a new thread for this next question but since I've already explained my situation and why it's necessary to have precise colors I'll just ask it here:

I notice that my index values can be slightly off if the angle between the terrain texture normal and the line from the camera-to-terrain is close to 90 degrees. I figured out that this goes away if I force Anisotropic Filtering to be off in my NVidia control panel, so it's definitely an effect of AF. However, I checked the VPB source and see that the default maxAnisotropy value is set to 1.0, and in the osg::Texture::setMaxAnisotropy() function I see a note saying that if maxAnisotropy is set to 1.0 that AF will be "off". Am I missing something? Is there any way to make sure that the effects of AF do not interfere with my indexing scheme without turning off AF in the graphics card driver settings?
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10862

PostPosted: Fri May 31, 2013 8:12 am    Post subject:
color interpolation at tile boundaries even with --no-interpolate-imagery
Reply with quote

Hi Ethan,

On 30 May 2013 18:49, Ethan Fahy <> wrote:
Quote:
I notice that my index values can be slightly off if the angle between the terrain texture normal and the line from the camera-to-terrain is close to 90 degrees. I figured out that this goes away if I force Anisotropic Filtering to be off in my NVidia control panel, so it's definitely an effect of AF. However, I checked the VPB source and see that the default maxAnisotropy value is set to 1.0, and in the osg::Texture::setMaxAnisotropy() function I see a note saying that if maxAnisotropy is set to 1.0 that AF will be "off". Am I missing something? Is there any way to make sure that the effects of AF do not interfere with my indexing scheme without turning off AF in the graphics card driver settings?

I believe those osgdem anisotropy settings will be just affecting the
old osg::Geometry based pathway, the modern and default usage of
osgTerrain will be using the GeometryTechnique's implementation that
does set the anisotropy to 16.0, have a look at
OpenSceneGraph/src/osgTerrain/GeometryTechnique.cpp. Again this is
down to design and implementation assuming that it's working with
colour data that is best to using filters that generate the best
visual result.

The way to address this would be to extend osgTerrain::Layer to
contain a MaxAnisotropy property alongside the existing
Layer::MinFileter and MagFiler properties, once this exists it would
be easy to wire up VPB to set this property and for
GeometryTechnique.cpp to read it.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> VirtualPlanetBuilder [vpb] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts wireframe darker wrt the surface color gambr General 9 Tue Mar 21, 2017 4:00 pm View latest post
No new posts Secondary Color not working? umesh General 0 Tue Feb 14, 2017 10:37 am View latest post
No new posts Version 3.5.6 osgText::Text bounding ... dcfennell General 0 Tue Jan 31, 2017 5:40 pm View latest post
No new posts Draw vertex as Circle with color give... Bruno Oliveira General 7 Mon Jan 02, 2017 7:22 pm View latest post
No new posts replace tile with my own Node in VPB ... Trajce Nikolov NICK General 4 Sat Dec 03, 2016 2:29 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP