瀏覽代碼

Added note on custom shader constants and go.get

Fixes #302
Björn Ritzl 2 年之前
父節點
當前提交
aa96d5ace8
共有 1 個文件被更改,包括 4 次插入0 次删除
  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.