diff --git a/Source/Renderer/AutomaticUniforms.js b/Source/Renderer/AutomaticUniforms.js index f3a64cfe6b..1134127fb4 100644 --- a/Source/Renderer/AutomaticUniforms.js +++ b/Source/Renderer/AutomaticUniforms.js @@ -1560,6 +1560,17 @@ define([ } }), + /** + * An automatic GLSL uniform containing the specular environment map atlas used within the scene. + * + * @alias czm_specularEnvironmentMaps + * @namespace + * @glslUniform + * + * @example + * // GLSL declaration + * uniform sampler2D czm_specularEnvironmentMaps; + */ czm_specularEnvironmentMaps : new AutomaticUniform({ size : 1, datatype : WebGLConstants.SAMPLER_2D, @@ -1568,6 +1579,17 @@ define([ } }), + /** + * An automatic GLSL uniform containing the size of the specular environment map atlas used within the scene. + * + * @alias czm_specularEnvironmentMapSize + * @namespace + * @glslUniform + * + * @example + * // GLSL declaration + * uniform vec2 czm_specularEnvironmentMapSize; + */ czm_specularEnvironmentMapSize : new AutomaticUniform({ size : 1, datatype : WebGLConstants.FLOAT_VEC2, @@ -1576,6 +1598,17 @@ define([ } }), + /** + * An automatic GLSL uniform containing the maximum level-of-detail of the specular environment map atlas used within the scene. + * + * @alias czm_specularEnvironmentMapsMaximumLOD + * @namespace + * @glslUniform + * + * @example + * // GLSL declaration + * uniform float czm_specularEnvironmentMapsMaximumLOD; + */ czm_specularEnvironmentMapsMaximumLOD : new AutomaticUniform({ size : 1, datatype : WebGLConstants.FLOAT, @@ -1584,6 +1617,17 @@ define([ } }), + /** + * An automatic GLSL uniform containing the spherical harmonic coefficients used within the scene. + * + * @alias czm_sphericalHarmonicCoefficients + * @namespace + * @glslUniform + * + * @example + * // GLSL declaration + * uniform vec3[9] czm_sphericalHarmonicCoefficients; + */ czm_sphericalHarmonicCoefficients : new AutomaticUniform({ size : 9, datatype : WebGLConstants.FLOAT_VEC3, diff --git a/Source/Renderer/UniformState.js b/Source/Renderer/UniformState.js index 6a5e295a56..aff11a5b91 100644 --- a/Source/Renderer/UniformState.js +++ b/Source/Renderer/UniformState.js @@ -883,18 +883,33 @@ define([ } }, + /** + * The spherical harmonic coefficients of the scene. + * @memberof UniformState.prototype + * @type {Cartesian3[]} + */ sphericalHarmonicCoefficients : { get : function() { return this._sphericalHarmonicCoefficients; } }, + /** + * The specular environment map atlas of the scene. + * @memberof UniformState.prototype + * @type {Texture} + */ specularEnvironmentMaps : { get : function() { return this._specularEnvironmentMaps; } }, + /** + * The maximum level-of-detail of the specular environment map atlas of the scene. + * @memberof UniformState.prototype + * @type {Number} + */ specularEnvironmentMapsMaximumLOD : { get : function() { return this._specularEnvironmentMapsMaximumLOD; diff --git a/Source/Scene/FrameState.js b/Source/Scene/FrameState.js index 1c5dea5f20..b2297b39d9 100644 --- a/Source/Scene/FrameState.js +++ b/Source/Scene/FrameState.js @@ -50,8 +50,22 @@ define([ */ this.environmentMap = undefined; + /** + * The spherical harmonic coefficients used for image-based lighting for PBR models. + * @type {Cartesian3[]} + */ this.sphericalHarmonicCoefficients = undefined; + + /** + * The specular environment atlas used for image-based lighting for PBR models. + * @type {Texture} + */ this.specularEnvironmentMaps = undefined; + + /** + * The maximum level-of-detail of the specular environment atlas used for image-based lighting for PBR models. + * @type {Number} + */ this.specularEnvironmentMapsMaximumLOD = undefined; /** diff --git a/Source/Scene/OctahedralProjectedCubeMap.js b/Source/Scene/OctahedralProjectedCubeMap.js index 83c92d4ecc..9c83ba9284 100644 --- a/Source/Scene/OctahedralProjectedCubeMap.js +++ b/Source/Scene/OctahedralProjectedCubeMap.js @@ -70,6 +70,12 @@ define([ } defineProperties(OctahedralProjectedCubeMap.prototype, { + /** + * The url to the KTX file containing the specular environment map and convoluted mipmaps. + * @memberof OctahedralProjectedCubeMap.prototype + * @type {String} + * @readonly + */ url : { get : function() { return this._url; diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 96b7c2a211..a5c09a86c6 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -797,7 +797,16 @@ define([ this.gamma = 2.2; this._sunColor = new Cartesian3(1.8, 1.85, 2.0); + /** + * The spherical harmonic coefficients for image-based lighting of PBR models. + * @type {Cartesian3[]} + */ this.sphericalHarmonicCoefficients = undefined; + + /** + * The url to the KTX file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models. + * @type {String} + */ this.specularEnvironmentMaps = undefined; this._specularEnvironmentMapAtlas = undefined;