Skip to content

Commit 65b7cff

Browse files
author
hpinkos
committed
cleanup
1 parent 072c0c8 commit 65b7cff

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

Source/Shaders/BillboardCollectionFS.glsl

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ varying vec4 v_color;
1111
#ifdef CLAMP_TO_GROUND
1212
varying vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates
1313
varying vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs)
14-
varying vec4 v_leftAndRightTextureCoordinate; // texture coordinates for left and right depth test
1514
varying vec4 v_dimensionsAndImageSize; // dimensions of the bounding rectangle and the size of the image. The values will only be different for label glyphs
1615
varying vec2 v_eyeDepthAndDistance; // The depth of the billboard and the disable depth test distance
1716

@@ -88,10 +87,10 @@ void main()
8887
// negative values go into the screen
8988
if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
9089
{
91-
float globeDepth2 = getGlobeDepth(adjustedST, v_leftAndRightTextureCoordinate.xy);
90+
float globeDepth2 = getGlobeDepth(adjustedST, vec4(0.0, 1.0)); // top left corner
9291
if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
9392
{
94-
float globeDepth3 = getGlobeDepth(adjustedST, v_leftAndRightTextureCoordinate.zw);
93+
float globeDepth3 = getGlobeDepth(adjustedST, vec4(1.0, 1.0)); // top right corner
9594
if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
9695
{
9796
discard;

Source/Shaders/BillboardCollectionVS.glsl

+2-17
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ varying vec2 v_textureCoordinates;
2121
#ifdef CLAMP_TO_GROUND
2222
varying vec4 v_textureCoordinateBounds;
2323
varying vec4 v_originTextureCoordinateAndTranslate;
24-
varying vec4 v_leftAndRightTextureCoordinate;
2524
varying vec4 v_dimensionsAndImageSize;
2625
varying vec2 v_eyeDepthAndDistance;
2726
#endif
@@ -160,28 +159,14 @@ void main()
160159
translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
161160
translate.y -= UPPER_BOUND;
162161

163-
v_originTextureCoordinateAndTranslate.zw = translate.xy;
164-
165162
temp = compressedAttribute1.x * SHIFT_RIGHT8;
166163

167164
vec2 imageSize = vec2(floor(temp), compressedAttribute2.w);
168165

169166
#ifdef CLAMP_TO_GROUND
170-
v_textureCoordinateBounds = textureCoordinateBounds;
171167
v_originTextureCoordinateAndTranslate.xy = vec2(1.0) - depthOrigin; //the origin
172-
if (v_originTextureCoordinateAndTranslate.y == 1.0) //vertical origin is top
173-
{
174-
v_leftAndRightTextureCoordinate = vec4(0.0, 0.0, 1.0, 0.0); //bottom left, bottom right
175-
}
176-
else
177-
{
178-
if (v_originTextureCoordinateAndTranslate.y == 0.0)
179-
{
180-
v_originTextureCoordinateAndTranslate.y = 0.1;
181-
}
182-
183-
v_leftAndRightTextureCoordinate = vec4(0.0, 1.0, 1.0, 1.0); //top left, top right
184-
}
168+
v_originTextureCoordinateAndTranslate.zw = translate.xy;
169+
v_textureCoordinateBounds = textureCoordinateBounds;
185170

186171
temp = compressedAttribute3.w;
187172
temp = temp * SHIFT_RIGHT12;

0 commit comments

Comments
 (0)