Editable Terrain Manager [v2.2 released]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

Depends mostly on the amount of terrain visible at a time and your system ram. If you have a top down camera view, then many terrain tiles will be culled, but since the culling is purely octree-based, if your camera is more like an FPS camera moving on the terrain, then many tiles could be sent to render at a time even if not much terrain is visible.

For good performance even on not too advanced hardware, I'd target 513x513 or less, though 1025x1025 would probably work ok. Anything higher will probably go downhill rather quickly, but if you need such large terrains, there's a good chance you'd need a better management strategy, anyway.
User avatar
Dibalo
Halfling
Posts: 63
Joined: Mon Oct 16, 2006 4:10 pm
Location: Finland

Post by Dibalo »

CABAListic wrote:For good performance even on not too advanced hardware, I'd target 513x513 or less, though 1025x1025 would probably work ok. Anything higher will probably go downhill rather quickly, but if you need such large terrains, there's a good chance you'd need a better management strategy, anyway.
Yep. I need 1025x1025 maps and I made some test. ETM can handle map with FPS ~330 (ATI Radeon X800GT) which is quite good! The only thing is that you must desing your map that there are no flat areas because then FPS drops to ~100. But I´m pleased with these results.. :D

Now I have to make own editor. Or is there any kind of editor already? 8)
Dattebayo!
User avatar
fassihi
Goblin
Posts: 215
Joined: Sat Sep 16, 2006 6:51 am
x 8
Contact:

2 passes

Post by fassihi »

Cabalistic,

What should I do in order to be able to paint 12 textures, using 2 passes in ETM. I know that I have to change the shader code, but what changes should I make to my program? Does the existing ETM code support this feature?

How about if I wanted to use the alpha channel for coverage maps too?

Cheers
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

If you're using the SplattingManager, you need to tell it the number of textures you're using via setNumTextures. If you want to use alpha channels as well, then tell the SplattingManager that you want to use 4-channel coverage maps. That's all you need to do in code, the rest is up to the material.

Now, to actually splat them in the material, you first have to decide how you'd like to do it. If you'd like to keep SM1 compatibility, you could only use 4 textures in a pass, which would be 1 coverage map and 3 splatting textures at most, so you'd need 4 passes. With SM2 you have 16 texture units available for your shader, so you can have all 3 or 4 coverage maps and all 12 textures in "one" pass with a single shader (though, since most SM2 cards don't have that many real texture units, I suppose it will still result in two passes internally). You can also break it up in two passes, in which case you have 6 splatting textures per pass and therefore need two coverage maps for each of them. Therefore, for this strategy you should use 3-channel coverage maps. For this approach you can also reuse the shader from the ETM demo material and the demo material itself. Just copy the splatting pass, change the coverage maps and splatting textures in the copy and set scene_blend to add.
User avatar
jingjie
Kobold
Posts: 35
Joined: Mon Jul 18, 2005 5:00 am

Post by jingjie »

Master CABAListic:
About the TerrainManager , Would you support to export .mesh data which is constructed from heightmap data?
I want to the terrain mesh edited by ETM to able to be loaded by entity-based. :lol:
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

Far as I see this, that would not be the job of the TerrainManager. It would more be a utility function to convert a TerrainInfo to .mesh. I currently have no plans to implement that, but anyone's free to contribute such a function :)
User avatar
fassihi
Goblin
Posts: 215
Joined: Sat Sep 16, 2006 6:51 am
x 8
Contact:

More Splats...

Post by fassihi »

Thanks Cabal,

I just set the number of textures to 12 and added another pass to the material for the other 6 textures and it works great. :wink:

I guess the balancing of the coverage maps works automatically in this case right? ( there are 4 coverage maps now)
User avatar
fassihi
Goblin
Posts: 215
Joined: Sat Sep 16, 2006 6:51 am
x 8
Contact:

Dynamic Lighting

Post by fassihi »

I am trying to have dynamic lights, I've added a directional light to the scene and created the terrain with normals=true option.
However I don't notice any effects of the light on the terrain, are there any other things that are needed to be done?
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

