RawShaderMaterial.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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: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 methods.</p>
  44. <h3>[property:Boolean isRawShaderMaterial]</h3>
  45. <p>
  46. Used to check whether this or derived classes are raw shader materials. Default is *true*.<br /><br />
  47. You should not change this, as it used internally for optimisation.
  48. </p>
  49. <h2>Methods</h2>
  50. <p>See the base [page:Material] and [page:ShaderMaterial] classes for common methods.</p>
  51. <h2>Source</h2>
  52. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  53. </body>
  54. </html>