Fix mesh context attachments

This commit is contained in:
luboslenco
2025-06-11 12:11:40 +02:00
parent d7a5931b73
commit 9017e159e1
4 changed files with 9 additions and 8 deletions
+3 -2
View File
@@ -62,7 +62,7 @@ fun pack_f32_i16(f: float, i: uint): float {
return 0.062504762 * f + 0.062519999 * float(i);
}
fun mesh_posnor_frag(input: vert_out): float4[2] {
fun mesh_posnor_frag(input: vert_out): float4[3] {
var basecol: float3 = float3(0.8, 0.8, 0.8);
var roughness: float = 0.25;
var metallic: float = 0.0;
@@ -78,9 +78,10 @@ fun mesh_posnor_frag(input: vert_out): float4[2] {
}
// var matid: uint = 0;
var matid: uint = uint(0.0);
var color: float4[2];
var color: float4[3];
color[0] = float4(n.xy, roughness, pack_f32_i16(metallic, matid));
color[1] = float4(basecol, occlusion);
color[2] = float4(0.0, 0.0, 0.0, 0.0);
return color;
}
+3 -2
View File
@@ -66,7 +66,7 @@ fun pack_f32_i16(f: float, i: uint): float {
return 0.062504762 * f + 0.062519999 * float(i);
}
fun mesh_posnortex_frag(input: vert_out): float4[2] {
fun mesh_posnortex_frag(input: vert_out): float4[3] {
var n: float3 = normalize(input.wnormal);
var basecol: float3 = float3(0.2, 0.2, 0.2) + input.tex.x * 0.0000001; // keep tex_coord
var roughness: float = 0.4;
@@ -84,9 +84,10 @@ fun mesh_posnortex_frag(input: vert_out): float4[2] {
// var matid: uint = 0;
var matid: uint = uint(0.0);
var color: float4[2];
var color: float4[3];
color[0] = float4(n.xy, roughness, pack_f32_i16(metallic, matid));
color[1] = float4(basecol, occlusion);
color[2] = float4(0.0, 0.0, 0.0, 0.0);
return color;
}