Fix cast
This commit is contained in:
@@ -785,7 +785,7 @@ class MaterialBuilder {
|
||||
frag.write('n /= (abs(n.x) + abs(n.y) + abs(n.z));');
|
||||
frag.write('n.xy = n.z >= 0.0 ? n.xy : octahedronWrap(n.xy);');
|
||||
// uint matid = 0;
|
||||
frag.write('fragColor[0] = vec4(n.x, n.y, roughness, packFloatInt16(metallic, 0));'); // metallic/matid
|
||||
frag.write('fragColor[0] = vec4(n.x, n.y, roughness, packFloatInt16(metallic, uint(0)));'); // metallic/matid
|
||||
frag.write('fragColor[1] = vec4(basecol.r, basecol.g, basecol.b, packFloat2(occlusion, 1.0));'); // occ/spec
|
||||
frag.write('fragColor[2] = vec4(0.0, 0.0, 0.0, 0.0);'); // veloc
|
||||
|
||||
@@ -935,7 +935,7 @@ class MaterialBuilder {
|
||||
|
||||
if (Context.tool == ToolColorId) {
|
||||
frag.add_uniform('sampler2D texcolorid', '_texcolorid');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));'); // met/rough
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));'); // met/rough
|
||||
frag.write('vec3 idcol = pow(textureLod(texcolorid, texCoord, 0.0).rgb, vec3(2.2, 2.2, 2.2));');
|
||||
frag.write('fragColor[1] = vec4(idcol.rgb, packFloat2(1.0, 1.0));'); // occ/spec
|
||||
}
|
||||
@@ -1145,36 +1145,36 @@ class MaterialBuilder {
|
||||
if (emisUsed) {
|
||||
frag.write('if (matid == 1.0) basecol *= 10.0;'); // Boost for bloom
|
||||
}
|
||||
frag.write('fragColor[0] = vec4(n.xy, roughness, packFloatInt16(metallic, (uint)matid));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, roughness, packFloatInt16(metallic, uint(matid)));');
|
||||
frag.write('fragColor[1] = vec4(basecol.rgb, packFloat2(occlusion, 1.0));'); // occ/spec
|
||||
}
|
||||
else if (UITrait.inst.viewportMode == 1) { // Basecol
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));');
|
||||
frag.write('fragColor[1] = vec4(basecol.rgb, packFloat2(1.0, 1.0));'); // occ/spec
|
||||
}
|
||||
else if (UITrait.inst.viewportMode == 2) { // Normal Map
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));');
|
||||
frag.write('fragColor[1] = vec4(ntex.rgb, packFloat2(1.0, 1.0));'); // occ/spec
|
||||
}
|
||||
else if (UITrait.inst.viewportMode == 3) { // Occ
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));');
|
||||
frag.write('fragColor[1] = vec4(vec3(occlusion, occlusion, occlusion), packFloat2(1.0, 1.0));'); // occ/spec
|
||||
}
|
||||
else if (UITrait.inst.viewportMode == 4) { // Rough
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));');
|
||||
frag.write('fragColor[1] = vec4(vec3(roughness, roughness, roughness), packFloat2(1.0, 1.0));'); // occ/spec
|
||||
}
|
||||
else if (UITrait.inst.viewportMode == 5) { // Met
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));');
|
||||
frag.write('fragColor[1] = vec4(vec3(metallic, metallic, metallic), packFloat2(1.0, 1.0));'); // occ/spec
|
||||
}
|
||||
else if (UITrait.inst.viewportMode == 6) { // Texcoord
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));');
|
||||
frag.write('fragColor[1] = vec4(texCoord, 0.0, packFloat2(1.0, 1.0));'); // occ/spec
|
||||
}
|
||||
else if (UITrait.inst.viewportMode == 7) { // Normal
|
||||
frag.nAttr = true;
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));');
|
||||
frag.write('fragColor[1] = vec4(nAttr, packFloat2(1.0, 1.0));'); // occ/spec
|
||||
}
|
||||
else if (UITrait.inst.viewportMode == 8) { // MaterialID
|
||||
@@ -1182,11 +1182,11 @@ class MaterialBuilder {
|
||||
frag.write('float matid_r = fract(sin(dot(vec2(sample_matid, sample_matid * 2.0), vec2(12.9898, 78.233))) * 43758.5453);');
|
||||
frag.write('float matid_g = fract(sin(dot(vec2(sample_matid * 2.0, sample_matid), vec2(12.9898, 78.233))) * 43758.5453);');
|
||||
frag.write('float matid_b = fract(sin(dot(vec2(sample_matid, sample_matid * 4.0), vec2(12.9898, 78.233))) * 43758.5453);');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));');
|
||||
frag.write('fragColor[1] = vec4(matid_r, matid_g, matid_b, packFloat2(1.0, 1.0));'); // occ/spec
|
||||
}
|
||||
else if (UITrait.inst.viewportMode == 9) { // Mask
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, 0));');
|
||||
frag.write('fragColor[0] = vec4(n.xy, 1.0, packFloatInt16(0.0, uint(0)));');
|
||||
frag.write('float sample_mask = 1.0;');
|
||||
if (Context.layer.texpaint_mask != null) {
|
||||
frag.add_uniform('sampler2D texpaint_mask_view', '_texpaint_mask');
|
||||
|
||||
Reference in New Issue
Block a user