Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hpinkos committed Jun 18, 2018
1 parent 072c0c8 commit 65b7cff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
5 changes: 2 additions & 3 deletions Source/Shaders/BillboardCollectionFS.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ varying vec4 v_color;
#ifdef CLAMP_TO_GROUND
varying vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates
varying vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs)
varying vec4 v_leftAndRightTextureCoordinate; // texture coordinates for left and right depth test
varying vec4 v_dimensionsAndImageSize; // dimensions of the bounding rectangle and the size of the image. The values will only be different for label glyphs
varying vec2 v_eyeDepthAndDistance; // The depth of the billboard and the disable depth test distance

Expand Down Expand Up @@ -88,10 +87,10 @@ void main()
// negative values go into the screen
if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
{
float globeDepth2 = getGlobeDepth(adjustedST, v_leftAndRightTextureCoordinate.xy);
float globeDepth2 = getGlobeDepth(adjustedST, vec4(0.0, 1.0)); // top left corner
if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
{
float globeDepth3 = getGlobeDepth(adjustedST, v_leftAndRightTextureCoordinate.zw);
float globeDepth3 = getGlobeDepth(adjustedST, vec4(1.0, 1.0)); // top right corner
if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
{
discard;
Expand Down
19 changes: 2 additions & 17 deletions Source/Shaders/BillboardCollectionVS.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ varying vec2 v_textureCoordinates;
#ifdef CLAMP_TO_GROUND
varying vec4 v_textureCoordinateBounds;
varying vec4 v_originTextureCoordinateAndTranslate;
varying vec4 v_leftAndRightTextureCoordinate;
varying vec4 v_dimensionsAndImageSize;
varying vec2 v_eyeDepthAndDistance;
#endif
Expand Down Expand Up @@ -160,28 +159,14 @@ void main()
translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
translate.y -= UPPER_BOUND;

v_originTextureCoordinateAndTranslate.zw = translate.xy;

temp = compressedAttribute1.x * SHIFT_RIGHT8;

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

#ifdef CLAMP_TO_GROUND
v_textureCoordinateBounds = textureCoordinateBounds;
v_originTextureCoordinateAndTranslate.xy = vec2(1.0) - depthOrigin; //the origin
if (v_originTextureCoordinateAndTranslate.y == 1.0) //vertical origin is top
{
v_leftAndRightTextureCoordinate = vec4(0.0, 0.0, 1.0, 0.0); //bottom left, bottom right
}
else
{
if (v_originTextureCoordinateAndTranslate.y == 0.0)
{
v_originTextureCoordinateAndTranslate.y = 0.1;
}

v_leftAndRightTextureCoordinate = vec4(0.0, 1.0, 1.0, 1.0); //top left, top right
}
v_originTextureCoordinateAndTranslate.zw = translate.xy;
v_textureCoordinateBounds = textureCoordinateBounds;

temp = compressedAttribute3.w;
temp = temp * SHIFT_RIGHT12;
Expand Down

0 comments on commit 65b7cff

Please sign in to comment.