Yeah, I believe you need the special shadow_receiver vertex programs in your material to make it work, but I'm afraid I can't guide you there because I don't quite understand them ;)

You might want to first use a very simple material without splatting which really just displays a texture on top of the terrain, like this:

Code: Select all

material BasicTerrain
{
  technique
  {
    pass
    {
      texture_unit
      {
        ambient 1 1 1
        lighting on
        texture base.png
      }
    }
  }
}
You should be able to see the effects of dynamic lights now, though honestly I don't find them that great compared to lightmaps.
From there you should take a look at the Ogre manual on materials and try if you can make sense of the shadow_receiver entries when using the programmable pipeline.
lzbhz
Gnoblar
Posts: 1
Joined: Sat Sep 08, 2007 3:03 am

ETMv2.1 how to add one mesh?

Post by lzbhz »

ETMv2.1 make a scene ,how to add one mesh?
User avatar
neocryptek
Gnome
Posts: 335
Joined: Sat Mar 01, 2003 11:21 pm
Location: Idaho, USA
Contact:

Post by neocryptek »

OgreUser wrote:My bad, rapidshare should be fine :

http://rapidshare.com/files/54176385/ET ... k.zip.html
Thanks!
flyman
Gnoblar
Posts: 2
Joined: Sat Aug 11, 2007 10:34 am

Post by flyman »

hi,CABAListic
i am adding ETM to my eidt,
but,now the terrain texture flicks badly.
what do i have to configure?
thanks.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

I have never experienced flicker. Does the demo work ok? If so, then double-check what you are doing differently in your editor.
FrozenLogic
Halfling
Posts: 42
Joined: Sun May 13, 2007 6:30 pm
Location: Sao Paulo, Brazil

Post by FrozenLogic »

Hey guys, i've compiled the source code but i got a error message when trying to running that.
this application has requested the Runtime to terminate it in an unusual way.
My plugins.cfg is like the following:
# Defines plugins to load

# Define plugin folder
PluginFolder=.

# Define plugins
Plugin=RenderSystem_Direct3D9_d
Plugin=RenderSystem_GL_d
Plugin=Plugin_ParticleFX_d
Plugin=Plugin_BSPSceneManager_d
Plugin=Plugin_OctreeSceneManager_d
Plugin=Plugin_CgProgramManager_d
Am i missing something?

Thanks
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

Sounds like an unhandled exception. Did you check Ogre's logfile? Maybe you haven't included the media files from ETM?
flyman
Gnoblar
Posts: 2
Joined: Sat Aug 11, 2007 10:34 am

Post by flyman »

CABAListic wrote:I have never experienced flicker. Does the demo work ok? If so, then double-check what you are doing differently in your editor.
yeah,the demo is perfect,but i did n't fingure out what is wrong,now i will
check it again,thanks for your reply.


THE ETM is very greate!
FrozenLogic
Halfling
Posts: 42
Joined: Sun May 13, 2007 6:30 pm
Location: Sao Paulo, Brazil

Post by FrozenLogic »

CABAListic wrote:Sounds like an unhandled exception. Did you check Ogre's logfile? Maybe you haven't included the media files from ETM?
Following the last three logs in Ogre's logfile:
11:52:44: Parsing script Example-CubeMapping.overlay
11:52:44: Parsing script Example-DynTex.overlay
11:52:44: Parsing script Example-Water.overlay
11:52:44: Parsing script Shadows.overlay
11:52:44: Finished parsing scripts for resource group General
11:52:44: Parsing scripts for resource group Internal
11:52:44: Finished parsing scripts for resource group Internal
Thanks in Advance
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

Hm, unfortunately that does not tell anything except that it doesn't seem to be an Ogre exception.
Still, did you copy the ETM media files to Ogre's media directory and include the ET folder in your resources.cfg?
FrozenLogic
Halfling
Posts: 42
Joined: Sun May 13, 2007 6:30 pm
Location: Sao Paulo, Brazil

Post by FrozenLogic »

