More gles fixes

This commit is contained in:
luboslenco
2024-11-14 23:12:30 +01:00
parent a199eacd84
commit 37b0b01fa5
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -143,7 +143,7 @@ function make_mesh_preview_run(data: material_t, matcon: material_context_t): no
node_shader_write(frag, "n /= (abs(n.x) + abs(n.y) + abs(n.z));"); node_shader_write(frag, "n /= (abs(n.x) + abs(n.y) + abs(n.z));");
node_shader_write(frag, "n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy);"); node_shader_write(frag, "n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy);");
// uint matid = 0; // uint matid = uint(0);
if (decal) { if (decal) {
node_shader_write(frag, "frag_color[0] = vec4(n.x, n.y, roughness, pack_f32_i16(metallic, uint(0)));"); // metallic/matid node_shader_write(frag, "frag_color[0] = vec4(n.x, n.y, roughness, pack_f32_i16(metallic, uint(0)));"); // metallic/matid
+1 -1
View File
@@ -149,7 +149,7 @@ function make_mesh_preview_run(data: material_t, matcon: material_context_t): no
node_shader_write(frag, "n /= (abs(n.x) + abs(n.y) + abs(n.z));"); node_shader_write(frag, "n /= (abs(n.x) + abs(n.y) + abs(n.z));");
node_shader_write(frag, "n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy);"); node_shader_write(frag, "n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy);");
// uint matid = 0; // uint matid = uint(0);
if (decal) { if (decal) {
node_shader_write(frag, "frag_color[0] = vec4(n.x, n.y, roughness, pack_f32_i16(metallic, uint(0)));"); // metallic/matid node_shader_write(frag, "frag_color[0] = vec4(n.x, n.y, roughness, pack_f32_i16(metallic, uint(0)));"); // metallic/matid
+1 -1
View File
@@ -15,7 +15,7 @@ void main() {
float occlusion = 1.0; float occlusion = 1.0;
n /= (abs(n.x) + abs(n.y) + abs(n.z)); n /= (abs(n.x) + abs(n.y) + abs(n.z));
n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy); n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy);
uint matid = 0; uint matid = uint(0);
frag_color[0] = vec4(n.xy, roughness, pack_f32_i16(metallic, matid)); frag_color[0] = vec4(n.xy, roughness, pack_f32_i16(metallic, matid));
frag_color[1] = vec4(basecol, occlusion); frag_color[1] = vec4(basecol, occlusion);
vec2 posa = (wvpposition.xy / wvpposition.w) * 0.5 + 0.5; vec2 posa = (wvpposition.xy / wvpposition.w) * 0.5 + 0.5;
+1 -1
View File
@@ -16,7 +16,7 @@ void main() {
float occlusion = 1.0; float occlusion = 1.0;
n /= (abs(n.x) + abs(n.y) + abs(n.z)); n /= (abs(n.x) + abs(n.y) + abs(n.z));
n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy); n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy);
uint matid = 0; uint matid = uint(0);
frag_color[0] = vec4(n.xy, roughness, pack_f32_i16(metallic, matid)); frag_color[0] = vec4(n.xy, roughness, pack_f32_i16(metallic, matid));
frag_color[1] = vec4(basecol, occlusion); frag_color[1] = vec4(basecol, occlusion);
vec2 posa = (wvpposition.xy / wvpposition.w) * 0.5 + 0.5; vec2 posa = (wvpposition.xy / wvpposition.w) * 0.5 + 0.5;