[osg-users] Compressed texture

2009-03-31 Thread Yefei He
Hi, Folks,

If I create a flt file that uses compressed .dds files as textures, 
and then convert the flt file to ive format with the option 
"-O noTexturesInIVEFile", do I still get compressed texture when loading 
the ive file? Reading through the source code, it seems to indicate that 
the internal texture format is preserved by the dds loader as compressed
texture, and passed on to the osg core. So I assume it works. 

I have thought of converting the flt files that uses compressed 
textures to ive files with built-in texture and with one of the compressed
texture options. But in my set up I use multiple flt files that share 
textures, and I'm not sure if with built-in textures in ive files, I will 
have multiple instances of the same texture loaded into memory, so instead 
of one uncompressed texture in memory, I may end up with 20 compressed 
texture of identical content in memory. Is this what's going to happen 
with ive files with built-in textures?

Thanks,

Yefei

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Compressed texture

2009-03-31 Thread Yefei He
Sorry, the first sentence in the second paragraph should read "...flt
files that uses uncompressed textures...".

Yefei

> -Original Message-
> From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-
> boun...@lists.openscenegraph.org] On Behalf Of Yefei He
> Sent: Tuesday, March 31, 2009 1:08 PM
> To: 'OSG Users'
> Subject: [osg-users] Compressed texture
> 
> Hi, Folks,
> 
> If I create a flt file that uses compressed .dds files as textures,
> and then convert the flt file to ive format with the option
> "-O noTexturesInIVEFile", do I still get compressed texture when
> loading
> the ive file? Reading through the source code, it seems to indicate
> that
> the internal texture format is preserved by the dds loader as
> compressed
> texture, and passed on to the osg core. So I assume it works.
> 
> I have thought of converting the flt files that uses compressed
> textures to ive files with built-in texture and with one of the
> compressed
> texture options. But in my set up I use multiple flt files that share
> textures, and I'm not sure if with built-in textures in ive files, I
> will
> have multiple instances of the same texture loaded into memory, so
> instead
> of one uncompressed texture in memory, I may end up with 20 compressed
> texture of identical content in memory. Is this what's going to happen
> with ive files with built-in textures?
> 
> Thanks,
> 
> Yefei
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Compressed texture

2009-04-01 Thread Robert Osfield
HI Yefei,

The OSG has support for removing duplicate state on an already loaded scene
graph, but at present there isn't any support in the .ive format for pooling
imagery/texture between sets of .ive files.  The later feature would be very
useful though... so please feel free to dive in and implement it :-)

The next question is... how would one go about it.  Perhaps a custom state
pool Node that does nothing more than hold a map of names/ID to
StateAttribute.  Then you could save this node out to it's own .ive file,
then each of the other .ive files could include this StatePool node as an
external file reference.  Then use the Registry cache to make sure that each
of the separate .ive then reuse the same StatePool.  Finally the .ive plugin
would need to have some kinda of ID system to pull the apprpriate attribute
from the current StatePool(s).

Robert.

On Tue, Mar 31, 2009 at 7:07 PM, Yefei He  wrote:

> Hi, Folks,
>
>If I create a flt file that uses compressed .dds files as textures,
> and then convert the flt file to ive format with the option
> "-O noTexturesInIVEFile", do I still get compressed texture when loading
> the ive file? Reading through the source code, it seems to indicate that
> the internal texture format is preserved by the dds loader as compressed
> texture, and passed on to the osg core. So I assume it works.
>
>I have thought of converting the flt files that uses compressed
> textures to ive files with built-in texture and with one of the compressed
> texture options. But in my set up I use multiple flt files that share
> textures, and I'm not sure if with built-in textures in ive files, I will
> have multiple instances of the same texture loaded into memory, so instead
> of one uncompressed texture in memory, I may end up with 20 compressed
> texture of identical content in memory. Is this what's going to happen
> with ive files with built-in textures?
>
>Thanks,
>
>Yefei
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Compressed texture

2009-04-01 Thread Yefei He
Hi, Robert,

Thanks for your reply. Yes, I agree it will take quite some 
effort and possibly format change to implement texture sharing 
between ive files with built-in textures. That's why I would like
a quicker way out:) -- using ive files without built-in texture but 
refer to compressed texture in dds format. Is my assumption 
correct that compressed texture in dds format remains compressed 
when loaded into memory and passed on to the osg core and GL layer
without being decompressed, as opposed to say jpeg images which 
are decompressed during loading and then passed on to osg core in 
uncompressed bitmap format?

Thanks,

Yefei

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Wednesday, April 01, 2009 2:52 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Compressed texture

HI Yefei,

The OSG has support for removing duplicate state on an already loaded scene 
graph, but at present there isn't any support in the .ive format for pooling 
imagery/texture between sets of .ive files.  The later feature would be very 
useful though... so please feel free to dive in and implement it :-)

