So how do I really do to import beautiful terrain for JME3 modeled and textured in Blender?

Hey there. Wrote a fine and well structured post before the upload image button did not open in a new window and caused everything to disappear so now I’m just a melancholic little monkey and will keep this simple:


  1. Love the engine
  2. Can’t figure out good method to create and import terrain
  3. Spent all weekend searching on forum and google trying to solve this problem



    Tried so far:


  4. Built-in editor: Fine results but not for me
  5. Heightmaps: not for me
  6. Blender, great artistic freedom, for me

    3.1 .blend → .j3o. Can’t get textures to behave

    3.2 .blend → ogre → j3o. Exact same as above



    In blender I model terrain, apply layers of textures (i.e grass, cliffs, dirt) with alpha/stencil maps in between for texturepainting.



    Here’s a quick example picture of something I’m trying to import into JME3







    In JME3 I only get top level texture completely unscaled. Tried to meddle with custom material/matdef files and applying textures post model-import but I’m in over my head on that.



    So without going into further details about my struggles for now I turn in desperation to you, how do I do to model and texture beautiful terrain for JME3? Is there a method that I should follow that I’ve completely missed? Can I in someway achive getting that Blender model I made into JME3 looking the same?



    Thank you guys for a superb opensource engine and for making me discover this awesome world of game design, which I think I might have just sold my, if not the whole, a part of it, soul to.



    /Jonatan

Try baking all fancy texture mixing etc. stuff to one proper UV map and then try using the obj or ogrexml exporter and import these files. Maybe the blender importer will also work better then. I don’t know what exactly blender 2.5/6 does there (as in how it combines the data), so its hard to judge what exactly is going wrong. Blender lets you do lots of stuff that is not transferable to live OpenGL rendering really.

Hey, thanks for the reply. I looked into baking a bit before but I didn’t really go there but I will give that another try. I must admit that I’m not really well aware of how UV maps work, so I’m probably wrong here, but doesn’t that mean that I’ll be having one texture-file (size i.e 512x512) which is then applied on my terrain which in turn will create a very low res texture on my (big) terrain?

Yeah, basically. Though you can tile the texture… But with your modifications only by either separating the geometry (which might cause seams) or using a different texturing algorithm like its used in the terrain engine of jME3 :smiley: Thats why theres an editor in jME3, its a pretty specific thing… If you can get blender to export the alpha maps of the single terrain textures, you can just export the mesh and then create a j3m based on the terrain material where you set those and apply it to your mesh (it should have UV coords as blender seemingly uses them).

Cool, I see. How would I do to use a different texturing algorithm? :slight_smile:



Yes I’ve actually been experimenting with that. What I’ve been wanting to achieve is exporting from blender something in this general style:



grass.png

cliffs.png

cliffs_alpha.png

dirt.png

dirt_alpha.png



mesh.blend




Which I’m quite sure can be done. And then I just import the mesh and apply the textures afterwards in the code. I’ve tried this but haven’t gotten it to work cause I don’t really know how to do this correctly. I’ve tried with the terrain.j3m but that material just allows three textures and one (red-blue-green) alpha-map, or am I wrong? I then started looking into creating an own matdef which should support three diffuse maps and three alpha maps, one for each, but there I found myself way over my head :slight_smile:

I had similar question a long time ago : http://hub.jmonkeyengine.org/groups/general-2/forum/topic/about-texture-splatting/

@jonatandahl said:
Cool, I see. How would I do to use a different texturing algorithm? :)

@normen said:
export the mesh and then create a j3m based on the terrain material where you set those [images]
1 Like
@glaucomardano said:
I had similar question a long time ago : http://hub.jmonkeyengine.org/groups/general-2/forum/topic/about-texture-splatting/

Yes that's actually the exact same issue as I have. To bad it wasn't resolved though :) ... If it isn't so that you have finished the script you talked about in your last post of course? ;)

A side note about the terrain.j3m: The fact that it has a total lack of lighting and things like that, but I suppose you guys know how to add that by yourselves no? I just don't know how to do that, yet.

Thats why I would like to succeed in applying textures with alpha-maps respectively on, let's say, the TerrainLighting.j3m but I haven't succeeded in that at all and I don't really know if that's even possible to do.

you just use TerrainLighting.j3md?

you have finished the script you talked about in your last post of course?


No, because I thought it's MUCH more practical to use the terrain editor in jmp, and it supports a lot of textures with splat maps, it looks it supports 12(correct me if I'm wrong). normen and splored did a nice job :). Also, I'm a java programmer, and to create a script for that it's needed to know phyton. @thetoucher did a nice terrain with the editor :):




I think it's much more viable to use the terrain editor.

Oh I just saw TerrainLighting.j3md isn’t in the default list, but you can easily set it by editing the source of the j3m file, fixed that in svn.

@normen said:
Oh I just saw TerrainLighting.j3md isn't in the default list, but you can easily set it by editing the source of the j3m file, fixed that in svn.


Yes, I knew how to set the TerrainLighting material :) What I really meant, I was a bit unclear, was how to work with the alphamaps on it. But as I understand it: an alphamap i JME is made out of one rgb image, so with it you control alpha on three textures at once, one for each channel. So what I have to do is to export from blender three stencilmaps into one rgb-alphamap. I.e by coloring each stencil map in red, green and blue respectively and then merging them together to one image. Am I right? I'll let you know how it goes anyhow.

No, the alphamaps / stencilmaps is made of RGBA channels, then it might not work if you merge them… Also, in blender, for each stencil map you’ll need 2 textures, in jme, you’ll need “3” textures for each alpha map ;). Just looked at the materials overview, and terrain lighting supports “11” alpha maps, then if you multiply 11 x 3, you’ll have 33 in total ;).

If you have a simple terrain you can also use LightBlow shader: http://code.google.com/p/jme-glsl-shaders/



You can mix 4 diffuse textures, 4 normal map textures + 4 specular maps(alpha channel of the diffuse texture).



http://i.imgur.com/pBaSJ.jpg

@mifth… You really think just advertizing your shader helps him? oO He was asking how to use/set the images. If you had at least explained how they would be set using your shader… But like this its just like wtf… Any more of these will be considered spam :stuck_out_tongue:

1 Like