|
@@ -17,12 +17,27 @@
|
|
<h2>Constructor</h2>
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
|
|
|
|
- <h3>[name]([page:todo parameters])</h3>
|
|
|
|
|
|
+ <h3>[name]([page:Object parameters])</h3>
|
|
<div>
|
|
<div>
|
|
- parameters -- todo
|
|
|
|
|
|
+ parameters -- An object containing various parameters setting up shaders and their uniforms.
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ <br>
|
|
|
|
+ Example:<br>
|
|
|
|
+ <br>
|
|
|
|
+ uniforms = {
|
|
|
|
+ time: { type: "f", value: 1.0 },
|
|
|
|
+ resolution: { type: "v2", value: new THREE.Vector2() }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ material = new THREE.ShaderMaterial( {
|
|
|
|
+
|
|
|
|
+ uniforms: uniforms,
|
|
|
|
+ vertexShader: document.getElementById( 'vertexShader' ).textContent,
|
|
|
|
+ fragmentShader: document.getElementById( 'fragmentShader' ).textContent
|
|
|
|
+
|
|
|
|
+ } );
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@@ -32,17 +47,17 @@
|
|
|
|
|
|
<h3>.[page:object uniforms]</h3>
|
|
<h3>.[page:object uniforms]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Uniforms defined inside GLSL shader code.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>.[page:string fragmentShader]</h3>
|
|
<h3>.[page:string fragmentShader]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ 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.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>.[page:string vertexShader]</h3>
|
|
<h3>.[page:string vertexShader]</h3>
|
|
<div>
|
|
<div>
|
|
- todo
|
|
|
|
|
|
+ Vertex 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.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>.[page:boolean morphTargets]</h3>
|
|
<h3>.[page:boolean morphTargets]</h3>
|