paint: cleanup

This commit is contained in:
luboslenco
2026-08-21 22:40:25 +02:00
parent cf8077c0a6
commit e20e5d6d5f
153 changed files with 5820 additions and 5819 deletions
+27 -27
View File
@@ -12,20 +12,20 @@ static mesh_object_t *render_envsphere_diffuse = NULL;
static node_shader_context_t *make_envsphere_shader(char *name, f32 roughness, f32 metallic) {
material_t *mat = ALLOC_INIT(material_t, {.name = name, .canvas = NULL});
shader_context_t *props = ALLOC_INIT(shader_context_t, {
.name = "overlay",
.depth_write = false,
.compare_mode = "always",
.cull_mode = "clockwise",
.vertex_elements = any_array_create_from_raw(
(void *[]){
ALLOC_INIT(vertex_element_t, {.name = "pos", .data = "short4norm"}),
ALLOC_INIT(vertex_element_t, {.name = "nor", .data = "short2norm"}),
ALLOC_INIT(vertex_element_t, {.name = "tex", .data = "short2norm"}),
},
3),
.color_attachments = any_array_create_from_raw((void *[]){"RGBA64"}, 1),
.depth_attachment = "NONE",
});
.name = "overlay",
.depth_write = false,
.compare_mode = "always",
.cull_mode = "clockwise",
.vertex_elements = any_array_create_from_raw(
(void *[]){
ALLOC_INIT(vertex_element_t, {.name = "pos", .data = "short4norm"}),
ALLOC_INIT(vertex_element_t, {.name = "nor", .data = "short2norm"}),
ALLOC_INIT(vertex_element_t, {.name = "tex", .data = "short2norm"}),
},
3),
.color_attachments = any_array_create_from_raw((void *[]){"RGBA64"}, 1),
.depth_attachment = "NONE",
});
node_shader_context_t *con = node_shader_context_create(mat, props);
node_shader_t *kong = node_shader_context_make_kong(con);
@@ -102,21 +102,21 @@ static mesh_object_t *create_envsphere_object(char *name, f32 roughness, f32 met
shader_context_load(con->data);
shader_data_t *sd = ALLOC_INIT(shader_data_t, {
.name = name,
.contexts = any_array_create_from_raw((void *[]){con->data}, 1),
});
.name = name,
.contexts = any_array_create_from_raw((void *[]){con->data}, 1),
});
material_context_t *mcon = ALLOC_INIT(material_context_t, {
.name = "overlay",
.bind_constants = any_array_create_from_raw((void *[]){}, 0),
.bind_textures = any_array_create_from_raw((void *[]){}, 0),
});
.name = "overlay",
.bind_constants = any_array_create_from_raw((void *[]){}, 0),
.bind_textures = any_array_create_from_raw((void *[]){}, 0),
});
material_context_load(mcon);
material_data_t *mat = ALLOC_INIT(material_data_t, {
.name = name,
.shader = "",
.contexts = any_array_create_from_raw((void *[]){mcon}, 1),
._ = ALLOC_INIT(material_data_runtime_t, {.uid = 0.0, .shader = sd}),
});
.name = name,
.shader = "",
.contexts = any_array_create_from_raw((void *[]){mcon}, 1),
._ = ALLOC_INIT(material_data_runtime_t, {.uid = 0.0, .shader = sd}),
});
mesh_object_t *obj = mesh_object_create(md, mat);
obj->base->name = name;
@@ -127,7 +127,7 @@ static mesh_object_t *create_envsphere_object(char *name, f32 roughness, f32 met
static void render_envsphere_init() {
render_envsphere_metallic = create_envsphere_object("render_envsphere_metallic", 0.0, 1.0);
render_envsphere_diffuse = create_envsphere_object("render_envsphere_diffuse", 0.9, 0.0);
render_envsphere_diffuse = create_envsphere_object("render_envsphere_diffuse", 0.9, 0.0);
}
void render_envsphere() {