2024-03-14 15:31:22 +01:00
|
|
|
|
2025-04-02 22:52:04 +02:00
|
|
|
function make_clone_run(kong: node_shader_t) {
|
2025-04-04 23:38:01 +02:00
|
|
|
node_shader_add_constant(kong, "clone_delta: float2", "_clone_delta");
|
2025-04-16 20:18:38 +02:00
|
|
|
node_shader_write_frag(kong, "var tex_coord_inp: float2 = gbuffer2[uint2((sp.xy + constants.clone_delta) * gbuffer_size)].ba;");
|
2024-03-14 15:31:22 +01:00
|
|
|
|
2025-04-05 22:22:43 +02:00
|
|
|
node_shader_write_frag(kong, "var texpaint_pack_sample: float3 = sample_lod(texpaint_pack_undo, texpaint_pack_undo_sampler, tex_coord_inp, 0.0).rgb;");
|
|
|
|
|
let base: string = "sample_lod(texpaint_undo, texpaint_undo_sampler, tex_coord_inp, 0.0).rgb";
|
2024-03-22 14:17:49 +01:00
|
|
|
let rough: string = "texpaint_pack_sample.g";
|
|
|
|
|
let met: string = "texpaint_pack_sample.b";
|
|
|
|
|
let occ: string = "texpaint_pack_sample.r";
|
2025-04-05 22:22:43 +02:00
|
|
|
let nortan: string = "sample_lod(texpaint_nor_undo, texpaint_nor_undo_sampler, tex_coord_inp, 0.0).rgb";
|
2024-03-22 14:17:49 +01:00
|
|
|
let height: string = "0.0";
|
|
|
|
|
let opac: string = "1.0";
|
2025-04-02 22:52:04 +02:00
|
|
|
node_shader_write_frag(kong, "var basecol: float3 = " + base + ";");
|
|
|
|
|
node_shader_write_frag(kong, "var roughness: float = " + rough + ";");
|
|
|
|
|
node_shader_write_frag(kong, "var metallic: float = " + met + ";");
|
|
|
|
|
node_shader_write_frag(kong, "var occlusion: float = " + occ + ";");
|
|
|
|
|
node_shader_write_frag(kong, "var nortan: float3 = " + nortan + ";");
|
|
|
|
|
node_shader_write_frag(kong, "var height: float = " + height + ";");
|
|
|
|
|
node_shader_write_frag(kong, "var mat_opacity: float = " + opac + ";");
|
|
|
|
|
node_shader_write_frag(kong, "var opacity: float = mat_opacity * brush_opacity;");
|
2024-03-14 15:31:22 +01:00
|
|
|
if (context_raw.material.paint_emis) {
|
2025-04-02 22:52:04 +02:00
|
|
|
node_shader_write_frag(kong, "var emis: float = 0.0;");
|
2024-03-14 15:31:22 +01:00
|
|
|
}
|
|
|
|
|
if (context_raw.material.paint_subs) {
|
2025-04-02 22:52:04 +02:00
|
|
|
node_shader_write_frag(kong, "var subs: float = 0.0;");
|
2024-03-14 15:31:22 +01:00
|
|
|
}
|
|
|
|
|
}
|