ShaderMaterial.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  6. <script src="../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../page.css" />
  8. </head>
  9. <body>
  10. [page:Material] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">Material rendered with custom shaders</div>
  13. <h2>Constructor</h2>
  14. <h3>[name]([page:Object parameters])</h3>
  15. <div>
  16. parameters -- An object containing various parameters setting up shaders and their uniforms.
  17. </div>
  18. <div>
  19. <br>
  20. Example:<br>
  21. <br>
  22. <pre>
  23. <code>
  24. uniforms = {
  25. time: { type: "f", value: 1.0 },
  26. resolution: { type: "v2", value: new THREE.Vector2() }
  27. };
  28. material = new THREE.ShaderMaterial( {
  29. uniforms: uniforms,
  30. vertexShader: document.getElementById( 'vertexShader' ).textContent,
  31. fragmentShader: document.getElementById( 'fragmentShader' ).textContent
  32. } );
  33. </code>
  34. </pre>
  35. </div>
  36. <h2>Properties</h2>
  37. <h3>.[page:object uniforms]</h3>
  38. <div>
  39. Uniforms defined inside GLSL shader code.
  40. </div>
  41. <h3>.[page:string fragmentShader]</h3>
  42. <div>
  43. Fragment shader GLSL code. This is the actual code for the shader. In the example above the code is retrieved from DOM elements emnbedded directly in the page although other methods can be used including specifying a string directly.
  44. </div>
  45. <h3>.[page:string vertexShader]</h3>
  46. <div>
  47. Vertex shader GLSL code. This is the actual code for the shader. In the example above the code is retrieved from DOM elements embedded directly in the page although other methods can be used including specifying a string directly.
  48. </div>
  49. <h3>.[page:boolean morphTargets]</h3>
  50. <div>
  51. todo
  52. </div>
  53. <h3>.[page:boolean lights]</h3>
  54. <div>
  55. todo
  56. </div>
  57. <h3>.[page:boolean morphNormals]</h3>
  58. <div>
  59. todo
  60. </div>
  61. <h3>.[page:boolean wireframe]</h3>
  62. <div>
  63. todo
  64. </div>
  65. <h3>.[page:number vertexColors]</h3>
  66. <div>
  67. todo
  68. </div>
  69. <h3>.[page:boolean skinning]</h3>
  70. <div>
  71. todo
  72. </div>
  73. <h3>.[page:boolean fog]</h3>
  74. <div>
  75. todo
  76. </div>
  77. <h3>.[page:object attributes]</h3>
  78. <div>
  79. todo
  80. </div>
  81. <h3>.[page:number shading]</h3>
  82. <div>
  83. todo
  84. </div>
  85. <h3>.[page:number linewidth]</h3>
  86. <div>
  87. todo
  88. </div>
  89. <h3>.[page:number wireframeLinewidth]</h3>
  90. <div>
  91. todo
  92. </div>
  93. <h3>.[page:object defines]</h3>
  94. <div>
  95. todo
  96. </div>
  97. <h2>Methods</h2>
  98. <h2>Source</h2>
  99. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  100. </body>
  101. </html>