Custom Terrains in Maya

Hi all,

I am trying to get the basics of terrain creation and honestly I am kinda lost.

I have looked throught the forum and I didnt find much when it comes to newbies and terrains

A1)Is there any sort of tutorials as to how you can create terrains in Maya or Blender?

Also, I was highly interested in the whole octree deal which seems to give a much needed boost to collision detection. The Chicken exporter can generate an octree on its own which sounds very convenient.

B1)Is there someway for automatic octree creation in Maya?
B2)Is it possible to make my terrain on my own (talking about static terrains) and then use another simplified, invisible version of the terrain as the collider? (something similar was done in the collision tutorials by astelix)

Now for animated worlds/terrains. I havent found much again on this topic and even though the Panda team seems to mostly use Maya, not much material exists on how to do this in a Panda friendly manner:
C1)One of the ways that came to mind was to make a plane in Maya and sculpt it into the desired shape and extract it as a separate .egg file which I will load as a world

I would then paint the terrain with Maya and extract this as a texture which I would then load into panda.

However this will end up looking mediocre. So for the moving parts, i was thinking of modeling trees, grasses etc in Maya using the 3d paint tool, export them as separate .egg file, animate them and also export their animations.

However the whole procedure seems arduous, lengthy and error-prone

Is there a standard or good practice way to create proper static or animated world/terrains in Maya in such a manner that can be imported into Panda in a painless way?

Would it be possible to make a full-fledged 3D terrain in Maya using the 3d paint tool for trees etc and then export this as one egg? If it is, would it be possible to have animation in parts of this terrain (moving trees, grass, rolling water)?

Any help or tips will be appreciated

Thanks in advance,
Adam

A1) I don’t know of any tutorials off the top of my head but both are common concepts. For just the terrain alone search for displacement mapping for terrain generation tutorials.

B1) It is certainly not impossible to generate octrees in Maya. Really this is just a way of organizing your generated geometries. I’m not sure how much of a programming background you have but you could potentially use python scripting to automatically generate a optimization tree hierarchy.

B2) Yes and yes. In fact I would start out with this. If your just beginning, the more important thing is to get something that works. Optimize later. In any game creation workflow, usually small prototypes are made first. Worry about the highly technical stuff later… unless thats your primary goal.

Animated worlds and animated terrains are usually two different concepts. Animated worlds tend to have static terrains with animated objects on it (like creatures). Animated terrains usually mean the terrain can be destroyed or warped, etc. Not sure what you mean here.

C1) There’s a couple things that work kind of well to begin with but doesn’t scale up very much. Sculpting a terrain in Maya is just fine for small terrains. For larger things you will want an LOD system.

As for textures. Usually a well made terrain system uses multiple layers of textures tiled at different intervals. Check out the following for a VERY simplified example of this:
chadvernon.com/blog/resource … texturing/

Your on track with the moving parts being seperate objects. However the 3d paint tool you will find does not generate real-time graphics friendly meshes. Most of the brushes (even the lower fidelity ones) generate some pretty terrible meshes form a game engine standpoint. Most 3d terrains use many many tricks including painted flats that use vertex shaders to move them as well as grass/fur shells.

What your looking for is an easy solution to quite a complicated problem. However, don’t get discouraged it is solvable.

My suggestion is to solve one problem at a time.

  1. Generate the ground and height field for terrain
  2. Multi-texture the terrain with a grass, dirt, roads, etc.
  3. Light the terrain
  4. Collision detect the terrain
  5. Simple trees
  6. Trees with LODs
  7. Grass with LODs
    8) Fur Shells
  8. Atmospherics and lighting

You can do terrain splatting with python:

import direct.directbase.DirectStart
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *

base.cam.setPos(0,-15,0)


# the terrain geometry
terrain = loader.loadModel("environment")
terrain.reparentTo(render)
terrain.setScale(0.20)

# Stage 1: the first texture
ts = TextureStage("stage-first")
ts.setSort(0)
ts.setMode(TextureStage.MReplace)

ts.setSavedResult(True)

terrain.setTexture(ts, loader.loadTexture("maps/envir-ground.jpg"))

# Stage 2: the second texture
ts = TextureStage("stage-second")
ts.setSort(1)
ts.setMode(TextureStage.MReplace)
terrain.setTexture(ts, loader.loadTexture("maps/envir-treetrunk.jpg"))

# Stage 3: stencil
ts = TextureStage("stage-stencil")
ts.setSort(2)
ts.setCombineRgb(TextureStage.CMInterpolate, TextureStage.CSPrevious, TextureStage.COSrcColor, TextureStage.CSLastSavedResult, TextureStage.COSrcColor, TextureStage.CSTexture, TextureStage.COSrcColor)
terrain.setTexture(ts, loader.loadTexture("maps/panda_torso.rgb")) 

# Stage 4: reapply vertex colour (lightning)
ts = TextureStage("stage-vertexcolour")
ts.setSort(3)
ts.setCombineRgb(TextureStage.CMModulate, TextureStage.CSPrevious, TextureStage.COSrcColor, TextureStage.CSPrimaryColor, TextureStage.COSrcColor)
terrain.setTexture(ts, "final")


# lightning
plight = PointLight('plight')
plnp = render.attachNewNode(plight)
plnp.setHpr(0, 0, 0)
plnp.setPos(0,0,20)

render.setShaderAuto()
render.setLight(plnp)


run()

The media is pretty bad for this though. Try your own files with an unwrapped terrain model.

Thanks for the responses guys. They are truly helpful. I will look into it and try to share the wisdom once I get somewhere.

Really appreciate it :smiley: