Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add trailing spaces to make prettier merge cleaner #12222

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@
highlighted.feature = pickedFeature;
Cesium.Color.clone(pickedFeature.color, highlighted.originalColor);
pickedFeature.color = Cesium.Color.YELLOW.withAlpha(0.5);
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
//Sandcastle_End
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); //Sandcastle_End
};
if (typeof Cesium !== "undefined") {
window.startupCalled = true;
Expand Down
3 changes: 1 addition & 2 deletions Apps/Sandcastle/gallery/3D Tiles Point Cloud Shading.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@
if (Cesium.defined(viewModelTileset)) {
viewModelTileset.pointCloudShading.eyeDomeLighting = checked;
}
});
//Sandcastle_End
}); //Sandcastle_End
};
if (typeof Cesium !== "undefined") {
window.startupCalled = true;
Expand Down
3 changes: 1 addition & 2 deletions Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
highlighted.feature = pickedFeature;
Cesium.Color.clone(pickedFeature.color, highlighted.originalColor);
pickedFeature.color = Cesium.Color.YELLOW;
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
//Sandcastle_End
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); //Sandcastle_End
};
if (typeof Cesium !== "undefined") {
window.startupCalled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
if (czm_selected()) {
vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;
out_FragColor = vec4(highlighted, 1.0);
} else {
} else {
out_FragColor = color;
}
}
Expand Down
34 changes: 17 additions & 17 deletions Apps/Sandcastle/gallery/Custom Post Process.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@
});

const fragmentShaderSource = `
uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
const int KERNEL_WIDTH = 16;
void main(void)
{
vec2 step = czm_pixelRatio / czm_viewport.zw;
vec2 integralPos = v_textureCoordinates - mod(v_textureCoordinates, 8.0 * step);
vec3 averageValue = vec3(0.0);
for (int i = 0; i < KERNEL_WIDTH; i++)
{
for (int j = 0; j < KERNEL_WIDTH; j++)
{
averageValue += texture(colorTexture, integralPos + step * vec2(i, j)).rgb;
}
}
averageValue /= float(KERNEL_WIDTH * KERNEL_WIDTH);
out_FragColor = vec4(averageValue, 1.0);
uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
const int KERNEL_WIDTH = 16;
void main(void)
{
vec2 step = czm_pixelRatio / czm_viewport.zw;
vec2 integralPos = v_textureCoordinates - mod(v_textureCoordinates, 8.0 * step);
vec3 averageValue = vec3(0.0);
for (int i = 0; i < KERNEL_WIDTH; i++)
{
for (int j = 0; j < KERNEL_WIDTH; j++)
{
averageValue += texture(colorTexture, integralPos + step * vec2(i, j)).rgb;
}
}
averageValue /= float(KERNEL_WIDTH * KERNEL_WIDTH);
out_FragColor = vec4(averageValue, 1.0);
}
`;
viewer.scene.postProcessStages.add(
Expand Down
68 changes: 34 additions & 34 deletions Apps/Sandcastle/gallery/Fog Post Process.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,40 +48,40 @@
}

const fragmentShaderSource = `
float getDistance(sampler2D depthTexture, vec2 texCoords)
{
float depth = czm_unpackDepth(texture(depthTexture, texCoords));
if (depth == 0.0) {
return czm_infinity;
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);
return -eyeCoordinate.z / eyeCoordinate.w;
}
float interpolateByDistance(vec4 nearFarScalar, float distance)
{
float startDistance = nearFarScalar.x;
float startValue = nearFarScalar.y;
float endDistance = nearFarScalar.z;
float endValue = nearFarScalar.w;
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
return mix(startValue, endValue, t);
}
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
{
return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
}
uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
uniform vec4 fogByDistance;
uniform vec4 fogColor;
in vec2 v_textureCoordinates;
void main(void)
{
float distance = getDistance(depthTexture, v_textureCoordinates);
vec4 sceneColor = texture(colorTexture, v_textureCoordinates);
float blendAmount = interpolateByDistance(fogByDistance, distance);
vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
out_FragColor = alphaBlend(finalFogColor, sceneColor);
float getDistance(sampler2D depthTexture, vec2 texCoords)
{
float depth = czm_unpackDepth(texture(depthTexture, texCoords));
if (depth == 0.0) {
return czm_infinity;
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);
return -eyeCoordinate.z / eyeCoordinate.w;
}
float interpolateByDistance(vec4 nearFarScalar, float distance)
{
float startDistance = nearFarScalar.x;
float startValue = nearFarScalar.y;
float endDistance = nearFarScalar.z;
float endValue = nearFarScalar.w;
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
return mix(startValue, endValue, t);
}
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
{
return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
}
uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
uniform vec4 fogByDistance;
uniform vec4 fogColor;
in vec2 v_textureCoordinates;
void main(void)
{
float distance = getDistance(depthTexture, v_textureCoordinates);
vec4 sceneColor = texture(colorTexture, v_textureCoordinates);
float blendAmount = interpolateByDistance(fogByDistance, distance);
vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
out_FragColor = alphaBlend(finalFogColor, sceneColor);
}
`;

Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Google Earth Enterprise.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
);
layers.add(blackMarble);
} catch (error) {
console.log(`Failed to create Google Earth providers from metadata. Confirm GEE service is correctly configured.
console.log(`Failed to create Google Earth providers from metadata. Confirm GEE service is correctly configured.
${error}`);
}

Expand Down
22 changes: 11 additions & 11 deletions Apps/Sandcastle/gallery/Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,19 @@
},
},
source: `
czm_material czm_getMaterial(czm_materialInput materialInput) {
czm_material material = czm_getDefaultMaterial(materialInput);
vec4 color;
float heightValue = texture(heightField, materialInput.st).r;
color.rgb = mix(vec3(0.2, 0.6, 0.2), vec3(1.0, 0.5, 0.2), heightValue);
color.a = (1.0 - texture(image, materialInput.st).r) * 0.7;
color = czm_gammaCorrect(color);
material.diffuse = color.rgb;
material.alpha = color.a;
material.normal = bumpMap.normal;
czm_material czm_getMaterial(czm_materialInput materialInput) {
czm_material material = czm_getDefaultMaterial(materialInput);
vec4 color;
float heightValue = texture(heightField, materialInput.st).r;
color.rgb = mix(vec3(0.2, 0.6, 0.2), vec3(1.0, 0.5, 0.2), heightValue);
color.a = (1.0 - texture(image, materialInput.st).r) * 0.7;
color = czm_gammaCorrect(color);
material.diffuse = color.rgb;
material.alpha = color.a;
material.normal = bumpMap.normal;
material.specular = step(0.1, heightValue); // Specular mountain tops
material.shininess = 8.0; // Sharpen highlight
return material;
return material;
}
`,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ async function requestMetadata(resource, imageryProviderBuilder) {
*
* Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are
* used, if available.
*
*
* <br/>
*
*
* An {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security| ArcGIS Access Token } is required to authenticate requests to an ArcGIS Image Tile service.
* To access secure ArcGIS resources, it's required to create an ArcGIS developer
* account or an ArcGIS online account, then implement an authentication method to obtain an access token.
Expand All @@ -278,7 +278,7 @@ async function requestMetadata(resource, imageryProviderBuilder) {
* @example
* // Set the default access token for accessing ArcGIS Image Tile service
* Cesium.ArcGisMapService.defaultAccessToken = "<ArcGIS Access Token>";
*
*
* // Add a base layer from a default ArcGIS basemap
* const viewer = new Cesium.Viewer("cesiumContainer", {
* baseLayer: Cesium.ImageryLayer.fromProviderAsync(
Expand Down
12 changes: 6 additions & 6 deletions packages/engine/Source/Scene/DerivedCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ function getPickShaderProgram(context, shaderProgram, pickId) {
const outputColorVariable = hasFragData
? "out_FragData_0"
: "out_FragColor";
const newMain = `void main ()
const newMain = `void main ()
{
czm_non_pick_main();
if (${outputColorVariable}.a == 0.0) {
discard;
}
${outputColorVariable} = ${pickId};
czm_non_pick_main();
if (${outputColorVariable}.a == 0.0) {
discard;
}
${outputColorVariable} = ${pickId};
} `;

const newSources = new Array(length + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ describe(
4, 8, 11
]);
// prettier-ignore
let expectedOutlineCoordinates = new Float32Array([
let expectedOutlineCoordinates = new Float32Array([
0, 1, 0,
0, 1, 0,
0, 1, 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/Specs/Scene/Vector3DTilePointsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ describe(
/*[
Cesium3DTileStyle option,
Cesium3DTileStyle default value,
Cesium3DTileFeature property,
Cesium3DTileFeature property,
expected Cesium3DTileFeature value,
expected undefined Cesium3DTileFeature value
]*/
Expand Down