1 Reply Latest reply on Jun 7, 2013 9:16 AM by InteractiveMesh

    Blurry textures using OBJ / MTL file

    1013260
      Hi,

      I have a problem with bad texture quality in a 3D model rendered by using Java 3D. I have been working on this for two weeks now and did not find a solution. I hope to find some help here.

      Situation: I are using Java 3D to render a 3D model loaded from an obj file. Additional textures are coming from a referenced mtl file. Both files are exported from Sweet Home 3D.

      Problem: The objects are properly loaded and displayed. Most textures look OK. However, some textures are blurry like e.g. the windows bench, all floors and images in the picture frames as shown in this screenshot: http://s1.directupload.net/file/d/3278/torl8l5w_png.htm

      Diagnosis: As I know that these textures do look very mich different in the original model and are exported in much higher quality by Sweet Home 3D (image files look totally OK) than displayed, I assume that this is a rendering problem. So e.g. the texture of the picture frame in the left room right above the home trainer is defined as:

      newmtl material1_1056
      illum 2
      Ka 0.2 0.2 0.2
      Kd 1.0 1.0 1.0
      Ks 0.33 0.33 0.33
      Ns 20.0
      map_Kd xxx_material1_1056.png

      The texture file is this one: http://s14.directupload.net/file/d/3278/jm4du7yz_png.htm (original size 1024x512 pixels, 24 bitdepth).

      Shouldn't the texture look much different from the screenshot?

      What I already tried: I have already tried to use TextureAttributes, especially defining the Perspective correction to TextureAttributes.NICEST for all Shape3DNodes after the model was loaded from the file. No change. Activating AA in Java3D or the OS makes everything smoother but textures are not affected - of course.

      My question: Can anyone explain why those textures look so much blurry?

      Thanks in advance!
      Thomas
        • 1. Re: Blurry textures using OBJ / MTL file
          InteractiveMesh
          I just created some obj-exports from Sweet Home 3D samples and got the same result: some textures are not rendered correctly.

          I found out that no texture coordinates are provided for these objects in the obj-file. In such a case Java 3D's obj-loader 'ObjectFile' creates a 'TexCoordGeneration' instance with default settings for the plane equation coefficients which expect an object in the x/y-plane at the origen. Most likely pictures on walls are not positioned in this way. In consequence the texture is rendered in a weird manner.

          Check out the Sweet Home 3D Forum if this issue is already known (http://www.sweethome3d.com/support/forum/index).

          August