Skip to content

Commit

Permalink
Docs: Add TSL example for the onBeforeCompile method in Material
Browse files Browse the repository at this point in the history
  • Loading branch information
borisghidaglia committed Dec 13, 2024
1 parent fd6528b commit 23613b8
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 [link:https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language TSL].
See the before/after example [link:https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language#example here].
</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 [link:https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language TSL].
Voir l'exemple avant/après [link:https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language#example ici].
</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 23613b8

Please sign in to comment.