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 

DDS textures not loading on Mac OSX and the latest trunk(3.5.0)

Goto page Previous  1, 2
 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins]
View previous topic :: View next topic  
Author Message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10892

PostPosted: Tue Aug 18, 2015 1:28 pm    Post subject:
DDS textures not loading on Mac OSX and the latest trunk(3.5.0)
Reply with quote

Hi Curtis,


I've tried the model under Linux and it works fine.  From converting to .osgt I see the model originally had references to .dds files so presume the osg::Image are generated with mipmaps and these are stored in the .ive as they should be.


It very much looks like exactly the same problem - that OSX GL drivers aren't handling pre generated mipmaps.  The workaround for this driver bug is exactly the same as I outlined previously - a NodeVisitor that is run on OSX that finds osg::Image with mipmaps assigned and disables them - this approach works for .dds files loaded directly or osg::Image with mipmaps that are embedded with an .ive or .osgb file.


On the OSG the only thing we could do is add such a hack, but as this driver bug is very likely transient I don't see as something sensible to do - we'd be disabling a feature on the OSX for an unspecified period going forward and introducing hacks to the OSG that could introduce bugs themselves.



Robert.






On 18 August 2015 at 14:10, Curtis Rubel < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Robert,

Maybe I spoke too soon...  Just to add some more data
to this thread:

The attached file, terrain.ive is something we use for testing
and is also delivered with Sundog's Triton package as part
of a demo.

This file loads fine on Linux all versions of OSG.

On the mac it loads fine on OSG 3.3.1, but since then
no textures are loaded with this file.

I also have another set of openflight files that have the
same issue, Linux all versions is OK, Mac OS, nothing
after 3.3.1 will load the dds textures.

This link to a small sample database, also has issues
on the Mac, but works fine on all Linux versions:

https://www.dropbox.com/s/nm8f4op5ybw39dq/MalaysiaFlt.tjz?dl=0

It is still likely that this is some Mac OSX OpenGL thing, but
if some time comes up might be worth looking at just to
be sure what is happening with them.  Maybe its an old
version of flight formatting or something.

Loading one of the flt tiles on the mac, the only suspicious
message I see is:

Warning: Detected OpenGL error 'invalid operation' at After Render::compile

OpenGL extension'' is not supported.


...

Thank you!

Cheers,
Curtis

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




_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
crubel@compro.net
User


Joined: 12 Aug 2010
Posts: 69
Location: Melbourne, FL USA

PostPosted: Tue Aug 18, 2015 1:58 pm    Post subject:
Reply with quote

Hi Robert,


OK thank you for taking a quick look....

With things the way they are now, its very strange. I have a few sets
of flight files that work and also a set that does not. The dropbox
link I put in my last post for the small flight test case, the dds textures
do not load on the mac. So it seems that this is not failing with
all cases of pre-generated mipmaps. Maybe there is something
in how this was done in older versus newer versions of openflight
or something.

What is the difference between using the pre-gen'd mipmaps and not
using them? Is there some sort of performance boost if the
pre-gen'd ones are working properly, something has to be
calculated on the fly as they are loading or something?

Just curious as I know very little about this subject...


...

Thank you!

Cheers,
Curtis
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10892

PostPosted: Tue Aug 18, 2015 2:13 pm    Post subject:
DDS textures not loading on Mac OSX and the latest trunk(3.5.0)
Reply with quote

Hi Curtis,

On 18 August 2015 at 14:58, Curtis Rubel < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
   With things the way they are now, its very strange.  I have a few sets
of flight files that work and also a set that does not.  The dropbox
link I put in my last post for the small flight test case, the dds textures
do not load on the mac.   So it seems that this is not failing with
all cases of pre-generated mipmaps.  Maybe there is something
in how this was done in older versus newer versions of openflight
or something.


The way to look into this would be to take the same source model and convert it to .osgt with the older version and the new version and then compare.


 
Quote:

What is the difference between using the pre-gen'd mipmaps and not
using them?  Is there some sort of performance boost if the
pre-gen'd ones are working properly, something has to be
calculated on the fly as they are loading or something?


Pre-generated mipmaps are more efficient for downloading to the GPU.


The alternative is to use glu to generate the mipmaps or get the driver/GPU to compute them.  All these opertions will end up with the same representation on the GPU as pre-generated mipmaps so the final memory footprint, visual quality and performance will be the same, the only difference will the CPU or GPU overhead associated with generating the mipmaps on the fly.



For a real-time graphics application the difference you'd see if that pre-generated mipmaps are less likely to cause a frame break when the texture is download for the first time.



Robert.

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
crubel@compro.net
User


Joined: 12 Aug 2010
Posts: 69
Location: Melbourne, FL USA

