Giter Club home page Giter Club logo

Comments (6)

Auburn avatar Auburn commented on June 20, 2024

In the NoiseTool the default setting is any value >= 0 is solid

You can see the generated min/max values and change the isosurface value in the debug window

from fastnoise2.

Filocava99 avatar Filocava99 commented on June 20, 2024

Mmm that's weird cause I am getting a very weird result (https://prnt.sc/XPb80X4USDDK). The max value that I get from the NoiseTool is a 0.02, almost all the values are negative.
For the sampling I am using fnGenSingle3D and iterating each block of a cube (16x16x256) , it's not efficient but I'm just doing some tests.
Is there any detailed documentation for the parameters of the Gen* functions (grid, single, etc)?

FastNoise2.INSTANCE.fnGenSingle3D(caveNoise, chunkX*16+x.toFloat(), y.toFloat(), chunkZ*16+z.toFloat(), seed)
Just for reference, I made a binding using JNA, it works fine but maybe I understood the parameters wrong.

from fastnoise2.

Auburn avatar Auburn commented on June 20, 2024

Sorry I got that the wrong way round, value >= 0 is air.

Max is only 0.02 to keep the cave sizes smaller, you can change this by adjusting the Subtract node.

from fastnoise2.

Filocava99 avatar Filocava99 commented on June 20, 2024

Hi, thanks for replying so quickly.
I tried that but the result it's the inverse of what you see in the picture (the holes are now filled and viceversa).
At this point I am wondering if I am using the generator functions correctly.

Given a cube X * Y * Z of size 1625616, running the following code

for(int x = 0; x < 16; x++){
  for(int y = 0; y < 256; y++) {
    for(int z = 0; z < 16'; z++) {
      bool isCave = fnGenSingle3D(caveNoise, x, y, z, seed) >= 0f
      ... store result ...
    }
  }
}

it should give me a coherent list of coordinates that form up a cave.

I also tried a simple terrain generation tree and instead of sampling each 2D coordinate I tried using GenUniformGrid2D; I tried generating two chunks, which means I run the following code:

int chunkX = 0, chunkZ = 0;
float[] chunk1 = fnGenUniformGrid3D(chunkNoise, arrayPointer, chunkX*16, 0, chunkZ*16,16, 256, 16, 0.1f, seed, null)
int chunkX = 1, chunkZ = 0;
float[] chunk2 = fnGenUniformGrid3D(chunkNoise, arrayPointer, chunkX*16, 0, chunkZ*16,16, 256, 16, 0.1f, seed, null)

In that case the surface of the terrain is coherent (meaning it doesn't make any weird jump) only inside the same chunk, making highly noticeble the connection between the two chunks.
When using UniformGrid how do I specify the steps it makes with the coordinates? If x is 0 and xSize is 16, what does it use a step for reaching the required size? 1? Or does it use the frequency parameter?

I also wanted to describe the issue with the terrain generation cause everything is problably related to how I am using the APIs given I couldn't find any documentation.

from fastnoise2.

Auburn avatar Auburn commented on June 20, 2024

It's likely caused by you indexing the noise array using the incorrect axis, in your first code block above your for loops go x, y, z when it should be z, y, x. Have a look at the example code on the wiki.

As for the cave noise, I'd guess the issue is somewhere else in your code, what you have posted looks correct.

from fastnoise2.

Filocava99 avatar Filocava99 commented on June 20, 2024

Got the cave noise to work using GenUniformGrid instead of GenSingle3D. Weird tough

from fastnoise2.

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.