perlin noise

This commit is contained in:
onezplpl 2024-07-13 11:18:12 -04:00
parent 48ecd8d9e8
commit 186ea5f204
No known key found for this signature in database
GPG key ID: 7EC026A136F9EEC3
7 changed files with 279 additions and 61 deletions

33
const.h
View file

@ -1,15 +1,25 @@
#ifndef V_CONST_H
#define V_CONST_H
#include "linmath.h"
typedef struct Vertex {
float pos[3];
} Vertex;
vec3 pos;
} Vertex;
#define CHUNK_LENGTH 64 //32
#define CHUNK_RADIUS_H 8
#define CHUNK_RADIUS_V 4
typedef struct VertexI {
int pos[3];
} VertexI;
typedef struct Vertex2 {
vec2 pos;
} Vertex2;
#define CHUNK_LENGTH 16
#define CHUNK_RADIUS_H 4//8
#define CHUNK_RADIUS_V 4 //4
#define CTRI_ALL BLOCK_ALL * 18 * sizeof(Vertex)
#define TEXT_GAP_H 1 / 3.0
#define TEXT_GAP_V 1 / 1.0
@ -18,5 +28,16 @@ typedef struct Vertex {
#define CHUNK_ALL CHUNK_DIAMETER_H *CHUNK_DIAMETER_H *CHUNK_DIAMETER_V
#define BLOCK_ALL CHUNK_LENGTH *CHUNK_LENGTH *CHUNK_LENGTH
#define CBLOCK_ALL BLOCK_ALL *CHUNK_ALL
#define CBUF_ALL 25
#define CTRI_ALL CBLOCK_ALL * 18 * sizeof(Vertex)
typedef struct Chunk {
unsigned char exists;
unsigned int x;
unsigned int y;
unsigned int z;
unsigned int blocks[BLOCK_ALL];
} Chunk;
#endif