Changing the texture of a part of a terrain
-
sinapse
- Gnoblar
- Posts: 11
- Joined: Sat Dec 19, 2015 11:57 am
Changing the texture of a part of a terrain
Hey guys, here is my exact problem: I want to put a grass texture to show that for example this area is a park or a green field, what I have is a polygon which indicates that this area is needed to be a green field. So I tried adding grass meshes like tutorial 5 of intermediate tutorials but that sure resulted in an ugly issue of performance as there are so many meshes which should be rendered just for an small field of grass! So I thought maybe I need to just put a texture on the ground. I started to create a manual (triangle fan) to create a surface for that polygon and load the grass texture on it which resulted in the following image. As you can see because I didn't add any clue about the height between points, the grass surface intersected the terrain mesh. I did implement an easy way and didn't further my thoughts but here is my question: am I doing the right thing? I mean isn't there any embedded solution in the terrain manager for this that I am not familiar? If not, what solution do you recommend me to do this?
You do not have the required permissions to view the files attached to this post.
-
frostbyte
- Orc Shaman
- Posts: 737
- Joined: Fri May 31, 2013 2:28 am
- x 65
Re: Changing the texture of a part of a terrain
you can blend up to ( i think ) 6 layer of textures with difuse and normal and get something similiar to grass with no animation and only on ground surface
if you want higher stuff like flowers, bushes and stuff- you can use mesh-instancing or better yet static-geometry( i assume you are using ogre 1.x )
there is also a plugin called pagedGeometry with optimized rendering techniqe( 2d billboards-mesh imposters, paging and lod levels ) just for grass...
lastly...all i learned on terrain and grass is from Ogitor source code{ terrrainEditor( with texture blending )+grassEditor(pagedGeometry ) };
since its the best example of a working-bugfree terrain-managment/editing, i advice you to download it and take a look at the code...
if you want higher stuff like flowers, bushes and stuff- you can use mesh-instancing or better yet static-geometry( i assume you are using ogre 1.x )
there is also a plugin called pagedGeometry with optimized rendering techniqe( 2d billboards-mesh imposters, paging and lod levels ) just for grass...
lastly...all i learned on terrain and grass is from Ogitor source code{ terrrainEditor( with texture blending )+grassEditor(pagedGeometry ) };
since its the best example of a working-bugfree terrain-managment/editing, i advice you to download it and take a look at the code...
the woods are lovely dark and deep
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..
coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..
coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos
-
loath
- Platinum Sponsor

- Posts: 294
- Joined: Tue Jan 17, 2012 5:18 am
- x 67
Re: Changing the texture of a part of a terrain
there are a family of functions like Ogre::Terrain::getHeightAtTerrainPosition() that you can use to get the height at a position for the grass or meshes.
+1 on everything frostbyte says.
+1 on everything frostbyte says.
-
sinapse
- Gnoblar
- Posts: 11
- Joined: Sat Dec 19, 2015 11:57 am
Re: Changing the texture of a part of a terrain
@frostbyte
Ok, I was not familiar with blending in terrains. Now that you mentioned it I feel like being in the right path
thank you!
Ok, I was not familiar with blending in terrains. Now that you mentioned it I feel like being in the right path