WebGLProgram.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. <h1>[name]</h1>
  11. <div class="desc">Constructor for the GLSL program sent to vertex and fragment shaders, including default uniforms and attributes.</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]( [page:WebGLRenderer renderer], [page:Object code], [page:Material material], [page:Object parameters] )</h3>
  14. <div>For parameters see [page:WebGLRenderer WebGLRenderer]</div>
  15. <div>Standard defaults for vertex shader:<br/><br/>
  16. uniform mat4 modelMatrix;<br/>
  17. uniform mat4 modelViewMatrix;<br/>
  18. uniform mat4 projectionMatrix;<br/>
  19. uniform mat4 viewMatrix;<br/>
  20. uniform mat3 normalMatrix;<br/>
  21. uniform vec3 cameraPosition;<br/><br/>
  22. attribute vec3 position;<br/>
  23. attribute vec3 normal;<br/>
  24. attribute vec2 uv;<br/>
  25. attribute vec2 uv2;</div>
  26. <div>Conditional defaults for vertex shader:<br/><br/>
  27. attribute vec3 color;<br/><br/>
  28. attribute vec3 morphTarget0;<br/>
  29. attribute vec3 morphTarget1;<br/>
  30. attribute vec3 morphTarget2;<br/>
  31. attribute vec3 morphTarget3;<br/><br/>
  32. attribute vec3 morphNormal0;<br/>
  33. attribute vec3 morphNormal1;<br/>
  34. attribute vec3 morphNormal2;<br/>
  35. attribute vec3 morphNormal3;<br/><br/>
  36. attribute vec3 morphTarget4;<br/>
  37. attribute vec3 morphTarget5;<br/>
  38. attribute vec3 morphTarget6;<br/>
  39. attribute vec3 morphTarget7;<br/><br/>
  40. attribute vec4 skinIndex;<br/>
  41. attribute vec4 skinWeight;</div>
  42. <div>Standard defaults for fragment shader:<br/><br/>
  43. uniform mat4 viewMatrix;<br/>
  44. uniform vec3 cameraPosition;</div>
  45. <h2>Properties</h2>
  46. <h3>.[page:Object uniforms]</h3>
  47. <div></div>
  48. <h3>.[page:Object attributes]</h3>
  49. <div></div>
  50. <h3>.[page:Integer id]</h3>
  51. <div></div>
  52. <h3>.[page:Object code]</h3>
  53. <div></div>
  54. <h3>.[page:Integer usedTimes]</h3>
  55. <div></div>
  56. <h3>.[page:Object program]</h3>
  57. <div></div>
  58. <h3>.[page:Object vertexShader]</h3>
  59. <div></div>
  60. <h3>.[page:Object fragmentShader]</h3>
  61. <div></div>
  62. <h2>Methods</h2>
  63. <h3>none</h3>
  64. <div></div>
  65. <h2>Source</h2>
  66. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  67. </body>
  68. </html>