RawShaderMaterial.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Material] &rarr; [page:ShaderMaterial] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. Cette classe fonctionne exactement comme [page:ShaderMaterial], sauf que les définitions des
  14. uniformes et les attributs intégrés ne sont pas automatiquement ajoutées au code du shader GLSL.
  15. </p>
  16. <h2>Code Example</h2>
  17. <code>
  18. const material = new THREE.RawShaderMaterial( {
  19. uniforms: {
  20. time: { value: 1.0 }
  21. },
  22. vertexShader: document.getElementById( 'vertexShader' ).textContent,
  23. fragmentShader: document.getElementById( 'fragmentShader' ).textContent,
  24. } );
  25. </code>
  26. <h2>Exemples</h2>
  27. <p>
  28. [example:webgl_buffergeometry_rawshader WebGL / buffergeometry / rawshader]<br />
  29. [example:webgl_buffergeometry_instancing_billboards WebGL / buffergeometry / instancing / billboards]<br />
  30. [example:webgl_buffergeometry_instancing WebGL / buffergeometry / instancing]<br />
  31. [example:webgl_raymarching_reflect WebGL / raymarching / reflect]<br />
  32. [example:webgl2_volume_cloud WebGL 2 / volume / cloud]<br />
  33. [example:webgl2_volume_instancing WebGL 2 / volume / instancing]<br />
  34. [example:webgl2_volume_perlin WebGL 2 / volume / perlin]
  35. </p>
  36. <h2>Constructeur</h2>
  37. <h3>[name]( [param:Object parameters] )</h3>
  38. <p>
  39. [page:Object parameters] - (optionnel) un objet avec une ou plusieurs propriétés définissant l'apparence du matériau.
  40. Toute propriété du matériau (y compris toute proprioété héritée de [page:Material] and [page:ShaderMaterial]) peut être passée dans l'objet.<br /><br />
  41. </p>
  42. <h2>Propriétés</h2>
  43. <p>Voir la classe [page:Material] et [page:ShaderMaterial] pour les propriétés communes.</p>
  44. <h2>Méthodes</h2>
  45. <p>Voir la classe [page:Material] et [page:ShaderMaterial] pour les méthodes communes.</p>
  46. <h2>Source</h2>
  47. <p>
  48. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  49. </p>
  50. </body>
  51. </html>