Code Monkey home page Code Monkey logo

Comments (10)

Eldemarkki avatar Eldemarkki commented on May 21, 2024 1

Yeah, the blend is very difficult. I remember once (like maybe a year ago) trying a climate based biome system, where the inputs are 2 noise maps, one for precipitation and one for temperature. Here's picture of what I mean:

In that experiment, I think I could generate the biomes nicely, but blending the heights was the biggest problem which I never managed to solve.

from marching-cubes-terrain.

IPotatoCouch avatar IPotatoCouch commented on May 21, 2024 1

That looks really nice! What if you blend the biomes map like this? Each biome has its own noise so once the map is blended so as the noise maps. Would that be possible?

BiomesBlend
BlendedBiomes

This is a bit ugly example, but does this even make sense? In my head this sounds logical yet I have no idea how to accomplish this.. :D

from marching-cubes-terrain.

IPotatoCouch avatar IPotatoCouch commented on May 21, 2024 1

Biomes map would almost act like a mask for noise maps, if the biomes map is 'blurred' you would get a smooth transition

from marching-cubes-terrain.

Eldemarkki avatar Eldemarkki commented on May 21, 2024 1

I looked for the repository about the climate based biomes (like in the diagram in the previous comment) and found it! I made a few changes to fix the blending, and made the repository public. Here it is: https://github.com/Eldemarkki/TerrainBiomeGenerator.

This is what it looks like with blending=0:
kuva

And this is with blending=3:
kuva

It's not perfect, the colours are quite sharp looking at some places, and it is not very realistic as there are multiple places where it goes from desert to tundra, but that can be tweaked quite easily.

And in case it wasn't obvious, that is not using marching cubes.

The blending is done by just taking the average height around the sampling point. The transition from any biome to ocean is not blended, because I don't want the ocean to suddenly go upwards near the transition.

from marching-cubes-terrain.

Eldemarkki avatar Eldemarkki commented on May 21, 2024 1

I'm not really sure. If I end up implementing it, it most likely will not be in the main repository, but in the TerrainBiomeGenerator repository.

from marching-cubes-terrain.

Eldemarkki avatar Eldemarkki commented on May 21, 2024

This solution that I quickly thought up of would only work with 2 biomes, but maybe someone smarter than me knows how to extend it to more than 2. I haven't spent much time on this.

First, create 2 noise functions; 1 for biome A called GetA(x, z), and one for biome B called GetB(x, z). Those functions would generate the height for the biomes. So GetA() could for example be an infinite plains biome, and GetB() and infinite mountains biome.

Then, have a third noise function representing the blend. For any given point (x, z), the height of point (x, z) would be y = Lerp(GetA(x, z), GetB(x, z), GetBlend(x, z)). GetA() and GetB() representing the noise functions of A and B. GetBlend() would tell how much to blend the biomes: 0 would be completely biome A, and 1 would be completely biome B.

I would rather do something like this, than a height-based biome, as height-based gives rings of biomes and I don't really like the look of that

from marching-cubes-terrain.

IPotatoCouch avatar IPotatoCouch commented on May 21, 2024

Thanks for the tip! This sounds like a good solution. For multiple biomes I was thinking would it be possible to generate a biomes map, something like this maybe.

BiomesMap

Each biome has its own color, so with a map like this it would be easy to determine where each biome is located. One issue is blending biomes together. Maybe even make biomes bleed into each other, so it would give more realistic results. I'm not smart enough to figure this out tho..

from marching-cubes-terrain.

Eldemarkki avatar Eldemarkki commented on May 21, 2024

I think that's a great idea! I'll post something here if I manage to think of some implementation. It's definitely a hard problem.

from marching-cubes-terrain.

IPotatoCouch avatar IPotatoCouch commented on May 21, 2024

Awesome thank you! 🙂 Been scratching my head for hours, it's quite a task.. A bit too much for my brain too handle 😄

from marching-cubes-terrain.

IPotatoCouch avatar IPotatoCouch commented on May 21, 2024

Really nice! This works pretty well! Will you be implementing this approach to Marching-Cubes-Terrain project as well? 🙂

from marching-cubes-terrain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.