opensg-users  

Re: [Opensg-users] New OSB loader in OpenSG 2.0

Carsten Neumann
Fri, 09 May 2008 10:29:11 -0700

        Hi Gerrit,

Gerrit Voss wrote:
> On Thu, 2008-05-08 at 16:48 -0500, Carsten Neumann wrote:
>> Gerrit Voss wrote:
>>> another small problem I found is that if OpenSG is build without the
>>> deprecated TextureChunk (which is now split into TextureObj and
>>> TextureEnv) we can not load older files that use it.
>>>
>>> So if you are looking into the loader anyway and have a quick solution
>>> for this one it would be great to have it fixed too ;-) I started
>>> looking into it but as I'm not to familiar with the new loader it
>>> wasn't obvious to me how to handle this case nicely.
>> ok, I'll look into this. Is there a #define or something similar that 
>> can be queried to see if the TextureChunk is present ?
> 
> hmm, I don't see why we would need to query this. In 2.x I would always
> convert an incoming TextureChunk to the Obj + Env combination.

please see below.

>> I guess it is not urgently required that upon writing TextureChunk is 
>> being written as TextureObjChunk + TextureEnvChunk, right ?
> 
> Kind of urgent. As I compile with -Werror I can't include the deprecated
> stuff, the cubetexture chunk does not like it. So I will have to look
> for a solution sooner than later. As for the writing, they are written
> the same way they are loaded/created so loading and saving old files
> won't change anything from TextureChunk to TexEnv + TexObj.

uhm, I'm confused. We can always convert a TextureChunk to TexEnv + 
TexObj or we can attempt to keep them if possible, but then we need to 
know whether it *is* actually possible.

FWIW, I think we should do this:

if TextureChunk is compiled into the lib:

        loading a TextureChunk from osb creates TexObj + TexEnv
        writing a TextureChunk to osb writes TextureChunk

if TextureChunk is *NOT* compiled into the lib:

        loading a TextureChunk from osb creates TexObj + TexEnv
        writing a TextureChunk can not happen.

Note that this means loading and then writing an old osb is a 
non-identity operation (but I think that is nothing new, e.g. Geometry 
gets converted as well). On the other hand this scheme does not care 
whether the lib has compiled TextureChunk in or not.

The alternative would be to do this:

if TextureChunk is compiled into the lib:

        loading a TextureChunk from osb creates a TextureChunk
        writing a TextureChunk to osb writes TextureChunk

if TextureChunk is *NOT* compiled into the lib:

        loading a TextureChunk from osb creates TexObj + TexEnv
        writing a TextureChunk can not happen.

For this case the loader has to behave differently depending on the 
presence of TextureChunk in the lib.

What is the behavior we want here ?

        Thanks,
                Carsten

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users