Skip to content

Commit

Permalink
Docs: Improve Material page (en/fr) (#30118)
Browse files Browse the repository at this point in the history
* Docs: Add TSL example for the onBeforeCompile method in Material

* Implements review feedbacks
  • Loading branch information
borisghidaglia authored Dec 20, 2024
1 parent 7d25bc9 commit f6fd36c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/api/en/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ <h3>
<p>
An optional callback that is executed immediately before the shader
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>
Unlike properties, the callback is not supported by [page:Material.clone .clone](),
Expand Down
4 changes: 3 additions & 1 deletion docs/api/fr/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ <h3>[method:undefined dispose]()</h3>
<h3>[method:undefined onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] )</h3>
<p>
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>
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]().
Expand Down

0 comments on commit f6fd36c

Please sign in to comment.