HottBJ Textures - Any control?


I have been playing around with importing from Blender using the HottBJ importer. Very good. Nice work.

I do have an issue though, that I can't quite see how to resolve. The texture that is loaded does not have any Magnfication/Minification filters on, leading to a rather unpleasant look when close up (see attachment, right side). I would like it to look more like the image on the left hand side.

Now then, I'm not one to just throw in a question without at least looking to try and find out why. I believe the reason is because the XMLImporter just does a TextureManager.loadTexture(tKey) rather than a TextureManager.loadTexture(tKey, MinificationFilter, MagnificationFilter, etc) (This is actually in the DOMInputCapsule which XMLImporter uses). What I can't quite work out is if there's a way back to that TextureState, and if I can change it…

I'm tinkering around with spatial.getRenderState(StateType.Texture) but getting NullPointerExceptions…

Any help gratefully received :smiley:

Hi richard,

I know that this issue was there once, but as far as I know trilinear/bilinear is set for the filters. So first

question, is your exporter uptodate? I think the last was 0.4b.

But to answer your qeustions. I think you get the nullpointer-problem cause you try to get the texturestate from the node and not the trimesh (that is child of that node). Nevertheless I have a method in my Utils-class for doing the job, you wanted to do:

   public static void fixTexture(Geometry geom)
      TextureState ts2 = (TextureState)geom.getRenderState(StateType.Texture);
      if (ts2!=null)
         for (int i=0; i<ts2.getNumberOfSetTextures();i++)
            Texture t = ts2.getTexture(i);
            if (t!=null)
   public static void fixTextures(Node n)
      List<Geometry> geoms = n.descendantMatches(Geometry.class);
      for (Geometry g : geoms)

Hope that helps.

ttrocha, thank you so much…

So first question, is your exporter uptodate?

Well, it was 0.3b, I tried 0.4b-SNAPSHOT, but this gave me grief exporting any textures (I'm not a Blender pro, so didn't really know where to go). I played it safe and went for 0.3f... Seemed to work fine. But it's not the exporter that defines the filters... Is it? So I got the same issue.

Nevertheless I have a method in my Utils-class for doing the job

BINGO! As usual, I had made an assumption that the spatial WAS the tri-mesh. Now I have a much cleaner looking texture. Superb!

Thanks again.

As you said in older versions there were no filter information created in the xml. try 0.4b again

but you have to uncheck "use alpha" in "texture view"(F6). (that changed for some reason…)

if this does not work you can provide me the blend-file and I have a look…

keep on rocking

Thanks… Unselect alpha did the job. Can't believe I missed it  :roll:

And I can see those wonderful settings in the XML file:

<com.jme.image.Texture2D apply="Modulate" wrapS="Repeat" wrapT="Repeat" minificationFilter="Trilinear" magnificationFilter="Bilinear">

Thanks again. My fountain is now a thing of beauty  :slight_smile: