better lighting

This commit is contained in:
asrael 2026-01-31 09:31:17 -06:00
parent 805a2713a3
commit 6ed4e17065
75 changed files with 6417 additions and 3667 deletions

48
src/vxl/pxl8_vxl_render.h Normal file
View file

@ -0,0 +1,48 @@
#pragma once
#include "pxl8_mesh.h"
#include "pxl8_types.h"
#include "pxl8_vxl.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct pxl8_vxl_render_state {
bool wireframe;
} pxl8_vxl_render_state;
pxl8_vxl_render_state* pxl8_vxl_render_state_create(void);
void pxl8_vxl_render_state_destroy(pxl8_vxl_render_state* state);
void pxl8_vxl_set_wireframe(pxl8_vxl_render_state* state, bool wireframe);
typedef struct pxl8_vxl_mesh_config {
bool ambient_occlusion;
bool vertex_heights;
f32 ao_strength;
f32 texture_scale;
i32 chunk_x;
i32 chunk_y;
i32 chunk_z;
u64 seed;
} pxl8_vxl_mesh_config;
#define PXL8_VXL_MESH_CONFIG_DEFAULT ((pxl8_vxl_mesh_config){ \
.ambient_occlusion = true, \
.vertex_heights = true, \
.ao_strength = 0.2f, \
.texture_scale = 1.0f, \
.chunk_x = 0, \
.chunk_y = 0, \
.chunk_z = 0, \
.seed = 12345 \
})
pxl8_mesh* pxl8_vxl_build_mesh(const pxl8_vxl_chunk* chunk,
const pxl8_vxl_chunk** neighbors,
const pxl8_vxl_block_registry* registry,
const pxl8_vxl_mesh_config* config);
#ifdef __cplusplus
}
#endif