Skip to content

Commit f94e2f0

Browse files
committed
Fix transparency for convert to colormap
1 parent 28ad0f3 commit f94e2f0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Interface/Modules/Render/ES/shaders/DirPhongInSitu.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ uniform vec4 uDiffuseColor; // Diffuse color
4040
uniform vec4 uSpecularColor; // Specular color
4141
uniform float uSpecularPower; // Specular power
4242
uniform vec3 uLightDirWorld; // Directional light (world space).
43+
uniform float uTransparency;
4344

4445
// Lighting in world space. Generally, it's better to light in eye space if you
4546
// are dealing with point lights. Since we are only dealing with directional
@@ -70,7 +71,9 @@ void main()
7071
vec3 reflection = reflect(invLightDir, normal);
7172
float spec = max(0.0, dot(reflection, uCamViewVec));
7273

74+
vec4 diffuseColor = vColor;
75+
7376
spec = pow(spec, uSpecularPower);
74-
gl_FragColor = vec4((diffuse * spec * uSpecularColor + diffuse * vColor + uAmbientColor).rgb, uDiffuseColor.a);
77+
gl_FragColor = vec4((diffuse * spec * uSpecularColor + diffuse * diffuseColor + uAmbientColor).rgb, uTransparency);
7578
}
7679

src/Interface/Modules/Render/ES/shaders/InSituColor.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636

3737
varying vec4 fColor;
3838

39+
uniform float uTransparency;
40+
3941
void main()
4042
{
41-
gl_FragColor = fColor;
43+
gl_FragColor = vec4(fColor.xyz,uTransparency);
4244
}

0 commit comments

Comments
 (0)