| View previous topic :: View next topic |
|
|
| Author |
Message |
macher User
Joined: 20 Jul 2009 Posts: 20
|
Posted: Thu Aug 06, 2009 8:31 am Post subject: osgconv.exe textures getting mangled |
|
|
Hi,
I have a model in ive format and osgviewer displays it fine. However if i convert it to osg, i get black and white shaded files as textures, which are of no use. I am using osgconv.exe with the following command line
osgconv.exe -e osg -O OutputTextureFiles -O precision:0.001 model.ive model.osg
Is there anything which i am missing ??
Thank you!
Mach |
|
| Back to top |
|
 |
joctee (Joakim Simonsson) Newbie
Joined: 24 Dec 2008 Posts: 17
|
Posted: Thu Aug 06, 2009 12:00 pm Post subject: osgconv.exe textures getting mangled |
|
|
On Thu, 06 Aug 2009 10:31:57 +0200, Mach Bhai <> wrote:
| Quote:
|
Hi,
I have a model in ive format and osgviewer displays it fine. However if
i convert it to osg, i get black and white shaded files as textures,
which are of no use. I am using osgconv.exe with the following command
line
osgconv.exe -e osg -O OutputTextureFiles -O precision:0.001 model.ive
model.osg
|
Try
osgconv.exe -e osg -O "OutputTextureFiles precision 4" model.ive model.osg
precision takes an integer
multiple options are space separated
--
Joakim Simonsson
------------------
Post generated by Mail2Forum |
|
| Back to top |
|
 |
macher User
Joined: 20 Jul 2009 Posts: 20
|
Posted: Thu Aug 06, 2009 12:12 pm Post subject: |
|
|
Thanks but it didnt work. I am still not getting correct textures. |
|
| Back to top |
|
 |
joctee (Joakim Simonsson) Newbie
Joined: 24 Dec 2008 Posts: 17
|
Posted: Thu Aug 06, 2009 12:14 pm Post subject: osgconv.exe textures getting mangled |
|
|
On Thu, 06 Aug 2009 14:00:15 +0200, Joakim Simonsson <>
wrote:
| Quote:
|
On Thu, 06 Aug 2009 10:31:57 +0200, Mach Bhai <> wrote:
| Quote:
|
Hi,
I have a model in ive format and osgviewer displays it fine. However if
i convert it to osg, i get black and white shaded files as textures,
which are of no use. I am using osgconv.exe with the following command
line
osgconv.exe -e osg -O OutputTextureFiles -O precision:0.001 model.ive
model.osg
|
Try
osgconv.exe -e osg -O "OutputTextureFiles precision 4" model.ive
model.osg
precision takes an integer
multiple options are space separated
|
When I try the OutputTextureFiles option, I also get black and white
striped textures.
What image format do you use? I use .rgb.
If you also use .rgb, perhaps it is something with the .rgb plugin...
--
Joakim Simonsson
------------------
Post generated by Mail2Forum |
|
| Back to top |
|
 |
macher User
Joined: 20 Jul 2009 Posts: 20
|
Posted: Thu Aug 06, 2009 12:17 pm Post subject: |
|
|
Yes i am also getting rgb files. It might be that something is wrong with that plugin but i cannot verify. Can we specify the format of the texture ? |
|
| Back to top |
|
 |
joctee (Joakim Simonsson) Newbie
Joined: 24 Dec 2008 Posts: 17
|
Posted: Thu Aug 06, 2009 12:23 pm Post subject: osgconv.exe textures getting mangled |
|
|
No, it is not possible.
The current osg implementation looks for the filename extension for the
texture inside the .ive file.
If the texture originally was an .rgb texture, it will try to write it to
that format as well.
On Thu, 06 Aug 2009 14:17:43 +0200, Mach Bhai <> wrote:
| Quote:
|
Yes i am also getting rgb files. It might be that something is wrong
with that plugin but i cannot verify. Can we specify the format of the
texture ?
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15904#15904
|
--
Joakim Simonsson
------------------
Post generated by Mail2Forum |
|
| Back to top |
|
 |
macher User
Joined: 20 Jul 2009 Posts: 20
|
Posted: Thu Aug 06, 2009 12:42 pm Post subject: |
|
|
So how can this issue be resolved ? |
|
| Back to top |
|
 |
