Shader.opIndexAssign

Change a color vector parameter of the shader.

It is important to note that the components of the color are normalized before being passed to the shader. Therefore, they are converted from range [0 .. 255] to range [0 .. 1]. For example, a Color(255, 125, 0, 255) will be transformed to a vec4(1.0, 0.5, 0.0, 1.0) in the shader.

  1. void opIndexAssign(float x, const(char)[] name)
  2. void opIndexAssign(const(Vec2) vector, const(char)[] name)
  3. void opIndexAssign(const(Vec3) vector, const(char)[] name)
  4. void opIndexAssign(const(Vec4) vector, const(char)[] name)
  5. void opIndexAssign(int x, const(char)[] name)
  6. void opIndexAssign(const(Ivec2) vector, const(char)[] name)
  7. void opIndexAssign(const(Ivec3) vector, const(char)[] name)
  8. void opIndexAssign(const(Ivec4) vector, const(char)[] name)
  9. void opIndexAssign(bool x, const(char)[] name)
  10. void opIndexAssign(const(Bvec2) vector, const(char)[] name)
  11. void opIndexAssign(const(Bvec3) vector, const(char)[] name)
  12. void opIndexAssign(const(Bvec4) vector, const(char)[] name)
  13. void opIndexAssign(const(Mat3) matrix, const(char)[] name)
  14. void opIndexAssign(const(Mat4) matrix, const(char)[] name)
  15. void opIndexAssign(const(Texture) texture, const(char)[] name)
  16. void opIndexAssign(CurrentTextureType , const(char)[] name)
  17. void opIndexAssign(const(float)[] scalars, const(char)[] name)
  18. void opIndexAssign(const(Vec2)[] vectors, const(char)[] name)
  19. void opIndexAssign(const(Vec3)[] vectors, const(char)[] name)
  20. void opIndexAssign(const(Vec4)[] vectors, const(char)[] name)
  21. void opIndexAssign(const(Mat3)[] matrices, const(char)[] name)
  22. void opIndexAssign(const(Mat4)[] matrices, const(char)[] name)
  23. void opIndexAssign(Color color, const(char)[] name)
    class Shader
    deprecated
    void
    opIndexAssign
    (,
    const(char)[] name
    )
  24. void opIndexAssign(Transform transform, const(char)[] name)
  25. void setParameter(const(char)[] name, Color color)

Parameters

name const(char)[]

The name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x1 vector (vec4 GLSL type).

color Color

Color to assign

Meta