Is it possible to pass custom attributes to a fragment shader, i know i can pass attributes via GLES20.glVertexAttribPointer to the vertex shader, but how can i pass a float[] to the fragment shader?
Is it possible to pass custom attributes to a fragment shader, i know i
Share
No.
If you want to pass uniforms to a fragment shader, you can easily do that (see any tutorial). But if you want something similar to the per-vertex attributes, then it makes no sense to do that. What you can also do is pass attributes to the vertex shader, and then in the vertex shader pass them through to the fragment shader as varyings. They will be interpolated across the primitive and provided as inputs to the fragment shader.