Page 1 of 1
Terrain Texturing
Posted: Thu Aug 26, 2004 7:20 am
by RyanN
Whats the best way to paint a terrain?
I want to get a similar effect used in FarCry with different high detailed textures blending together in specified areas.
Multitexturing i guess is the only way but how can i have textures with their own masks?
Posted: Thu Aug 26, 2004 7:32 am
by tuan kuranes
search "splatting" in these forum, or try ogreaddons paginglandscape
Posted: Thu Aug 26, 2004 7:36 am
by PeterNewman
That's not exactly the effect he's after, though. I happen to know this because RyanN is my art guy.
He's got a texture that has green for grass and brown for path and so on, that's fairly low detail and just defines ther area's. He'd like to put a higher detail tiled "rocky" texture on where the path area's are, and a higher detail tiled "grass" texture on the grass, and "cliff wall" on the cliffs, and so forth.
We've done something like this already by using multiple texture units and modulative blending, but this really only worked for producing a lightmap.
Posted: Thu Aug 26, 2004 8:12 am
by tuan kuranes
That is splatting to me.
you associate an alpha map with a type of texture or a texture, and it is drawn where alpha > 0.
splattting depends on the alpha map, but it's not limited to height or slope charecteristic, it can be alpha map done by hand, like path or so...
Posted: Thu Aug 26, 2004 8:57 am
by monster
I'm guessing that as this post's in the "Artists & Content Creators" section you're not really interested in the technical details of how splatting (or whatever you want to call it) happens, you just want some tool (or "arty" type mechanism

) that allows you to paint your landscape from high up in that air and which then automatically applies details to it as you get closer. Yes?
There was a really impressive terrain engine knocking around a while back. But they (
http://www.gscape.com/) seem to have disappeared. This had an editor that did, I think, exactly what you're after. You painted on it with big thick brushes roughly what type of textures you wanted where and the engine applied the necessary details to make it look nice close up.
Unfortunately I don't think such a tool exists (yet) for Ogre. But I haven't looked at the PLSM lately, so I could be wrong.
Posted: Thu Aug 26, 2004 10:36 am
by Dorkula
Posted: Fri Aug 27, 2004 12:24 am
by RyanN
A tool would really help

but i dont mind diving into the material file to do stuff. I was just woundering would it be done using multiple passes so that each texture layer won't effect the others?
Posted: Fri Aug 27, 2004 7:12 am
by semicolon
Yes, Ryan you can do some texture blend on top of the other. There are 2 ways you can do it. First, with scene_blend operations, you are to blend texture on top of the scene pixels. If you want to create like a tree plain, you have to create a tree texture with an alpha channel.
Code: Select all
material Tree_texture
{
technique
{
pass
{
ambient 0.588235 0.588235 0.588235 1
diffuse 0.588235 0.588235 0.588235 1
specular 0.9 0.9 0.9 1 0
scene_blend alpha_blend
texture_unit
{
tree_texture.png //say tree_texture is a texture with alpha channel
filtering point point point
}
}
}
}
Second, colour_op or colour_op_ex, you can blend between texture layer but this won't affect the current scene pixels, only inside the texture unit. This you will allow you to blend 2 textures to create some effect that you want.
Posted: Fri Aug 27, 2004 8:01 am
by RyanN
yes i already use that code to add transparency to my PNG files, but im still wondering how to combine multiple texture layers without affecting the already blended layers to create a texture effect like that used in the Unreal2 engine.
Posted: Fri Aug 27, 2004 8:06 am
by tuan kuranes
get ogreaddons
loook in paginglandscape media folder.
look for the splatting materials.
here is an excerpt :
Code: Select all
material SplattingMaterial
technique
{
lod_index 0
pass
{
// Base Pass
ambient 1.0 1.0 1.0
diffuse 1.0 1.0 1.0
texture_unit
{
// Base Texture
texture none
tex_address_mode clamp
alpha_op_ex source1 src_texture src_texture
colour_op_ex modulate src_current src_texture
}
}
pass
{
// Snow Pass
ambient 1.0 1.0 1.0
diffuse 1.0 1.0 1.0
scene_blend alpha_blend
depth_func equal
texture_unit
{
// Snow Alpha map
texture none
tex_address_mode clamp
alpha_op_ex source1 src_texture src_texture
colour_op_ex source1 src_current src_current
alpha_rejection greater_equal 2
}
texture_unit
{
// Snow Splat
texture splatting_snow.jpg
tex_address_mode mirror
alpha_op_ex source1 src_current src_current
colour_op_ex source2 src_current src_texture
scale 0.01 0.01
}
}
pass
{
// Sand Pass
ambient 1.0 1.0 1.0
diffuse 1.0 1.0 1.0
scene_blend alpha_blend
depth_func equal
texture_unit
{
// Sand Alpha map
texture none
tex_address_mode clamp
alpha_op_ex source1 src_texture src_texture
colour_op_ex source1 src_current src_current
alpha_rejection greater_equal 2
}
texture_unit
{
// Sand Splat
texture splatting_sand.jpg
tex_address_mode mirror
alpha_op_ex source1 src_current src_current
colour_op_ex source2 src_current src_texture
scale 0.01 0.01
}
}
pass
{
// Grass Pass
ambient 1.0 1.0 1.0
diffuse 1.0 1.0 1.0
scene_blend alpha_blend
depth_func equal
texture_unit
{
// Grass Alpha map
texture none
tex_address_mode clamp
alpha_op_ex source1 src_texture src_texture
colour_op_ex source1 src_current src_current
alpha_rejection greater_equal 2
}
texture_unit
{
// Grass Splat
texture splatting_grass.jpg
tex_address_mode mirror
alpha_op_ex source1 src_current src_current
colour_op_ex source2 src_current src_texture
scale 0.01 0.01
}
}
pass
{
ambient 1.0 1.0 1.0
diffuse 1.0 1.0 1.0
scene_blend alpha_blend
depth_func equal
texture_unit
{
// Rock Alpha map
texture none
tex_address_mode clamp
alpha_op_ex source1 src_texture src_texture
colour_op_ex source1 src_current src_current
alpha_rejection greater_equal 2
}
texture_unit
{
// Rock Splat
texture splatting_rock.jpg
tex_address_mode mirror
alpha_op_ex source1 src_current src_current
colour_op_ex source2 src_current src_texture
scale 0.01 0.01
}
}
}
technique
{
lod_index 1
pass
{
ambient 1.0 1.0 1.0
diffuse 1.0 1.0 1.0
texture_unit
{
// Base Texture
texture none
tex_address_mode clamp
}
}
}
}
The "texture None" are replaced realtime by the engine, loading an alpha only map, that determine if the current texture (snow, rock, etc..) si blended or not.
Posted: Fri Aug 27, 2004 8:12 am
by RyanN
thanks tuan kuranes, thats what i was talking about. I guess it textures could be specified but a real-time, walk around and paint the ground (like that used in FarCry) would be good in the future as a tool.
Posted: Mon Aug 30, 2004 1:47 am
by PeterNewman
Just like to say thanks tuan kuranes, that was what we were after, I was just thinking of it from a different direction so it didn't seem like splatting to me. My bad!

Posted: Thu May 26, 2005 4:02 am
by rmmt
I'm gonna go back a few steps.. if, for example, I'm using freeworld3d, which generates an alpha map per layer that I use to splat textures on the land, how do I get that to become a .material file?
SOrry if this sounds dumb, so please bare wth me

Posted: Thu May 26, 2005 2:39 pm
by tuan kuranes
@rmmt : just check the material file posted above...
replace the "texture none" by your alpha maps. (or using plsm2, name your file accordingly to plsm2 naming scheme (mapname.alpha.layer.Z.X.png, X and Z being page coordinates.))
Posted: Sun May 29, 2005 2:43 pm
by Greed
Can i get a link to ogreaddons please?
Posted: Sun May 29, 2005 3:01 pm
by jacmoe