how is that smoother version going? I'm really interested in it, I am reading alot of stuff about shaders meanwhile to add some stuff to it later. Lighting and stuff like that (at least I'm good with those parts that rely heavily on vectormath)

Edit:
I played around with the code a bit to get smoothing working.

I only needed to edit the pixel function's "if" statement's calculations like this:
Quote:
if(Height < 32) Color = tex2D(SandSampler, InTex);
else if(Height < 42) Color = lerp(tex2D(SandSampler,InTex), tex2D(GrassSampler,InTex), (Height-32)/10);
else if(Height < 75) Color = tex2D(GrassSampler, InTex);
else if(Height < 85) Color = lerp(tex2D(GrassSampler,InTex), tex2D(RockSampler,InTex), (Height-75)/10);
else if(Height < 120) Color = tex2D(RockSampler, InTex);
else if(Height < 130) Color = lerp(tex2D(RockSampler,InTex), tex2D(SnowSampler,InTex), (Height-120)/10);
else Color = tex2D(SnowSampler, InTex);


Preview:
http://www.youtube.com/watch?v=gjGJeNkAO3M

Note: I used a height of 10 for the smoothing between each layer (mainly for mathematical conveniance).

Note2: In all of the "shader versions" we posted previously you have probably noticed that the original lighting and shadows have dissapeared. Entities have their default shader which does things like that. But now that we are using our own, it dosn't use that default shader and since we are not takng those things into acount, any lighting or shadows have dissapeared from our terrains... I will modify the current code to calculate shadows and lighting and repost the final version when it is done.

Last edited by Carlos3DGS; 11/07/11 03:26.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1