Apply mask fixes
This commit is contained in:
@@ -1,23 +1,8 @@
|
||||
#version 330
|
||||
uniform sampler2D tex;
|
||||
uniform int channel;
|
||||
in vec2 texCoord;
|
||||
in vec4 color;
|
||||
out vec4 FragColor;
|
||||
void main() {
|
||||
if (channel == 1) {
|
||||
FragColor = textureLod(tex, texCoord, 0).rrra * color;
|
||||
}
|
||||
else if (channel == 2) {
|
||||
FragColor = textureLod(tex, texCoord, 0).ggga * color;
|
||||
}
|
||||
else if (channel == 3) {
|
||||
FragColor = textureLod(tex, texCoord, 0).bbba * color;
|
||||
}
|
||||
else if (channel == 4) {
|
||||
FragColor = textureLod(tex, texCoord, 0).aaaa * color;
|
||||
}
|
||||
else {
|
||||
FragColor = textureLod(tex, texCoord, 0).rgba * color;
|
||||
}
|
||||
FragColor = textureLod(tex, texCoord, 0).rgba * color;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@ void main() {
|
||||
else if (channel == 4) {
|
||||
FragColor = textureLod(tex, texCoord, 0).aaaa * color;
|
||||
}
|
||||
else if (channel == 5) {
|
||||
FragColor = textureLod(tex, texCoord, 0).rgba * color;
|
||||
}
|
||||
else {
|
||||
vec4 tex_sample = textureLod(tex, texCoord, 0).rgba;
|
||||
tex_sample.rgb *= tex_sample.a;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,20 +1,5 @@
|
||||
Texture2D<float4> tex;
|
||||
SamplerState _tex_sampler;
|
||||
uniform int channel;
|
||||
float4 main(float4 color : TEXCOORD0, float2 texCoord : TEXCOORD1) : SV_Target0 {
|
||||
if (channel == 1) {
|
||||
return tex.SampleLevel(_tex_sampler, texCoord, 0).rrra * color;
|
||||
}
|
||||
else if (channel == 2) {
|
||||
return tex.SampleLevel(_tex_sampler, texCoord, 0).ggga * color;
|
||||
}
|
||||
else if (channel == 3) {
|
||||
return tex.SampleLevel(_tex_sampler, texCoord, 0).bbba * color;
|
||||
}
|
||||
else if (channel == 4) {
|
||||
return tex.SampleLevel(_tex_sampler, texCoord, 0).aaaa * color;
|
||||
}
|
||||
else {
|
||||
return tex.SampleLevel(_tex_sampler, texCoord, 0).rgba * color;
|
||||
}
|
||||
return tex.SampleLevel(_tex_sampler, texCoord, 0).rgba * color;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ float4 main(float4 color : TEXCOORD0, float2 texCoord : TEXCOORD1) : SV_Target0
|
||||
else if (channel == 4) {
|
||||
return tex.SampleLevel(_tex_sampler, texCoord, 0).aaaa * color;
|
||||
}
|
||||
else if (channel == 5) {
|
||||
return tex.SampleLevel(_tex_sampler, texCoord, 0).rgba * color;
|
||||
}
|
||||
else {
|
||||
float4 sample = tex.SampleLevel(_tex_sampler, texCoord, 0).rgba;
|
||||
sample.rgb *= sample.a;
|
||||
|
||||
@@ -112,11 +112,12 @@ class UIView2D {
|
||||
layer.texpaint_pack;
|
||||
|
||||
channel =
|
||||
Context.layerIsMask ? 1 :
|
||||
Context.layerIsMask ? 1 :
|
||||
texType == TexOcclusion ? 1 :
|
||||
texType == TexRoughness ? 2 :
|
||||
texType == TexMetallic ? 3 :
|
||||
texType == TexOpacity ? 4 :
|
||||
texType == TexNormal ? 5 :
|
||||
0;
|
||||
}
|
||||
else { // View2DAsset
|
||||
|
||||
Reference in New Issue
Block a user