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 

Accessing floating point textures in Fragment Sh


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Harash Sharma
Guest





PostPosted: Fri Oct 17, 2008 7:28 am    Post subject:
Accessing floating point textures in Fragment Sh
Reply with quote

Hi all,

I am facing a problem in accessing the floating point texture within a fragment shader. I have some 2D floating point array that I wish to access within the Fragment Shader. For the purpose,
1. I have created an image with the pixel format GL_LUMINANCE and data type of GL_FLOAT.
2. The Array data is copied to the Image data array.
3. The image is bound to a texture and this texture passed as uniform to the Fragment Shader.

The output is a totally white screen.

However, if I modify the Pixel format to GL_RGBA and the datatype to GL_UNSIGNED_BYTE and convert the values to integer and split the 4 bytes of unsigned int into R,G,B,A, I am able to reconstruct the values within the shader and process the fragment accordingly.

I am using nVidia Quadro Fx 4500 graphics card on Intel Xeon 5160 processor.

Please Guide

Regards

Harash.

------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Fri Oct 17, 2008 8:52 am    Post subject:
Accessing floating point textures in Fragment Sh
Reply with quote

Hi Harash,

floating point formats are not available for all pixel formats. Have
a look at the OpenGL specs/extension registry on the topic of float
textures to see what floating point formats are supported.

Robert.

On Fri, Oct 17, 2008 at 8:28 AM, Harash Sharma <> wrote:
Quote:
Hi all,

I am facing a problem in accessing the floating point texture within a
fragment shader. I have some 2D floating point array that I wish to access
within the Fragment Shader. For the purpose,
1. I have created an image with the pixel format GL_LUMINANCE and data type
of GL_FLOAT.
2. The Array data is copied to the Image data array.
3. The image is bound to a texture and this texture passed as uniform to the
Fragment Shader.

The output is a totally white screen.

However, if I modify the Pixel format to GL_RGBA and the datatype to
GL_UNSIGNED_BYTE and convert the values to integer and split the 4 bytes of
unsigned int into R,G,B,A, I am able to reconstruct the values within the
shader and process the fragment accordingly.

I am using nVidia Quadro Fx 4500 graphics card on Intel Xeon 5160 processor.

Please Guide

Regards

Harash.






------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General 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 override the texture with the gl_frag... GarfieldPig General 1 Sun Apr 14, 2019 8:31 am View latest post
No new posts osgSim::DOFTransform pivot point Alberto Luaces General 4 Tue Apr 09, 2019 7:39 pm View latest post
No new posts Large scale point clouds rendering wi... saedrna1 General 1 Fri Mar 08, 2019 8:01 am View latest post
No new posts Add search location for textures in F... bbjorn Submission 1 Mon Feb 04, 2019 2:22 pm View latest post
No new posts Happy New Year to all OSG Users Chris Hanson General 0 Mon Jan 07, 2019 10:17 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