Parse opacity

This commit is contained in:
luboslenco
2019-02-03 22:19:50 +01:00
parent c63de3e078
commit 3a949a1e9e
+5 -3
View File
@@ -200,18 +200,20 @@ class MaterialBuilder {
var occ = sout.out_occlusion;
var nortan = Cycles.out_normaltan;
var height = sout.out_height;
var opac = sout.out_opacity;
frag.write('vec3 basecol = $base;');
frag.write('float roughness = $rough;');
frag.write('float metallic = $met;');
frag.write('float occlusion = $occ;');
frag.write('vec3 nortan = $nortan;');
frag.write('float height = $height;');
frag.write('float opacity = $opac * brushOpacity;');
if (eraser) frag.write(' float str = 1.0 - brushOpacity;');
else frag.write(' float str = clamp(brushOpacity * (brushRadius - dist) * brushStrength, 0.0, 1.0);');
if (eraser) frag.write(' float str = 1.0 - opacity;');
else frag.write(' float str = clamp(opacity * (brushRadius - dist) * brushStrength, 0.0, 1.0);');
if (UITrait.inst.mirrorX && UITrait.inst.brushType == 0) { // Draw
frag.write('str += clamp(brushOpacity * (brushRadius - dist2) * brushStrength, 0.0, 1.0);');
frag.write('str += clamp(opacity * (brushRadius - dist2) * brushStrength, 0.0, 1.0);');
frag.write('str = clamp(str, 0.0, 1.0);');
}