CABAListic wrote:Hm, unfortunately that does not tell anything except that it doesn't seem to be an Ogre exception.
Still, did you copy the ETM media files to Ogre's media directory and include the ET folder in your resources.cfg?
Yes, i added the following:
FileSystem=C:/OgreSDK/media/ET
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

Then I have no idea. You'll need to use a debugger and trace the error, I can't tell you what's wrong :-/
FrozenLogic
Halfling
Posts: 42
Joined: Sun May 13, 2007 6:30 pm
Location: Sao Paulo, Brazil

Post by FrozenLogic »

CABAListic wrote:Then I have no idea. You'll need to use a debugger and trace the error, I can't tell you what's wrong :-/
Dont worry, thank you very much for your help Cabalistic. :)
drbootsie3
Gnoblar
Posts: 1
Joined: Wed Oct 10, 2007 2:23 pm

Post by drbootsie3 »

I'd like to use the ETM for my tile-based terrain. The map would simulate a planet thats why i need the edges connected, so the units can pass around. Has anyone ever experienced with such map?
omegafranco
Gnoblar
Posts: 24
Joined: Wed Oct 17, 2007 12:57 am

Post by omegafranco »

Hey Cabal! I've been out of internet for some time >< but i'm still interested in using ETM for my project. And so i don't bother you so much with PMs i'm posting here^^

Just some questions:
1) Can i use the ETM demo resources to develop the app for my paper? I don't have time to make my own ; ;

2) Just as a test, i've made a map with the ETM Demo and tried to apply its heightmap to the Ogre terrain Demo, but it didnt work. How can i do it? Do i need other resources like the lightmap aswell or something? Or is it because the compression of the png of the ETM? *When i try to do it the terrain demo tells that the heightmap from ETM isn't really a heightmap*

3) How can i set the number of repeating textures in a scene? I noticed it was 20 as a standard, just wanted to see some more.^^ I thought i could increase it by increasing the heightmap, but it didn't work out. I just noticed the setNumMaps at the ETSplattingManager, but i can't test it yet(i'm at school), so i might aswell ask xD

4) You told me before that i could regard 4 vertices as a tile. Certainly, these vertices are from the heightmap right? Well, thats really the only place storing info about the terrain topography. Is the a way to get the normal to the semi-plane made by these 4 vertices? I want to make the search graph weights as a function of the terrain's slopes. And, I decided i won't consider the terrain type for the weights in my search graph anymore, so i don't need to concern about the texture painting limits going over my tiles. That would only only add complexity to my project, and i have little time.

Thanks for any help there.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

1) Certainly, so long as you not claim they are your own.

2) I suppose you didn't edit all relevant settings of the terrain.cfg file. Maybe the page size was incorrect or something like that? Ogre's terrain scene manager can definitely load heightmaps from images.

3) What exactly do you mean? Do you mean the number of different textures used on the terrain? In that case, you need to call setNumTextures on the SplattingManager, and you'll also need to edit the terrain material to splat some more textures (using more passes). Or do you mean the number of times the textures are repeated on the terrain? In that case, that's a shader parameter you can edit in the terrain material.

4) The TerrainInfo class has a getNormalAt function which interpolates terrain normals from the vertices. It won't give you the normal of the plane formed by the 4 vertices, but if you just call it at the middle of your tile, the result should be good enough for your purposes, I'd suppose.
omegafranco
Gnoblar
Posts: 24
Joined: Wed Oct 17, 2007 12:57 am

Post by omegafranco »

2) I think i did the necessary changes. Well, i'll check things throughly then.
EDIT: yep. I must have done something wrong. Just loaded it just fine^^

3) I noticed that the textures repeated 20x20 at the terrain. I wanted to know if i could change this. The method createBaseTexture() has some attributes that correspond to this numbers, repeatX and repeatZ. But this is only used to create ETbase.png file, which has the base terrain. Also when i changed the parameter the texture did change, but ETbase.png doesn't seem to be consider at the terrain loading.

1 & 4) Cool, thanks!

Thanks for everything!
Post Reply