RawShaderMaterial.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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>Code Example</h2>
  18. <code>
  19. var 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_dynamic WebGL / buffergeometry / instancing / dynamic]<br />
  32. [example:webgl_buffergeometry_instancing_interleaved_dynamic WebGL / buffergeometry / instancing / interleaved / dynamic]<br />
  33. [example:webgl_buffergeometry_instancing WebGL / buffergeometry / instancing]<br />
  34. [example:webgl_interactive_instances_gpu WebGL / interactive / instances /gpu]<br />
  35. [example:webgl_raymarching_reflect WebGL / raymarching / reflect]
  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 properties defining the material's appearance.
  41. Any property of the material (including any property inherited from [page:Material] and [page:ShaderMaterial]) can be passed in here.<br /><br />
  42. </p>
  43. <h2>Properties</h2>
  44. <p>See the base [page:Material] and [page:ShaderMaterial] classes for common properties.</p>
  45. <h2>Methods</h2>
  46. <p>See the base [page:Material] and [page:ShaderMaterial] classes for common methods.</p>
  47. <h2>Source</h2>
  48. <p>
  49. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  50. </p>
  51. </body>
  52. </html>