Custom Terrain

Everything related to 3D programming
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Custom Terrain

Post by Samuel »

Ogre 1.9 got some nice terrain updates which might take care of a few of your issues.
I'm not sure if they will be made available in Purebasic right away though.
Alexi wrote: What's about the performance? Will a custom terrain-mesh rendered slower, faster or without any difference. How are layers are actually done on terrain.
If you use shaders you should have a similar performance.
From what I've seen a terrain's layers are usually built with alpha blending. A basic alpha blend can be done in a material script, but for multiple layer support
you will need to use a shader.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Custom Terrain

Post by Samuel »

Alexi wrote:But how these layers get filled with this resolution. Is there a buffer bitmap in size of a tile to determine the alpha-values?
It's pretty easy to use alpha blending in a material script.
First you need to add a base texture. Then you use an alpha map to put a layer of texture on top of the base.
This process can be repeated for however many layers you want.

This is a basic terrain mesh with 3 texture layers.
Image

Here's the source if you'd like to fiddle with it. If you have any questions just ask.
Alpha Splatting.zip
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Custom Terrain

Post by Samuel »

Alexi wrote: btw: can we use different UV-Coords for materials? I would use this alpha-splatting method to smooth egdes on a mesh with a simple from top projection. :D
I'm not sure I understood the question, could you please elaborate?
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 171
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Custom Terrain

Post by zxretrosoft »

Samuel wrote:
Alexi wrote:But how these layers get filled with this resolution. Is there a buffer bitmap in size of a tile to determine the alpha-values?
It's pretty easy to use alpha blending in a material script.
First you need to add a base texture. Then you use an alpha map to put a layer of texture on top of the base.
This process can be repeated for however many layers you want.

This is a basic terrain mesh with 3 texture layers.
Image

Here's the source if you'd like to fiddle with it. If you have any questions just ask.
Alpha Splatting.zip
Hello Samuel,
OK, it's very nice! Perfect!

I need help, please, this is my first 3D experiment.
I need exactly what you did. But so that I could curl terrain by value.

Eg. as follows:
http://www.imgshare.tym.sk/images/odazh ... lcndfj.png

Spacing between peaks can be on a line or accidental.

But as the peaks get there?

Thanks in advance for any tip! And very very sorry for the horrible English! :oops:
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Custom Terrain

Post by Samuel »

zxretrosoft wrote: I need exactly what you did. But so that I could curl terrain by value.
Are you referring to terrain generation by heightmaps?
If you're unsure of what a heightmap is take a look at this page http://en.wikipedia.org/wiki/Heightmap.

It's basically a grayscale image that you use to calculate the height of each vertex on the terrain.

If this is what your looking for I do have an example showing how to create terrains with heightmaps.
Just let me know if you want it and I'll post it when I get a little free time.
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 171
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Custom Terrain

Post by zxretrosoft »

Samuel wrote:
zxretrosoft wrote: I need exactly what you did. But so that I could curl terrain by value.
Are you referring to terrain generation by heightmaps?
If you're unsure of what a heightmap is take a look at this page http://en.wikipedia.org/wiki/Heightmap.

It's basically a grayscale image that you use to calculate the height of each vertex on the terrain.

If this is what your looking for I do have an example showing how to create terrains with heightmaps.
Just let me know if you want it and I'll post it when I get a little free time.

Thanks for the answer, Samuel!

Yes, that's exactly what I'm looking for. Thank you in advance :wink:
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Custom Terrain

Post by Samuel »

I created a new topic for the terrain generator. This way it will be easier to find for others who might be interested in it.

Link to terrain generator.
Post Reply