The next question is... how would one go about it.  Perhaps a custom state pool 
Node that does nothing more than hold a map of names/ID to StateAttribute.  
Then you could save this node out to it's own .ive file, then each of the other 
.ive files could include this StatePool node as an external file reference.  
Then use the Registry cache to make sure that each of the separate .ive then 
reuse the same StatePool.  Finally the .ive plugin would need to have some 
kinda of ID system to pull the apprpriate attribute from the current 
StatePool(s).

Robert.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Compressed texture

2009-04-01 Thread Robert Osfield
 Hi Yefei,

On Wed, Apr 1, 2009 at 4:24 PM, Yefei He  wrote:

>Thanks for your reply. Yes, I agree it will take quite some
> effort and possibly format change to implement texture sharing
> between ive files with built-in textures. That's why I would like
> a quicker way out:) -- using ive files without built-in texture but
> refer to compressed texture in dds format. Is my assumption
> correct that compressed texture in dds format remains compressed
> when loaded into memory and passed on to the osg core and GL layer
> without being decompressed, as opposed to say jpeg images which
> are decompressed during loading and then passed on to osg core in
> uncompressed bitmap format?
>

Yes this is correct, the OSG loads the S3TC_DXT* compressed formats from the
.dds file and keeps them in that format in the osg::Image and the final
downloaded texture.  You can compress the textures for a file using osgconv:

osgconv --compressed myfile.flt myfile.ive

It won't solve the problem of sharing textures though.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Compressed texture

2009-04-01 Thread Luigi Calori

As I' m also interested in texture compression my question is:
when using .osg files or ive files without texture inside (those 
obtained by osgconv -O noTexturesInIVEFile useOriginalExternalReferences 
foo.osg soo.ive)
if there is a chain of pagedlod files that refer to the same texture 
(for example the same material texture is used  for different files at 
different lods)

does it get readed or loaded in txture memory several times?
I though it does not happen... but willing to be sure.
Instead, if it is embedded in ive, it is replicated.
Am I wrong?

Another question: could be feasible to store jpeg as S3TC_DXT* instead 
of uncompressed?
I know it is not happening now... would it be hard to implement? are 
there technical limitations?
it seem to me that other web enabled sw like Google Earth are 
transmitting jpeg texture
I experimented once trying to call the same compression code in osgconv 
inside the jpeg plugin after the read... but the code got unstable and slow.

Has anyone tried this and/or would it be of some interest?


Thanks in advance


Robert Osfield ha scritto:

 Hi Yefei,

On Wed, Apr 1, 2009 at 4:24 PM, Yefei He > wrote:


   Thanks for your reply. Yes, I agree it will take quite some
effort and possibly format change to implement texture sharing
between ive files with built-in textures. That's why I would like
a quicker way out:) -- using ive files without built-in texture but
refer to compressed texture in dds format. Is my assumption
correct that compressed texture in dds format remains compressed
when loaded into memory and passed on to the osg core and GL layer
without being decompressed, as opposed to say jpeg images which
are decompressed during loading and then passed on to osg core in
uncompressed bitmap format?


Yes this is correct, the OSG loads the S3TC_DXT* compressed formats 
from the .dds file and keeps them in that format in the osg::Image and 
the final downloaded texture.  You can compress the textures for a 
file using osgconv:


osgconv --compressed myfile.flt myfile.ive

It won't solve the problem of sharing textures though.

Robert.


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Compressed texture

2009-04-01 Thread Yefei He
Hi, Robert,

Is sharing textures a problem even if the textures are externally
referenced by the .ive files? I see that in the implementation of 
read image, there is an option of CACHE_IMAGE. Is this turned on 
be default? Is the image cache indexed by the image file names? If 
so, I would expect shared externally referenced textures won't be 
loaded multiple times. Am I right about this?

Thanks,

Yefei

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Wednesday, April 01, 2009 10:50 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Compressed texture

 Hi Yefei,
On Wed, Apr 1, 2009 at 4:24 PM, Yefei He  wrote:
   Thanks for your reply. Yes, I agree it will take quite some
effort and possibly format change to implement texture sharing
between ive files with built-in textures. That's why I would like
a quicker way out:) -- using ive files without built-in texture but
refer to compressed texture in dds format. Is my assumption
correct that compressed texture in dds format remains compressed
when loaded into memory and passed on to the osg core and GL layer
without being decompressed, as opposed to say jpeg images which
are decompressed during loading and then passed on to osg core in
uncompressed bitmap format?

Yes this is correct, the OSG loads the S3TC_DXT* compressed formats from the 
.dds file and keeps them in that format in the osg::Image and the final 
downloaded texture.  You can compress the textures for a file using osgconv:

osgconv --compressed myfile.flt myfile.ive

It won't solve the problem of sharing textures though.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org