Explorar el Código

Added note on custom shader constants and go.get

Fixes #302
Björn Ritzl hace 2 años
padre
commit
aa96d5ace8
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      docs/en/manuals/material.md

+ 4 - 0
docs/en/manuals/material.md

@@ -78,6 +78,10 @@ go.set("#sprite", "tint", vmath.vector4(1,0,0,1))
 go.animate("#sprite", "tint", go.PLAYBACK_LOOP_PINGPONG, vmath.vector4(1,0,0,1), go.EASING_LINEAR, 2)
 ```
 
+::: sidenote
+In order for a material constant of type `CONSTANT_TYPE_USER` to be available using `go.get()` and `go.set()` it has to be used in the shader program. If the constant is defined in the material but not used in the program it will be removed from the material and it will not be available at run-time.
+:::
+
 ## Samplers
 
 Samplers are used to sample the color information from a texture (a tile source or atlas). The color information can then be used for calculations in the shader program.