Skip to content

Commit

Permalink
Rename shader variable to avoid name conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
wmcmurray authored and lojjic committed Feb 7, 2022
1 parent 9c12c87 commit 8f1c6e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/troika-three-text/src/TextDerivedMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {
// language=GLSL prefix="void main() {" suffix="}"
const FRAGMENT_TRANSFORM = `
float aaDist = troikaGetAADist();
float distance = troikaGetFragDistValue();
float fragDistance = troikaGetFragDistValue();
float edgeAlpha = uTroikaSDFDebug ?
troikaGlyphUvToSdfValue(vTroikaGlyphUV) :
troikaGetEdgeAlpha(distance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius));
troikaGetEdgeAlpha(fragDistance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius));
#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)
vec4 fillRGBA = gl_FragColor;
Expand All @@ -192,7 +192,7 @@ if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;
gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(
-uTroikaStrokeWidth - aaDist,
-uTroikaStrokeWidth + aaDist,
distance
fragDistance
));
gl_FragColor.a *= edgeAlpha;
#endif
Expand Down

0 comments on commit 8f1c6e1

Please sign in to comment.