Hello
I just completed my dll to export scenes from 3D studio max into my own
format. First impressions make me quite happy, but I have some issues
with texture coordinates and also with texture artifacts.
Here are 2 screen captures of a rendered scene, first with 3D studio max
and the second with my openGL program.
http://img515.imageshack.us/img515/4796/orgtruck.png
http://img515.imageshack.us/img515/1434/restruck.png
As you see, the wheels and trailer texture coordinates are good, but on
the front of the truck, the texture is tilting. And worse, on the side
of the cabin, textures are black and white with color gradients.
I don't ask help for my exporter on comp.graphics.api.opengl, but just
if anyone here already got this kind of artifacts with openGL. Could
anyone give me a hint on what could cause that and how to solve it?
Thanks
Cathy
|
|
0
|
|
|
|
Reply
|
Cathy
|
11/25/2009 9:50:40 PM |
|
Cathy wrote:
> I don't ask help for my exporter on comp.graphics.api.opengl, but just
> if anyone here already got this kind of artifacts with openGL. Could
> anyone give me a hint on what could cause that and how to solve it?
Hard to tell. It could be as simple as a messed up texture file, a bug in
the texture loader, a problem in the texture coordinate processin in either
the model file writer or reader.
A few hints for debugging: Use simple textures, which tell you, what's going
on, like a gradient with the red component rising in intensity with the U-
direction and the green component with the V-direction. Choose the most
simple filters possible, i.e. GL_NEAREST for texture minification and
magnification. Render a black and white wireframe, and layer it on top of
the filled rendering, so that you can see, how texturing and geometry
relate.
Wolfgang
|
|
0
|
|
|
|
Reply
|
Wolfgang
|
11/25/2009 11:46:32 PM
|
|
On 2009-11-25, Cathy <nob@now.fr> wrote:
> Hello
>
> I just completed my dll to export scenes from 3D studio max into my own
> format. First impressions make me quite happy, but I have some issues
> with texture coordinates and also with texture artifacts.
>
> Here are 2 screen captures of a rendered scene, first with 3D studio max
> and the second with my openGL program.
> http://img515.imageshack.us/img515/4796/orgtruck.png
> http://img515.imageshack.us/img515/1434/restruck.png
I don't think that has anything to do with texture coordinates. For
instance the door is approximately where you expect it, with a slight
offset for each scanline.
That along with the color distortion points to either loading the image
incorrectly (e.g. treating a 24bpp PNG file as 32bit for instance), or
giving the data to glTexImage2D with the wrong pixel format arguments
(i.e. the pixel format you specify doesn't actually agree with what's in
the buffer).
--
John Tsiombikas (Nuclear / Mindlapse)
http://nuclear.sdf-eu.org/
|
|
0
|
|
|
|
Reply
|
John
|
11/26/2009 5:57:47 AM
|
|
Wolfgang Draxinger a �crit :
> Cathy wrote:
>
>> I don't ask help for my exporter on comp.graphics.api.opengl, but just
>> if anyone here already got this kind of artifacts with openGL. Could
>> anyone give me a hint on what could cause that and how to solve it?
>
> Hard to tell. It could be as simple as a messed up texture file, a bug in
> the texture loader, a problem in the texture coordinate processin in either
> the model file writer or reader.
>
> A few hints for debugging: Use simple textures, which tell you, what's going
> on, like a gradient with the red component rising in intensity with the U-
> direction and the green component with the V-direction. Choose the most
> simple filters possible, i.e. GL_NEAREST for texture minification and
> magnification. Render a black and white wireframe, and layer it on top of
> the filled rendering, so that you can see, how texturing and geometry
> relate.
>
>
> Wolfgang
Thanks Wolfgang, I try that this morning.
Cathy
|
|
0
|
|
|
|
Reply
|
Cathy
|
11/26/2009 5:58:25 AM
|
|
> I don't think that has anything to do with texture coordinates. For
> instance the door is approximately where you expect it, with a slight
> offset for each scanline.
> That along with the color distortion points to either loading the image
> incorrectly (e.g. treating a 24bpp PNG file as 32bit for instance), or
> giving the data to glTexImage2D with the wrong pixel format arguments
> (i.e. the pixel format you specify doesn't actually agree with what's in
> the buffer).
I use standard PNG file that I read with pnglib. So I'm gonna debug this
in priority. That's odd, because some of them are well displayed and
they are all 24bpp (no alpha channel).
I just tried to "glBindTexture(GL_TEXTURE_2D,textID+1)" the "+1" to
check if the display problem is texture specific or texture coordinate
specific. As the artifacts have moved with the texture, I can tell that
they are texture specific. Not the offset though, they remain on the
same geometry, so it would appeared to be linked with wrong texture
coordinates.
Thanks for the tip, I'm gonna investigate this way
Cathy
|
|
0
|
|
|
|
Reply
|
Cathy
|
11/26/2009 6:50:39 AM
|
|
Sorry for disturbance, I just understood the problem with your different
remarks. I already had this problem, but it seems that I don't learn
from my mistakes: the texture lines were not DWORD aligned, I fixed that
and now everything looks great!
Sorry again
Cathy L.
|
|
0
|
|
|
|
Reply
|
Cathy
|
11/26/2009 7:05:46 AM
|
|
|
5 Replies
211 Views
(page loaded in 0.068 seconds)
|