RawShaderMaterial.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en">
  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. This class works just like [page:ShaderMaterial], except that definitions
  14. of built-in uniforms and attributes are not automatically prepended to the
  15. GLSL shader code.
  16. </p>
  17. <h2>Code Example</h2>
  18. <code>
  19. const material = new THREE.RawShaderMaterial( {
  20. uniforms: {
  21. time: { value: 1.0 }
  22. },
  23. vertexShader: document.getElementById( 'vertexShader' ).textContent,
  24. fragmentShader: document.getElementById( 'fragmentShader' ).textContent,
  25. } );
  26. </code>
  27. <h2>Examples</h2>
  28. <p>
  29. [example:webgl_buffergeometry_rawshader WebGL / buffergeometry / rawshader]<br />
  30. [example:webgl_buffergeometry_instancing_billboards WebGL / buffergeometry / instancing / billboards]<br />
  31. [example:webgl_buffergeometry_instancing WebGL / buffergeometry / instancing]<br />
  32. [example:webgl_raymarching_reflect WebGL / raymarching / reflect]<br />
  33. [example:webgl_volume_cloud WebGL / volume / cloud]<br />
  34. [example:webgl_volume_instancing WebGL / volume / instancing]<br />
  35. [example:webgl_volume_perlin WebGL / volume / perlin]
  36. </p>
  37. <h2>Constructor</h2>
  38. <h3>[name]( [param:Object parameters] )</h3>
  39. <p>
  40. [page:Object parameters] - (optional) an object with one or more
  41. properties defining the material's appearance. Any property of the
  42. material (including any property inherited from [page:Material] and
  43. [page:ShaderMaterial]) can be passed in here.<br /><br />
  44. </p>
  45. <h2>Properties</h2>
  46. <p>
  47. See the base [page:Material] and [page:ShaderMaterial] classes for common
  48. properties.
  49. </p>
  50. <h2>Methods</h2>
  51. <p>
  52. See the base [page:Material] and [page:ShaderMaterial] classes for common
  53. methods.
  54. </p>
  55. <h2>Source</h2>
  56. <p>
  57. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  58. </p>
  59. </body>
  60. </html>