PostPosted: Tue Aug 18, 2015 4:01 pm    Post subject:
Reply with quote

Hi Robert,

We will be continuing our investigation
to see if we can get a better handle on
what is the culprit behind these differences...

The suggestion for the NodeVistor is also
something we will be looking at for the Mac
systems until such a time as we can find
out the exact cause of the issue or it
gets fixed in a later version of the Mac OS
somewhere along the line.


Thank you for all the information and suggestions...

Cheers,
Curtis
Back to top
View user's profile Send private message
LEgregius (David Guthrie)
User


Joined: 06 Jan 2009
Posts: 26

PostPosted: Mon Aug 24, 2015 11:59 pm    Post subject:
Reply with quote

Hi,

I had modified the code to just ignore all loaded mipmaps in a few of the plugins to fix it, but everything work in older versions of OSG. The code is so different now, it's hard to tell what change triggered the problem.

David
Back to top
View user's profile Send private message AIM Address
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10892

PostPosted: Tue Aug 25, 2015 7:10 am    Post subject:
DDS textures not loading on Mac OSX and the latest trunk(3.5.0)
Reply with quote

HI David,

On 25 August 2015 at 01:00, David Guthrie < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
I had modified the code to just ignore all loaded mipmaps in a few of the plugins to fix it, but everything work in older versions of OSG.  The code is so different now, it's hard to tell what change triggered the problem.


If you follow the thread you'll find an explanation for what has revealed the problem with the OSX drivers - the DDS plugin previous ignored the mipmap stored in the file, but this was fixed so that the it loaded an osg::Image with all mipmaps correctly in place.  Once an osg::Image has mipmaps the .osgb and .ive plugins will write out then later reading in the mipmaps.


The solution is *NOT* to modify the plugin, the plugins are *CORRECT*.


The workaround for the OSX driver bug is to traverse the loaded subgraphs to find the osg::Image and disable the mipmaps.   This workaround can be done without any modifications to the OSG and done in a single place in your own applications - a ReadFileCallback that the does the traversal would problem this to automatically handle any loaded models - you'd just attach it to the osgDB::Registry::instance() when you run your application on OSX.


This suggest route also doesn't hamper other platforms where the GL drivers are working correctly.  Stored mipmaps are the most efficient way to get fully mipmapped imagery to the GPU so is the recommended route.  Under OSX we'll just have to put up with the workaround and performance overhead associated with the driver/GPU computing the mipmaps.


Longer term Apple will hopefully fix their GL drivers and you'll be able to drop the workaround.



Robert.




 

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
crubel@compro.net
User


Joined: 12 Aug 2010
Posts: 69
Location: Melbourne, FL USA

PostPosted: Tue Aug 25, 2015 12:21 pm    Post subject:
Reply with quote

Hi all,

The current version of OpenGL for Yosimite 10.10.5, seems to be working
to some extent from the testing I have done here recently, depending on
the data you are loading.

I have a new set of flt tiles here that loading their associated dds textures
OK, I can convert the flt.files to .osgb, etc. and they still load properly.

However, I also have another set of flt files that will not load their associated dds textures, as well as an old .ive file that does not
load the textures on Mac OSX but loads fine on Linux right now.

We are not quite sure what the differences are. Could be
the non-working flt files were built against an older flt spec or something
as this is a relatively old set of flt files.

The non-working flt files have this for the first few bytes:

00000000 00 01 01 14 54 65 72 72 65 78 00 00 00 00 06 04 |....Terrex......|
00000010 00 00 00 01 68 65 72 65 61 66 74 65 72 00 00 00 |....hereafter...|


The working flt files are different:
00000000 00 01 01 48 64 62 00 00 00 00 00 00 00 00 06 68 |...Hdb.........h|
00000010 00 00 00 01 31 39 2e 30 38 2e 32 30 31 35 2d 31 |....19.08.2015-1|

I do not know anything about the layout of a flt file, so cannot say even if
this means anything in this area, or is even enough to determine anything...

At any rate things are improving on OSX it seems, just backwards compatibility seems to be an issue to me.

Thank you!

Cheers,
Curtis
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins] All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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 Regarding Slowing loading of building... Rambabu General 2 Fri Apr 21, 2017 7:59 am View latest post
No new posts How to improve frame rate when loadin... vinothrajendran4 General 9 Wed Feb 22, 2017 2:01 pm View latest post
No new posts Deferring loading in an DB ReaderWrit... James Turner General 1 Fri Nov 18, 2016 8:03 pm View latest post
No new posts Problems with .ive loading Tiniriel Plugins [osgPlugins] 1 Wed Nov 09, 2016 9:55 am View latest post
No new posts Loading problem, OpenVR integration Oneiros General 8 Wed Nov 02, 2016 4:59 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