RawShaderMaterial.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_volume_cloud WebGL / volume / cloud]<br />
  33. [example:webgl_volume_instancing WebGL / volume / instancing]<br />
  34. [example:webgl_volume_perlin WebGL / volume / perlin]
  35. </p>
  36. <h2>Constructor</h2>
  37. <h3>[name]( [param:Object parameters] )</h3>
  38. <p>
  39. [page:Object parameters] - (optional) an object with one or more
  40. properties defining the material's appearance. Any property of the
  41. material (including any property inherited from [page:Material] and
  42. [page:ShaderMaterial]) can be passed in here.<br /><br />
  43. </p>
  44. <h2>Properties</h2>
  45. <p>
  46. See the base [page:Material] and [page:ShaderMaterial] classes for common
  47. properties.
  48. </p>
  49. <h2>Methods</h2>
  50. <p>
  51. See the base [page:Material] and [page:ShaderMaterial] classes for common
  52. methods.
  53. </p>
  54. <h2>Source</h2>
  55. <p>
  56. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  57. </p>
  58. </body>
  59. </html>
粤ICP备19079148号