ShaderMaterial.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. uniforms = {
  23. time: { type: "f", value: 1.0 },
  24. resolution: { type: "v2", value: new THREE.Vector2() }
  25. };
  26. material = new THREE.ShaderMaterial( {
  27. uniforms: uniforms,
  28. vertexShader: document.getElementById( 'vertexShader' ).textContent,
  29. fragmentShader: document.getElementById( 'fragmentShader' ).textContent
  30. } );
  31. </div>
  32. <h2>Properties</h2>
  33. <h3>.[page:object uniforms]</h3>
  34. <div>
  35. Uniforms defined inside GLSL shader code.
  36. </div>
  37. <h3>.[page:string fragmentShader]</h3>
  38. <div>
  39. 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.
  40. </div>
  41. <h3>.[page:string vertexShader]</h3>
  42. <div>
  43. 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.
  44. </div>
  45. <h3>.[page:boolean morphTargets]</h3>
  46. <div>
  47. todo
  48. </div>
  49. <h3>.[page:boolean lights]</h3>
  50. <div>
  51. todo
  52. </div>
  53. <h3>.[page:boolean morphNormals]</h3>
  54. <div>
  55. todo
  56. </div>
  57. <h3>.[page:boolean wireframe]</h3>
  58. <div>
  59. todo
  60. </div>
  61. <h3>.[page:number vertexColors]</h3>
  62. <div>
  63. todo
  64. </div>
  65. <h3>.[page:boolean skinning]</h3>
  66. <div>
  67. todo
  68. </div>
  69. <h3>.[page:boolean fog]</h3>
  70. <div>
  71. todo
  72. </div>
  73. <h3>.[page:object attributes]</h3>
  74. <div>
  75. todo
  76. </div>
  77. <h3>.[page:number shading]</h3>
  78. <div>
  79. todo
  80. </div>
  81. <h3>.[page:number linewidth]</h3>
  82. <div>
  83. todo
  84. </div>
  85. <h3>.[page:number wireframeLinewidth]</h3>
  86. <div>
  87. todo
  88. </div>
  89. <h3>.[page:object defines]</h3>
  90. <div>
  91. todo
  92. </div>
  93. <h2>Methods</h2>
  94. <h2>Source</h2>
  95. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  96. </body>
  97. </html>