All Questions

Community

S
nodeg

Noob vec4 question

For the uniform line_color, which is a vec4, why is there only one value in the brackets(as opposed to 4), and what is the significance of 1.0 as the value? I mean, I know it means white because of the comment, but how do i know it's white?

uniform vec4 line_color : hint_color = vec4(1.0); // White color
  • Nathan Lovato replied

    This is a shorthand notation for the following, RGB channels all with a value of 1.0 (white), and alpha also with a value of 1.0 (fully opaque).

    vec4(1.0, 1.0, 1.0, 1.0);