- Home /
Problem with blending two terrains together on an edge.
Currently I can grab the data from my neighbor with no issues, but when I try to blend down from my mountains to 0f height I just get a straight fall off instead of anything that looks nicer. Currently I am using the following line to blend each x,y position:
void blend(float [,] map, int x,int y)
{
float temp = (map [y - 1, x] + map [y + 1, x] + map [y, x - 1] + map [y, x + 1])/4;
map [y, x] = temp;
}
My results are unexpected I am thinking I probably need to use sin or something similar to get the terrain to not chop mountains in half. I was wondering if anyone had some insight into what approach I should use in blending the seams nicely.
The fun is in the journey and not the destination. I know about the asset store, but prefer to code my own stuff. I am currently thinking that using a sin wave off the copied edge might yield acceptable results. Especially if I took the blend area and divided it up over the first 1/2pi while using the ground height of the edge of the buffer as a lower bound(or upper bound if it was higher) abs(difference) sin or cos depending on height data. I am just curious if this is a good approach or if someone else would have a better one.
I didn't even accept the answer as it isn't even an answer these forums are rigged junk.
No need to get hostile. One never knows the needs of the person behind the question. If you are part of a gameDev $$anonymous$$m and need to balance time/opportunity cost vs a COTS solution very reasonably priced, or if this is as you say a journey and you want to puzzle it out with time not being a limiting factor. I also referenced that Asset because, as I'm sure you'll find with Searching, it's simply the solution I've seen for this common question.
Answer by getyour411 · Aug 11, 2015 at 11:05 PM
The only satisfactory answer seen here that I know of is: buy StitchScape from Asset Store
Your answer
Follow this Question
Related Questions
Edit Terrain at runtime 1 Answer
Terrrain Texturing with solid colors,Terrain texturing with solid color tile 0 Answers
Distribute terrain in zones 3 Answers
copy smaller size terrain's data, and seet the heights on bigger Terrain at click position 0 Answers
[BEGINNER] Generating Terrain with Perlin noise flat and nothing happens ? 1 Answer