diff --git a/paint/sources/config.c b/paint/sources/config.c index e45612b4..6074046e 100644 --- a/paint/sources/config.c +++ b/paint/sources/config.c @@ -112,7 +112,6 @@ void config_save() { json_encode_i32("pathtrace_mode", g_config->pathtrace_mode); json_encode_bool("pressure_radius", g_config->pressure_radius); json_encode_f32("pressure_sensitivity", g_config->pressure_sensitivity); - json_encode_f32("displace_strength", g_config->displace_strength); json_encode_i32("layer_res", g_config->layer_res); json_encode_bool("brush_live", g_config->brush_live); json_encode_bool("node_previews", g_config->node_previews); @@ -224,7 +223,6 @@ void config_init() { #endif g_config->camera_upside_down = false; g_config->zoom_direction = ZOOM_DIRECTION_VERTICAL; - g_config->displace_strength = 0.0; g_config->wrap_mouse = false; g_config->camera_pivot = CAMERA_PIVOT_CENTER; g_config->camera_controls = CAMERA_CONTROLS_ORBIT; diff --git a/paint/sources/functions.h b/paint/sources/functions.h index 2d3b7a57..f62778eb 100644 --- a/paint/sources/functions.h +++ b/paint/sources/functions.h @@ -558,7 +558,6 @@ void make_material_restore_paint_material(); parse_node_preview_result_t *make_material_parse_node_preview_material(ui_node_t *node, ui_node_canvas_t *group, ui_node_t_array_t *parents); void make_material_parse_brush(); char *make_material_blend_mode(node_shader_t *kong, i32 blending, char *cola, char *colb, char *opac); -f32 make_material_get_displace_strength(); void ui_viewnodes_init(); void ui_viewnodes_on_node_remove(ui_node_t *n); void ui_viewnodes_on_node_changed(ui_node_t *n); diff --git a/paint/sources/render/make_depth.c b/paint/sources/render/make_depth.c index 0801c74c..a33639ba 100644 --- a/paint/sources/render/make_depth.c +++ b/paint/sources/render/make_depth.c @@ -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);"); // { diff --git a/paint/sources/render/make_material.c b/paint/sources/render/make_material.c index ed7eec20..efcf56c9 100644 --- a/paint/sources/render/make_material.c +++ b/paint/sources/render/make_material.c @@ -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; diff --git a/paint/sources/render/make_mesh.c b/paint/sources/render/make_mesh.c index 624a116f..d322f04e 100644 --- a/paint/sources/render/make_mesh.c +++ b/paint/sources/render/make_mesh.c @@ -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;"); diff --git a/paint/sources/types.h b/paint/sources/types.h index 61340804..02c59045 100644 --- a/paint/sources/types.h +++ b/paint/sources/types.h @@ -124,7 +124,6 @@ typedef struct config { i32 pathtrace_mode; bool pressure_radius; // Pen pressure controls f32 pressure_sensitivity; - f32 displace_strength; i32 layer_res; bool brush_live; bool node_previews; diff --git a/paint/sources/ui/box_preferences.c b/paint/sources/ui/box_preferences.c index fcdb8094..f8096780 100644 --- a/paint/sources/ui/box_preferences.c +++ b/paint/sources/ui/box_preferences.c @@ -696,14 +696,6 @@ void box_preferences_viewport_tab() { camera_object_build_proj(cam, -1.0); } - ui_handle_t *h_disp = ui_handle(__ID__); - h_disp->f = g_config->displace_strength; - g_config->displace_strength = ui_slider(h_disp, tr("Displacement Strength"), 0.0, 10.0, true, 100.0, true, UI_ALIGN_RIGHT, true); - if (h_disp->changed) { - g_context->ddirty = 2; - make_material_parse_mesh_material(); - } - ui_text(tr(".cube LUT"), UI_ALIGN_LEFT, 0x00000000); f32_array_t *lut_ar = f32_array_create_from_raw( (f32[]){