yzt
2023-05-26 de4278af2fd46705a40bac58ec01122db6b7f3d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
 * An enum describing how the {@link CustomShader} will be added to the
 * fragment shader. This determines how the shader interacts with the material.
 *
 * @enum {String}
 *
 * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
 */
var CustomShaderMode = {
  /**
   * The custom shader will be used to modify the results of the material stage
   * before lighting is applied.
   *
   * @type {String}
   * @constant
   */
  MODIFY_MATERIAL: "MODIFY_MATERIAL",
  /**
   * The custom shader will be used instead of the material stage. This is a hint
   * to optimize out the material processing code.
   *
   * @type {String}
   * @constant
   */
  REPLACE_MATERIAL: "REPLACE_MATERIAL",
};
 
/**
 * Convert the shader mode to an uppercase identifier for use in GLSL define
 * directives. For example:  <code>#define CUSTOM_SHADER_MODIFY_MATERIAL</code>
 * @param {CustomShaderMode} customShaderMode The shader mode
 * @return {String} The name of the GLSL macro to use
 *
 * @private
 */
CustomShaderMode.getDefineName = function (customShaderMode) {
  return "CUSTOM_SHADER_" + customShaderMode;
};
 
export default Object.freeze(CustomShaderMode);