Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The uniforms you can use in your shaders all depend on how you setup your material: have you enable lights ? vertex colors ? skinning ? ...</p> <p>Three JS creates a program that depends heavily on some defines (#ifdef in the code) that are injected at the top of the program depending on the parameters I have spoken about above.</p> <p>I found the best way to know what is going on is to print the shaders that three JS generates: as you already know GLSL, you will understand easily what the code means and what uniforms you can use. Look for <code>buildProgram</code> in three JS sources, then (r57):</p> <pre><code>var glFragmentShader = getShader( "fragment", prefix_fragment + fragmentShader ); var glVertexShader = getShader( "vertex", prefix_vertex + vertexShader ); </code></pre> <p>After those lines, add:</p> <pre><code>console.log("fragment shader:", prefix_fragment + fragmentShader); console.log("vertex shader:", prefix_vertex + vertexShader); </code></pre> <p>And you will be able to see the content of the shaders.</p> <p>[EDIT] Rereading your question, I realize I answered a bit off, as you create your own shaders... </p> <p>You can have a look at lines 6463 and 6490 of WebGLRenderer (<a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/WebGLRenderer.js#L6463">https://github.com/mrdoob/three.js/blob/master/src/renderers/WebGLRenderer.js#L6463</a>): you will see standard uniforms / attributes that three JS inject in your shaders. You can have a look to the Wiki where you have an entry about that (<a href="https://github.com/mrdoob/three.js/wiki">https://github.com/mrdoob/three.js/wiki</a> - Which default attributes / uniforms / varyings are available in custom shaders?) but it directs you to the lines I outlined above.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload