paint: fix displacement strength option

This commit is contained in:
luboslenco
2026-04-18 21:02:33 +02:00
parent beba701aba
commit 1bc79c5bad
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ node_shader_context_t *make_depth_run(material_t *data, material_context_t *matc
// }
// }
// }
// node_shader_write_vert(kong, string("output.wposition += wnormal * float3(height, height, height) * float3(%s, %s, %s);",
// 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)));
// }
+1 -1
View File
@@ -515,7 +515,7 @@ char *make_material_blend_mode_mask(node_shader_t *kong, i32 blending, char *col
f32 make_material_get_displace_strength() {
vec4_t sc = context_main_object()->base->transform->scale;
return g_config->displace_strength * 0.02 * sc.x;
return g_config->displace_strength * 0.1 * sc.x;
}
void make_material_parse_depth_material() {
+1 -1
View File
@@ -144,7 +144,7 @@ node_shader_context_t *make_mesh_run(material_t *data, i32 layer_pass) {
}
}
}
node_shader_write_vert(kong, string("output.wposition += wnormal * float3(height, height, height) * float3(%s, %s, %s);",
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)));
}
+2 -2
View File
@@ -289,9 +289,9 @@ void parser_material_finalize(node_shader_context_t *con) {
node_shader_write_attrib_vert(kong, "output.wnormal = constants.N * float3(input.nor.xy, input.pos.w);");
node_shader_write_attrib_frag(kong, "var n: float3 = normalize(input.wnormal);");
}
else if (kong->vert_n) {
if (kong->vert_n) {
node_shader_add_constant(kong, "N: float3x3", "_normal_matrix");
node_shader_write_attrib_vert(kong, "var wnormal: float3 = normalize(constants.N * float3(input.nor.xy, input.pos.w));");
node_shader_write_attrib_vert(kong, "var vert_wnormal: float3 = normalize(constants.N * float3(input.nor.xy, input.pos.w));");
}
if (kong->frag_nattr) {
node_shader_add_out(kong, "nattr: float3");