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 

Scaled Images with GL_RG Format


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Daniel Emminizer, Code...
Guest





PostPosted: Tue Jun 26, 2018 6:47 pm    Post subject:
Scaled Images with GL_RG Format
Reply with quote

Hi Robert,

I have found a minor bug with image scaling. I have a texture that is 1024x768 that is being resized to 1024x1024 for a Texture2D. Texture::applyTexImage2D_load() detects the need to resize and tries to do so through gluScaleImage(), which is implemented in src/osg/glu/libutil/mipmap.cpp.

All that works great for most of my images, but this image is greyscale with alpha. GL spec deprecates GL_LUMINANCE_ALPHA and requires use of GL_RG for these images types. But the code in gluScaleImage() does not respect GL_RG (though it supports many other formats).

This patch treats GL_RG identically to GL_LUMINANCE; a simple 2 element format.

After this patch, my image shows up fine. Mipmap.cpp supports many other similar types, like GL_RED. Risk of this change seems pretty low.

PR is up at https://github.com/openscenegraph/OpenSceneGraph/pull/566

Thanks,

- Dan



------------------
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 Support for paletted images in dds pl... psi29a Plugins [osgPlugins] 1 Fri Jun 22, 2018 10:14 am View latest post
No new posts Support for loading cubemap images in... Farshid Lashkari Submission 7 Wed May 09, 2018 5:56 pm View latest post
No new posts 'fatal error C1128: number of section... Jason Beverage General 2 Wed Apr 18, 2018 7:59 pm View latest post
No new posts Texture2DArray Internal Texture Forma... Tare General 7 Wed Apr 04, 2018 10:35 am View latest post
No new posts Warning: Error in reading to jpg images romulogcerqueira General 4 Sat Nov 04, 2017 10:37 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