paint: cleanup

This commit is contained in:
luboslenco
2026-07-11 20:09:10 +02:00
parent 748e6f87b4
commit a1234767bd
7 changed files with 0 additions and 82 deletions
-32
View File
@@ -26,38 +26,6 @@ node_shader_context_t *make_depth_run(material_t *data, material_context_t *matc
node_shader_add_constant(kong, "VP: float4x4", "_view_proj_matrix");
// f32 displace_strength = make_material_get_displace_strength();
// if (make_material_height_used && displace_strength > 0.0) {
// kong->vert_n = true;
// node_shader_write_vert(kong, "var height: float = 0.0;");
// i32 num_layers = 0;
// for (i32 i = 0; i < g_project->_->layers->length; ++i) {
// slot_layer_t *l = g_project->_->layers->buffer[i];
// if (!slot_layer_is_visible(l) || !l->paint_height || !slot_layer_is_layer(l)) {
// continue;
// }
// if (num_layers > 16) {
// break;
// }
// num_layers++;
// node_shader_add_texture(kong, string("texpaint_pack_vert%s", i32_to_string(l->id)), string("_texpaint_pack_vert%s", i32_to_string(l->id)));
// node_shader_write_vert(kong, string("height += sample_lod(texpaint_pack_vert%s, sampler_linear, input.tex, 0.0).a;", i32_to_string(l->id)));
// slot_layer_t_array_t *masks = slot_layer_get_masks(l, true);
// if (masks != NULL) {
// for (i32 i = 0; i < masks->length; ++i) {
// slot_layer_t *m = masks->buffer[i];
// if (!slot_layer_is_visible(m)) {
// continue;
// }
// node_shader_add_texture(kong, string("texpaint_vert%s", i32_to_string(m->id)), string("_texpaint_vert%s", i32_to_string(m->id)));
// node_shader_write_vert(kong, string("height *= sample_lod(texpaint_vert%s, sampler_linear, input.tex, 0.0).r;", i32_to_string(m->id)));
// }
// }
// }
// node_shader_write_vert(kong, string("output.wposition += vert_wnormal * float3(height, height, height) * float3(%s, %s, %s);",
// f32_to_string(displace_strength), f32_to_string(displace_strength), f32_to_string(displace_strength)));
// }
node_shader_write_vert(kong, "output.pos = constants.VP * float4(output.wposition.xyz, 1.0);");
// {
-5
View File
@@ -510,11 +510,6 @@ char *make_material_blend_mode(node_shader_t *kong, i32 blending, char *cola, ch
}
}
f32 make_material_get_displace_strength() {
vec4_t sc = context_main_object()->base->transform->scale;
return g_config->displace_strength * 0.1 * sc.x;
}
void make_material_parse_depth_material() {
material_data_t *m = g_project->_->materials->buffer[0]->data;
-33
View File
@@ -114,39 +114,6 @@ node_shader_context_t *make_mesh_run(material_t *data, i32 layer_pass) {
kong->frag_wposition = true;
i32 texture_count = 0;
f32 displace_strength = make_material_get_displace_strength();
if (make_material_height_used && displace_strength > 0.0) {
kong->vert_n = true;
node_shader_write_vert(kong, "var height: float = 0.0;");
i32 num_layers = 0;
for (i32 i = 0; i < g_project->_->layers->length; ++i) {
slot_layer_t *l = g_project->_->layers->buffer[i];
if (!slot_layer_is_visible(l) || !l->paint_height || !slot_layer_is_layer(l)) {
continue;
}
if (num_layers > 16) {
break;
}
num_layers++;
texture_count++;
node_shader_add_texture(kong, string("texpaint_pack_vert%s", i32_to_string(l->id)), string("_texpaint_pack_vert%s", i32_to_string(l->id)));
node_shader_write_vert(kong, string("height += sample_lod(texpaint_pack_vert%s, sampler_linear, input.tex, 0.0).a;", i32_to_string(l->id)));
slot_layer_t_array_t *masks = slot_layer_get_masks(l, true);
if (masks != NULL) {
for (i32 i = 0; i < masks->length; ++i) {
slot_layer_t *m = masks->buffer[i];
if (!slot_layer_is_visible(m)) {
continue;
}
texture_count++;
node_shader_add_texture(kong, string("texpaint_vert%s", i32_to_string(m->id)), string("_texpaint_vert%s", i32_to_string(m->id)));
node_shader_write_vert(kong, string("height *= sample_lod(texpaint_vert%s, sampler_linear, input.tex, 0.0).r;", i32_to_string(m->id)));
}
}
}
node_shader_write_vert(kong, string("output.wposition += vert_wnormal * float3(height, height, height) * float3(%s, %s, %s);",
f32_to_string(displace_strength), f32_to_string(displace_strength), f32_to_string(displace_strength)));
}
node_shader_write_vert(kong, "output.pos = constants.VP * float4(output.wposition.xyz, 1.0);");
node_shader_write_vert(kong, "output.tex_coord = input.tex;");