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 

Another case for extendable plugin loaders... Wa


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





PostPosted: Thu Oct 16, 2008 6:43 pm    Post subject:
Another case for extendable plugin loaders... Wa
Reply with quote

Hey,

Since most DDS textures are going to come in flipped (ie: directX style
and not openGL style) I would like my application to always pass the
"dds_flip" option to the DDS loader. If I could extend the DDS loader I
could do that. Just another case for including the loaders as actual
libs and the plugins themselves as smaller projects that just use the
loaders api.

Thanks,
Brett

Gordon Tomlinson wrote:
Quote:
This could be the way the DDS files have been generated, a lot of DDS
creation tools by default start with 0,0 top left instead of top bottom (or
the other way round) to the norm in vis-sim imagery,

This has been covered before on the list and a search will most likely pop
out how you can fix this, tools supplied with things like Creator /VegaPrime
make sure the correct 0,0 is chosen, so check you DDS creation tool and
re-gen with the 0,0 origin flipped

__________________________________________________________
Gordon Tomlinson


IM:
www.vis-sim.com www.gordontomlinson.com
__________________________________________________________

-----Original Message-----
From:
[mailto:] On Behalf Of
brettwiesner
Sent: Wednesday, October 15, 2008 10:38 AM
To: OpenSceneGraph Users
Subject: DDS textures flipped on flt files

Hi,

I have a sample terrain that shows that DDS textures are incorrect on flt
files. If you load up the flt file in osgviewer you should see a "framed"
terrain. However, the textures are flipped (it seems only vertically).

Thanks,
Brett






------------------
Post generated by Mail2Forum
Back to top
Jason Daly
Guest





PostPosted: Thu Oct 16, 2008 8:33 pm    Post subject:
Another case for extendable plugin loaders... Wa
Reply with quote

brettwiesner wrote:
Quote:
Hey,

Since most DDS textures are going to come in flipped (ie: directX style
and not openGL style) I would like my application to always pass the
"dds_flip" option to the DDS loader. If I could extend the DDS loader I
could do that. Just another case for including the loaders as actual
libs and the plugins themselves as smaller projects that just use the
loaders api.


It's easy enough to hard code a ReaderWriter option:

options = new osgDB::ReaderWriter::Options("dds_flip");
texImage = osgDB::readImageFile(filename, options);


You might want to use a ref_ptr for the options object, but basically,
the above should work.

--"J"



------------------
Post generated by Mail2Forum
Back to top
brettwiesner
Guest





PostPosted: Fri Oct 17, 2008 12:30 am    Post subject:
Another case for extendable plugin loaders... Wa
Reply with quote

Quote:
brettwiesner wrote:
Quote:
Hey,

Since most DDS textures are going to come in flipped (ie: directX style
and not openGL style) I would like my application to always pass the
"dds_flip" option to the DDS loader. If I could extend the DDS loader I
could do that. Just another case for including the loaders as actual
libs and the plugins themselves as smaller projects that just use the
loaders api.


It's easy enough to hard code a ReaderWriter option:

options = new osgDB::ReaderWriter::Options("dds_flip");
texImage = osgDB::readImageFile(filename, options);


You might want to use a ref_ptr for the options object, but basically,
the above should work.

--"J"

I think you're misunderstanding. I'm not loading the texture myself.
Other loaders are... the flt loader, the 3ds loader, etc. Surely you
don't mean to change all of them to pass that option? I'm actually
trying to avoid changing OSG source (otherwise I could just have the DDS
loader always use that option).

I'm suggesting two things...

1) that the DDS loader be fixed (ie: DDS is a directX file format and
it's coordinate system is directX. OSG should expect that DDS files come
in that coordinate system and flip them automatically).

2) And that I should be able to derive MyDdsLoader from a
osgDB::ddsLoader and register that with the osgDB_dds plugin so that my
loader is used.

Thanks,
Brett


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





PostPosted: Fri Oct 17, 2008 8:51 am    Post subject:
Another case for extendable plugin loaders... Wa
Reply with quote

HI Brett,

All you need to do is set the Registry's Options object for the default setting.

osgDB::ReaderWriter::Options* options = new
osgDB::ReaderWriter::Options;
options->setOptionString(str);
osgDB::Registry::instance()->setOptions(options);

Robert.

On Fri, Oct 17, 2008 at 1:25 AM, brettwiesner <> wrote:
Quote:

Quote:
brettwiesner wrote:
Quote:

Hey,

Since most DDS textures are going to come in flipped (ie: directX style
and not openGL style) I would like my application to always pass the
"dds_flip" option to the DDS loader. If I could extend the DDS loader I
could do that. Just another case for including the loaders as actual
libs and the plugins themselves as smaller projects that just use the
loaders api.


It's easy enough to hard code a ReaderWriter option:

options = new osgDB::ReaderWriter::Options("dds_flip");
texImage = osgDB::readImageFile(filename, options);


You might want to use a ref_ptr for the options object, but basically, the
above should work.

--"J"

I think you're misunderstanding. I'm not loading the texture myself. Other
loaders are... the flt loader, the 3ds loader, etc. Surely you don't mean to
change all of them to pass that option? I'm actually trying to avoid
changing OSG source (otherwise I could just have the DDS loader always use
that option).

I'm suggesting two things...

1) that the DDS loader be fixed (ie: DDS is a directX file format and it's
coordinate system is directX. OSG should expect that DDS files come in that
coordinate system and flip them automatically).
2) And that I should be able to derive MyDdsLoader from a osgDB::ddsLoader
and register that with the osgDB_dds plugin so that my loader is used.

Thanks,
Brett




------------------
Post generated by Mail2Forum
Back to top
David Spilling
Guest





PostPosted: Fri Oct 17, 2008 9:24 am    Post subject:
Another case for extendable plugin loaders... Wa
Reply with quote

Ah! I learn something every day...

Is there any system-wide check (other than by eye, at checkin) that makes sure that all of the options are unique to each loader? e.g. there isn't a "dds_flip" option in, say, the .ac3d loader?

David

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





PostPosted: Fri Oct 17, 2008 9:52 am    Post subject:
Another case for extendable plugin loaders... Wa
Reply with quote

Hi David,

On Fri, Oct 17, 2008 at 10:24 AM, David Spilling
<> wrote:
Quote:
Ah! I learn something every day...

Is there any system-wide check (other than by eye, at checkin) that makes
sure that all of the options are unique to each loader? e.g. there isn't a
"dds_flip" option in, say, the .ac3d loader?

There is only one default Options obejct attached to the Registry,
this is passed to all plugins if you don't pass your own Options
object to the readNode/Image/etc call. The plugins themselves just
need to pick out what parts of the options string that make sense to
them - so the ac3d plugin wouldn't care about dds_flip.

Robert.


------------------
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 Problems with dae plugin John Richardson Plugins [osgPlugins] 0 Thu Apr 11, 2019 5:00 pm View latest post
No new posts [PARTIALLY SOLVED] Problems with dae ... Nikkitta Plugins [osgPlugins] 4 Mon Apr 08, 2019 3:51 pm 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
No new posts osg-users Digest, Vol 138, Issue 27 Zachary1234 General 0 Tue Jan 01, 2019 1:16 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