kong fixes

This commit is contained in:
luboslenco
2025-04-11 17:40:54 +02:00
parent bdb6c0f461
commit 01b739bab8
9 changed files with 30 additions and 30 deletions
+3 -3
View File
@@ -39,9 +39,9 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
node_shader_add_constant(kong, "WVP: float4x4", "_world_view_proj_matrix");
let lid: i32 = project_layers[0].id;
node_shader_add_texture(kong, "texpaint_vert", "_texpaint_vert" + lid);
node_shader_add_texture(kong, "texpaint_vert", "_texpaint_vert" + lid, true);
node_shader_add_constant(kong, "texpaint_vert_size: float2", "_size(texpaint_vert" + lid + ")");
node_shader_write_vert(kong, "var meshpos: float3 = sample_lod(texpaint_vert, texpaint_vert_sampler, int2(gl_VertexID % constants.texpaint_vert_size.x, gl_VertexID / constants.texpaint_vert_size.y), 0).xyz;");
node_shader_write_vert(kong, "var meshpos: float3 = sample_lod(texpaint_vert, texpaint_vert_sampler, int2(vertex_id() % constants.texpaint_vert_size.x, vertex_id() / constants.texpaint_vert_size.y), 0).xyz;");
// + input.pos.xyz * 0.000001
node_shader_write_vert(kong, "output.pos = constants.WVP * float4(meshpos.xyz, 1.0);");
@@ -52,7 +52,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
node_shader_add_constant(kong, "N: float3x3", "_normal_matrix");
node_shader_add_out(kong, "wnormal: float3");
node_shader_write_attrib_vert(kong, "var base_vertex0: int = gl_VertexID - (gl_VertexID % 3);");
node_shader_write_attrib_vert(kong, "var base_vertex0: int = vertex_id() - (vertex_id() % 3);");
node_shader_write_attrib_vert(kong, "var base_vertex1: int = base_vertex0 + 1;");
node_shader_write_attrib_vert(kong, "var base_vertex2: int = base_vertex0 + 2;");
node_shader_write_attrib_vert(kong, "var meshpos0: float3 = sample_lod(texpaint_vert, texpaint_vert_sampler, int2(base_vertex0 % constants.texpaint_vert_size.x, base_vertex0 / constants.texpaint_vert_size.y), 0).xyz;");