You are currently viewing the gmlscripts.pro static mirror. Forum access and script submissions are not available through this mirror.

Invert gmlscripts.pro

shader_set_uniform_color

This is a simple utility function to help set shader colors just a tiny bit more easily. It takes a standard GM:Studio Color and Alpha values as arguments.

shader_set_uniform_color(uniform,color,alpha)
Sets a vec4 shader uniform with a color and alpha value.
COPY
  1. /// shader_set_uniform_color(uniform,color,alpha)
  2. //
  3. // Sets a vec4 shader uniform with a color and alpha value.
  4. //
  5. // uniform shader uniform handle, integer
  6. // color standard GM color value, integer
  7. // alpha alpha in [0,1] range, real
  8. //
  9. /// gmlscripts.pro/license
  10. {
  11. shader_set_uniform_f(argument0,
  12. color_get_red(argument1) / 255,
  13. color_get_green(argument1) / 255,
  14. color_get_blue(argument1) / 255,
  15. argument2);
  16. return 0;
  17. }

Contributors: xot

GitHub: View · Commits · Blame · Raw