Просмотр исходного кода

Docs: Improve `ShaderMaterial.fog`. (#32224)

Michael Herzog 3 месяцев назад
Родитель
Сommit
926060e14d

BIN
examples/screenshots/webgl_postprocessing_glitch.jpg


BIN
examples/screenshots/webgl_postprocessing_sao.jpg


BIN
examples/screenshots/webgl_postprocessing_ssaa.jpg


BIN
examples/screenshots/webgl_postprocessing_ssao.jpg


+ 14 - 1
src/materials/ShaderMaterial.js

@@ -158,9 +158,22 @@ class ShaderMaterial extends Material {
 		this.wireframeLinewidth = 1;
 
 		/**
-		 * Define whether the material color is affected by global fog settings; `true`
+		 * Defines whether the material color is affected by global fog settings; `true`
 		 * to pass fog uniforms to the shader.
 		 *
+		 * Setting this property to `true` requires the definition of fog uniforms. It is
+		 * recommended to use `UniformsUtils.merge()` to combine the custom shader uniforms
+		 * with predefined fog uniforms.
+		 *
+		 * ```js
+		 * const material = new ShaderMaterial( {
+		 *     uniforms: UniformsUtils.merge( [ UniformsLib[ 'fog' ], shaderUniforms ] );
+		 *     vertexShader: vertexShader,
+		 *     fragmentShader: fragmentShader,
+		 *     fog: true
+		 * } );
+		 * ```
+		 *
 		 * @type {boolean}
 		 * @default false
 		 */

+ 1 - 0
test/e2e/puppeteer.js

@@ -23,6 +23,7 @@ const exceptionList = [
 	'physics_rapier_instancing',
 	'webgl_shadowmap',
 	'webgl_postprocessing_dof2',
+	'webgl_postprocessing_glitch',
 	'webgl_video_kinect',
 	'webgl_worker_offscreencanvas',
 	'webgpu_backdrop_water',

粤ICP备19079148号