Passing own struct into opengl es 2.0 shader
问题 I want to try a lighting example from the book OpenGL ES 2.0 Programming Guide. In the shader they have made two structures. struct directional_light { vec3 direction; // normalized light direction in eye space vec3 halfplane; // normalized half-plane vector vec4 ambient_color; vec4 diffuse_color; vec4 specular_color; }; struct material_properties { vec4 ambient_color; vec4 diffuse_color; vec4 specular_color; float specular_exponent; }; They have also made two uniforms, based on these