Opengl, Computer Graphics, Shaders, Texture, Shading.
normalization, Finally we get a normal vector of triangle! 2. Specifying light source (static) For each light source, we can set an RGBA. vec4 diffuse0 = vec4(1.0, 0.0, 0.0, 1.0); vec4 ambient0 = vec4(1.0, 0.0, 0.0, 1.0); vec4 specular0= vec4(1.0, 0.0, 0.0, 1.0); vec4 light_pos = vec4(1.0, 2.0,