joctee (Joakim Simonsson) Newbie
Joined: 24 Dec 2008 Posts: 17
|
Posted: Thu Aug 06, 2009 12:48 pm Post subject: osgconv.exe textures getting mangled |
|
|
You are using compressed textures in the ive file, right?
I figured out that the rgb plugin can't write compressed textures.
The only pixel formats that are supported are:
GLenum pixelFormat = img.getPixelFormat();
raw.sizeZ =
pixelFormat == GL_COLOR_INDEX? 1 :
pixelFormat == GL_RED? 1 :
pixelFormat == GL_GREEN? 1 :
pixelFormat == GL_BLUE? 1 :
pixelFormat == GL_ALPHA? 1 :
pixelFormat == GL_RGB? 3 :
pixelFormat == GL_BGR ? 3 :
pixelFormat == GL_RGBA? 4 :
pixelFormat == GL_BGRA? 4 :
pixelFormat == GL_LUMINANCE? 1 :
pixelFormat == GL_LUMINANCE_ALPHA ? 2 : 1;
When an compressed pixelformat (0x83f0) is encountered, it is treated as
an unknown pixel format. And hence 1 is used for sizeZ...
On Thu, 06 Aug 2009 14:42:03 +0200, Mach Bhai <> wrote:
| Quote:
|
So how can this issue be resolved ?
|
The issue can be solved by extending the rgb plugin, so that it can write
compressed textures.
OR
Don't compress your textures when you create the ive file...
--
Joakim Simonsson
------------------
Post generated by Mail2Forum |
|
| Back to top |
|
 |
macher User
Joined: 20 Jul 2009 Posts: 20
|
Posted: Thu Aug 06, 2009 12:55 pm Post subject: |
|
|
I will want to go with the first approach and add support for writing compressed textures.
So how can I go about uncompressing this data ? Any clues ?
and thanks for your help. |
|
| Back to top |
|
 |
joctee (Joakim Simonsson) Newbie
Joined: 24 Dec 2008 Posts: 17
|
Posted: Thu Aug 06, 2009 1:19 pm Post subject: osgconv.exe textures getting mangled |
|
|
On Thu, 06 Aug 2009 14:55:12 +0200, Mach Bhai <> wrote:
| Quote:
|
I will want to go with the first approach and add support for writing
compressed textures.
So how can I go about uncompressing this data ? Any clues ?
|
You have to write an S3TC uncompressor.
I have done this in a school project some years ago... If you want I can
try to dig up that code.
| Quote:
|
and thanks for your help.
|
--
Joakim Simonsson
------------------
Post generated by Mail2Forum |
|
| Back to top |
|
 |
macher User
Joined: 20 Jul 2009 Posts: 20
|
Posted: Thu Aug 06, 2009 1:24 pm Post subject: |
|
|
If you can do that, it would be very kind of you. |
|
| Back to top |
|
 |
joctee (Joakim Simonsson) Newbie
Joined: 24 Dec 2008 Posts: 17
|
Posted: Thu Aug 06, 2009 1:33 pm Post subject: osgconv.exe textures getting mangled |
|
|
Gotta go now. See what I can do tomorrow.
On Thu, 06 Aug 2009 15:24:40 +0200, Mach Bhai <> wrote:
| Quote:
|
If you can do that, it would be very kind of you.
|
--
Joakim Simonsson
------------------
Post generated by Mail2Forum |
|
| Back to top |
|
 |
macher User
Joined: 20 Jul 2009 Posts: 20
|
Posted: Thu Aug 06, 2009 1:39 pm Post subject: |
|
|
thanks i am looking forward to your help |
|
| Back to top |
|
 |
robertosfield OSG Project Lead
Joined: 18 Mar 2009 Posts: 7068
|
Posted: Thu Aug 06, 2009 1:45 pm Post subject: osgconv.exe textures getting mangled |
|
|
Hi Mach,
The .dds plugin supports writing compressed textures, so changing the
extension of the images from .rgb to .dds would probably do the trick.
Robert.
------------------
Post generated by Mail2Forum |
|
| Back to top |
|
 |
macher User
Joined: 20 Jul 2009 Posts: 20
|
Posted: Thu Aug 06, 2009 1:52 pm Post subject: |
|
|
Thanks, i only have the ive files, i dont have the original texture files. |
|
| Back to top |
|
 |
|