File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
tutorials/shaders/shader_reference Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -804,6 +804,18 @@ GDScript:
804804 in the shader. It must match *exactly * to the name of the uniform in
805805 the shader or else it will not be recognized.
806806
807+ .. note :: There is a limit to the total size of shader uniforms that you can use
808+ in a single shader. On most desktop platforms, this limit is ``65536 ``
809+ bytes, or 4096 ``vec4 `` uniforms. On mobile platforms, the limit is
810+ typically ``16384 `` bytes, or 1024 ``vec4 `` uniforms. Vector uniforms
811+ smaller than a ``vec4 ``, such as ``vec2 `` or ``vec3 ``, are padded to
812+ the size of a ``vec4 ``. Scalar uniforms such as ``int `` or ``float ``
813+ are not padded, and ``bool `` is padded to the size of an ``int ``.
814+
815+ Arrays count as the total size of their contents. If you need a uniform
816+ array that is larger than this limit, consider packing the data into a
817+ texture instead, since the *contents * of a texture do not count towards
818+ this limit, only the size of the sampler uniform.
807819
808820Uniform hints
809821~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments