Skip to content

Commit 6b1879f

Browse files
committed
comments for PointCloudShading.isSupported
1 parent 1484470 commit 6b1879f

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

Source/Scene/PointCloudShading.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ define([
7676
this.eyeDomeLightingRadius = defaultValue(pointCloudShading.eyeDomeLightingRadius, 1.0);
7777
}
7878

79-
PointCloudShading.isSupported = PointCloudEyeDomeLighting.isSupported;
79+
/**
80+
* Determines if point cloud shading is supported.
81+
*
82+
* @param {Scene} scene The scene.
83+
* @returns {Boolean} <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code>
84+
*/
85+
PointCloudShading.isSupported = function(scene) {
86+
return PointCloudEyeDomeLighting.isSupported(scene.context);
87+
}
8088

8189
return PointCloudShading;
8290
});

Specs/Scene/PointCloudShadingSpec.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
defineSuite([
2-
'Scene/PointCloudShading'
2+
'Scene/PointCloudShading',
3+
'Specs/createScene'
34
], function(
4-
PointCloudShading) {
5+
PointCloudShading,
6+
createScene) {
57
'use strict';
68

79
it('creates expected instance from raw assignment and construction', function() {
@@ -30,4 +32,12 @@ defineSuite([
3032
expect(pointCloudShading.eyeDomeLightingStrength).toEqual(options.eyeDomeLightingStrength);
3133
expect(pointCloudShading.eyeDomeLightingRadius).toEqual(options.eyeDomeLightingRadius);
3234
});
35+
36+
it('provides a method for checking if point cloud shading is supported', function() {
37+
var scene = createScene();
38+
var context = scene.context;
39+
var expectedSupport = context.floatingPointTexture && context.drawBuffers && context.fragmentDepth;
40+
expect(PointCloudShading.isSupported(scene)).toEqual(expectedSupport);
41+
scene.destroyForSpecs();
42+
});
3343
});

0 commit comments

Comments
 (0)