Переглянути джерело

Docs: Improve Material page (en/fr) (#30118)

* Docs: Add TSL example for the onBeforeCompile method in Material

* Implements review feedbacks
Boris Ghidaglia 1 рік тому
батько
коміт
f6fd36c5ea

+ 3 - 1
docs/api/en/materials/Material.html

@@ -417,7 +417,9 @@
 		<p>
 		<p>
 			An optional callback that is executed immediately before the shader
 			An optional callback that is executed immediately before the shader
 			program is compiled. This function is called with the shader source code
 			program is compiled. This function is called with the shader source code
-			as a parameter. Useful for the modification of built-in materials.
+			as a parameter. Useful for the modification of built-in materials, but the
+			recommended approach moving forward is to use `WebGPURenderer` with the new
+			Node Material system and [link:https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language TSL].
 		</p>
 		</p>
 		<p>
 		<p>
 			Unlike properties, the callback is not supported by [page:Material.clone .clone](), 
 			Unlike properties, the callback is not supported by [page:Material.clone .clone](), 

+ 3 - 1
docs/api/fr/materials/Material.html

@@ -350,7 +350,9 @@
 		<h3>[method:undefined onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] )</h3>
 		<h3>[method:undefined onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] )</h3>
 		<p>
 		<p>
 			Un callback facultatif qui est exécuté immédiatement avant la compilation du programme shader.
 			Un callback facultatif qui est exécuté immédiatement avant la compilation du programme shader.
-			Cette fonction est appelée avec le code source du shader comme paramètre. Utile pour la modification des matériaux intégrés.
+			Cette fonction est appelée avec le code source du shader comme paramètre. Utile pour la modification des matériaux intégrés, 
+			bien que la nouvelle méthode recommandée soit d'utiliser `WebGPURenderer` avec le nouveau système de Node Material et
+			[link:https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language TSL].
 		</p>
 		</p>
 		<p>
 		<p>
 			Contrairement aux propriétés, le callback n'est pas pris en charge par [page:Material.clone .clone](), [page:Material.copy .copy]() et [page:Material.toJSON .toJSON]().
 			Contrairement aux propriétés, le callback n'est pas pris en charge par [page:Material.clone .clone](), [page:Material.copy .copy]() et [page:Material.toJSON .toJSON]().

粤ICP备19079148号