Re: [osg-users] Problem with my cubemap

2009-05-15 Thread Jason Daly

Jean-Sébastien Guay wrote:
If there *is* a special format for a cube map contained in a .dds file, 
perhaps the OSG .dds loader doesn't handle it correctly? I don't know, 
but you could investigate by checking the code. Again, perhaps someone 
else has more insight into this.
  


DDS files can contain multi-surface images, including cube maps.  The 
problem is that there is currently no Image class in OSG that will hold 
a cube map, so there is no way for the .dds plugin to return a cube map.


I had a similar problem when I wrote the .vtf loader for Valve textures.

--J

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


Re: [osg-users] Problem with my cubemap

2009-05-15 Thread Robert Osfield
On Fri, May 15, 2009 at 3:34 PM, Jason Daly jd...@ist.ucf.edu wrote:
 Jean-Sébastien Guay wrote:

 If there *is* a special format for a cube map contained in a .dds file,
 perhaps the OSG .dds loader doesn't handle it correctly? I don't know, but
 you could investigate by checking the code. Again, perhaps someone else has
 more insight into this.


 DDS files can contain multi-surface images, including cube maps.  The
 problem is that there is currently no Image class in OSG that will hold a
 cube map, so there is no way for the .dds plugin to return a cube map.

Indeed there isn't a osg::Image class that does cube maps yet.

I have been pondering on this issue for a quite while as this topic
does occasionally come up.  The way to tackle is to have an
osg::CompositeImage/ImageList/ImageArray subclass from osg::Image that
provides a list of images that can be assigned to a osg::Texture.
One would want to scoop up the needs of the texture array support at
the same time.

Ideally we'd have an ImageBase class rather than subclassing from
Image or refactor Image so it's a base class, and then have concrete
implementations subclass from this.  It's kinda awkward to undertake
such a refactoring now though.

A template for an ImageArray class could be the ImageSequence class
that already holds a list of images internally.  Others are welcome to
dive in an add this ImageArray class ;-)

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


Re: [osg-users] Problem with my cubemap

2009-05-15 Thread Jason Daly

Robert Osfield wrote:

A template for an ImageArray class could be the ImageSequence class
that already holds a list of images internally.  Others are welcome to
dive in an add this ImageArray class ;-)
  


I thought about it while I was writing the .vtf loader, but I was under 
time pressure, and the Image code was fairly complex at first look, so 
it kind of scared me off  :-)


--J

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


Re: [osg-users] Problem with my cubemap

2009-05-15 Thread Roland Smeenk
Hello Robert,

I've originally contributed the .dds cubemap loading capability that you 
rejected. From that time I've been merging my changes with the latest head. 
Cubemaps can still be loaded succesfully, but I agree that it may be better to 
split osg::Image into multiple classes for the different osg::Textures that it 
feeds. Are you envisioning a separate Image class for each Texture class? 

Side note:
Last week I ran into a problem with cubemaps in the osgOcean example which 
turned out to be a pixelformat problem. The osgOcean example uses 6 separate 
images of which one image has a different pixel format. My osg::Image class 
supporting cubemaps has only one pixelformat for all 6 data planes and this 
caused a problem when copying the six images into the single cubemap image.

kind regards,

Roland Smeenk

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





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


Re: [osg-users] Problem with my cubemap

2009-05-15 Thread Robert Osfield
HI Roland,

On Fri, May 15, 2009 at 4:40 PM, Roland Smeenk roland.sme...@tno.nl wrote:
 I've originally contributed the .dds cubemap loading capability that you 
 rejected. From that time I've been merging my changes with the latest head. 
 Cubemaps can still be loaded succesfully, but I agree that it may be better 
 to split osg::Image into multiple classes for the different osg::Textures 
 that it feeds. Are you envisioning a separate Image class for each Texture 
 class?

No, my proposal of an osg::ImageArray class would need to be
compatible with all Texture types.  Not all would know enough about it
to make use of it.  My thought was the the osg::Image base classes
sizes/type data pointers would be assigned to one of the osg::Image
that the ImageArray manages so that a simple Texture2D texture would
just select one of them, but a TextureCubeMap could go look for images
0,1,2,3,4,5, etc.


 Side note:
 Last week I ran into a problem with cubemaps in the osgOcean example which 
 turned out to be a pixelformat problem. The osgOcean example uses 6 separate 
 images of which one image has a different pixel format. My osg::Image class 
 supporting cubemaps has only one pixelformat for all 6 data planes and this 
 caused a problem when copying the six images into the single cubemap image.

In the context of the osg::ImageArray class you'd probably want a
function for querying of all the images are compatible, and perhaps a
function for making them all the same.  Possible texture cube map
would also need to be written to cope between with different pixel
formats.

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


Re: [osg-users] Problem with my cubemap

2009-05-14 Thread Jean-Sébastien Guay

Bonjour Kévin,


I try to create a cubeMap on a sphere. It works but all my images (.bmp) on 
cubemap's faces are flip ...


You can flip images with osg::Image::flipHorizontal() or 
osg::Image::flipVertical(). I don't know why they come out that way by 
default though. Perhaps your BMPs assume (0,0) is at the top-left corner 
instead of the bottom-left? I don't know if there's something in the 
format that specifies this.


In addition, with .dds files I have this error for each file : 


I have no idea about these errors, I've used other tools to convert 
images to .dds compressed files and could use them without problems. 
I'll let others help with this part.


And, last question : someone has succeed to load one file .dds which contains the cubemap ??? 


Well, I've loaded one image that contained a cube map (both in .dds and 
in .png format) but that's because it was a vertical cross cube map and 
I extracted each face manually from the image. I don't know if there's 
some special format for .dds files containing cube maps, I just used it 
as a normal image and did whatever I wanted with it just like any other 
image file.


If there *is* a special format for a cube map contained in a .dds file, 
perhaps the OSG .dds loader doesn't handle it correctly? I don't know, 
but you could investigate by checking the code. Again, perhaps someone 
else has more insight into this.


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem with my cubemap

2009-05-14 Thread Chris 'Xenon' Hanson
Jean-Sébastien Guay wrote:
 You can flip images with osg::Image::flipHorizontal() or
 osg::Image::flipVertical(). I don't know why they come out that way by
 default though. Perhaps your BMPs assume (0,0) is at the top-left corner
 instead of the bottom-left? I don't know if there's something in the
 format that specifies this.

  There is an option in BMP to specify this, if I recall. I don't know if the 
OSG BMP
loader understands it.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem with my cubemap

2009-05-14 Thread Ümit Uzun
Hi Kevin;

If you have problem creation on cubeMap you can use Cube Map Generater to
create your dds file on
http://developer.amd.com/gpu/cubemapgen/pages/default.aspx

But as Jean said I don't know you can success on loading dds formated
cubemap on OSG, it might not be supported.


HTH, Regards.

2009/5/15 Chris 'Xenon' Hanson xe...@alphapixel.com

 Jean-Sébastien Guay wrote:
  You can flip images with osg::Image::flipHorizontal() or
  osg::Image::flipVertical(). I don't know why they come out that way by
  default though. Perhaps your BMPs assume (0,0) is at the top-left corner
  instead of the bottom-left? I don't know if there's something in the
  format that specifies this.

   There is an option in BMP to specify this, if I recall. I don't know if
 the OSG BMP
 loader understands it.

 --
 Chris 'Xenon' Hanson, omo sanza lettere  Xenon
 AlphaPixel.com
 PixelSense Landsat processing now available!
 http://www.alphapixel.com/demos/
 There is no Truth. There is only Perception. To Perceive is to Exist. -
 Xen
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




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