RawShaderMaterial.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Material] &rarr; [page:ShaderMaterial] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">
  14. This class works just like [page:ShaderMaterial], except that definitions of
  15. built-in uniforms and attributes are not automatically prepended to the GLSL shader code.
  16. </p>
  17. <h2>Examples</h2>
  18. <p>
  19. [example:webgl_buffergeometry_rawshader WebGL / buffergeometry / rawshader]<br />
  20. [example:webgl_buffergeometry_instancing_billboards WebGL / buffergeometry / instancing / billboards]<br />
  21. [example:webgl_buffergeometry_instancing_dynamic WebGL / buffergeometry / instancing / dynamic]<br />
  22. [example:webgl_buffergeometry_instancing_interleaved_dynamic WebGL / buffergeometry / instancing / interleaved / dynamic]<br />
  23. [example:webgl_buffergeometry_instancing WebGL / buffergeometry / instancing]<br />
  24. [example:webgl_interactive_instances_gpu WebGL / interactive / instances /gpu]<br />
  25. [example:webgl_raymarching_reflect WebGL / raymarching / reflect]
  26. </p>
  27. <code>
  28. var material = new THREE.RawShaderMaterial( {
  29. uniforms: {
  30. time: { value: 1.0 }
  31. },
  32. vertexShader: document.getElementById( 'vertexShader' ).textContent,
  33. fragmentShader: document.getElementById( 'fragmentShader' ).textContent,
  34. } );
  35. </code>
  36. <h2>Constructor</h2>
  37. <h3>[name]( [param:Object parameters] )</h3>
  38. <p>
  39. [page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
  40. Any property of the material (including any property inherited from [page:Material] and [page:ShaderMaterial]) can be passed in here.<br /><br />
  41. </p>
  42. <h2>Properties</h2>
  43. <p>See the base [page:Material] and [page:ShaderMaterial] classes for common properties.</p>
  44. <h2>Methods</h2>
  45. <p>See the base [page:Material] and [page:ShaderMaterial] classes for common methods.</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>