Skip to content

Commit a5e5566

Browse files
authored
Merge pull request #8318 from AnalyticalGraphicsInc/billboardFixes
Added pixel ratio to czm_metersPerPixel
2 parents e0e8062 + e11540f commit a5e5566

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Source/Shaders/BillboardCollectionVS.glsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 dir
5656
{
5757
// Note the halfSize cannot be computed in JavaScript because it is sent via
5858
// compressed vertex attributes that coerce it to an integer.
59-
vec2 halfSize = imageSize * scale * czm_pixelRatio * 0.5;
59+
vec2 halfSize = imageSize * scale * 0.5;
6060
halfSize *= ((direction * 2.0) - 1.0);
6161

6262
vec2 originTranslate = origin * abs(halfSize);
@@ -102,7 +102,7 @@ vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 dir
102102
}
103103

104104
positionEC.xy += translate * mpp;
105-
positionEC.xy += (pixelOffset * czm_pixelRatio) * mpp;
105+
positionEC.xy += pixelOffset * mpp;
106106
return positionEC;
107107
}
108108

Source/Shaders/Builtin/Functions/metersPerPixel.glsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ float czm_metersPerPixel(vec4 positionEC)
3737
pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
3838
}
3939

40-
return max(pixelWidth, pixelHeight);
40+
return max(pixelWidth, pixelHeight) * czm_pixelRatio;
4141
}

Source/Shaders/PolylineShadowVolumeMorphVS.glsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ void main()
103103
#endif // PER_INSTANCE_COLOR
104104

105105
#ifdef WIDTH_VARYING
106-
float width = czm_batchTable_width(batchId) * czm_pixelRatio;
106+
float width = czm_batchTable_width(batchId);
107107
float halfWidth = width * 0.5;
108108
v_width = width;
109109
v_texcoordNormalizationAndHalfWidth.z = halfWidth;
110110
#else
111-
float halfWidth = 0.5 * czm_batchTable_width(batchId) * czm_pixelRatio;
111+
float halfWidth = 0.5 * czm_batchTable_width(batchId);
112112
v_texcoordNormalizationAndHalfWidth.z = halfWidth;
113113
#endif
114114

Source/Shaders/PolylineShadowVolumeVS.glsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void main()
135135
// { \| }
136136
// o---------- polyline segment ---->
137137
//
138-
float width = czm_batchTable_width(batchId) * czm_pixelRatio;
138+
float width = czm_batchTable_width(batchId);
139139
#ifdef WIDTH_VARYING
140140
v_width = width;
141141
#endif

0 commit comments

Comments
 (0)