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 

On adding GL_FLOAT / GL_LUMINANCE32F Texture Support


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> VirtualPlanetBuilder [vpb]
View previous topic :: View next topic  
Author Message
pleopard
User


Joined: 29 Jun 2011
Posts: 47
Location: Huntsville AL

PostPosted: Wed Oct 17, 2012 9:13 pm    Post subject:
On adding GL_FLOAT / GL_LUMINANCE32F Texture Support
Reply with quote

I need to retain my texture information in a full 32 bit float format as my textures store temperature values in high precision celsius units. I added a parser to GDAL to load my terrain and texture datasets from their respective file formats and that part is working just fine.

Looking over the osgDem options I see --RGBA32F and --RGB32F options but what I need is a --LUMINANCE32F option. So, I am digging through the code to figure out how to do this.

I have found the point in Destination.cpp where the image sets are being retrieved and the textures are being created. I checked the GL pixel format and data type of the image instances at that point. They show GL_FLOAT as the pixel data type and GL_RGBA as the pixel data format. While GL_FLOAT is matched with the input data, GL_RGBA tells me that the texture pixel format has been converted which would require quantization of my high precision data. Furthermore, examination of the resulting texel intensities in a shader reveals that they have been transformed to the range [0,1].

Can you direct me to the point that the image data incoming from GDAL is being converted from full 32 bit float (GL_LUMINANCE32F) to GL_RGBA? I would like to modify it so that my textures were not chopped and quantized so that I can retain the incoming precision and units. My fragment shader converts the incoming fragments from the celsius temperature range to the visible range of [0,1] and I need it to stay that way.

Thanks,
Paul
Back to top
View user's profile Send private message Visit poster's website
creature (Ethan Fahy)
Appreciator


Joined: 07 Sep 2011
Posts: 142

PostPosted: Thu Dec 27, 2012 2:54 pm    Post subject:
Reply with quote

There was a feature proposal to add floating point texture support to VPB:

http://forum.openscenegraph.org/viewtopic.php?t=9515

I'm not sure if it ended up being added or not, but either way you may be able to add the proposed src to the current VPB src to add the support you are looking for.

I was looking to do the same type of thing as you a while back and instead of adding floating point textures to the terrain model, I created basic unisigned 8 bit int textures that contained my own indexing scheme in the rgb channels. Then I used GLSL shaders to decode the indexing scheme and apply a floating point value based on floating point texture files that I attached to the shaders as a uniform using osg. That type of scheme may or may not work for you.
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 Rend to Texture Once GuiYe General 1 Sun Aug 26, 2018 7:31 am View latest post
No new posts Can't share Texture among several tex... mp3butcher General 1 Fri Aug 17, 2018 11:06 pm View latest post
No new posts minor change: move assumeSizedInterna... mp3butcher General 9 Wed Aug 15, 2018 10:07 pm View latest post
No new posts Minor change proposal : Blacklist usa... mp3butcher General 14 Mon Aug 13, 2018 1:42 pm View latest post
No new posts Load an obj file and mapping a given ... aaa3d General 3 Mon Aug 06, 2018 2:27 pm 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