opensg-users  

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

Gerrit Voss
Sat, 10 May 2008 21:24:45 -0700

Hi Carsten,

On Fri, 2008-05-09 at 11:18 -0500, Carsten Neumann wrote:
>       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.

always convert is fine. Writing I did not really consider as I would
assume whatever is present will be written and I don't think converting
on writing is something we should do. The apps must change anyway as
all other indirect loaders (e.g. vrml, collada, obj, ...) create the 
Env+Obj combination, so nothing can really rely on the texturechunk
being present. And instead of making everything handle both cases I
think it is better to guarantee the Env+Obj combination is created by
the loaders.

kind regards,
  gerrit





-------------------------------------------------------------------------
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