mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Code and content re-work: advanced OpenGL and advanced lighting.
This commit is contained in:
@@ -11,16 +11,16 @@ out vec3 fColor;
|
||||
void build_house(vec4 position)
|
||||
{
|
||||
fColor = gs_in[0].color; // gs_in[0] since there's only one input vertex
|
||||
gl_Position = position + vec4(-0.2f, -0.2f, 0.0f, 0.0f); // 1:bottom-left
|
||||
gl_Position = position + vec4(-0.2, -0.2, 0.0, 0.0); // 1:bottom-left
|
||||
EmitVertex();
|
||||
gl_Position = position + vec4( 0.2f, -0.2f, 0.0f, 0.0f); // 2:bottom-right
|
||||
gl_Position = position + vec4( 0.2, -0.2, 0.0, 0.0); // 2:bottom-right
|
||||
EmitVertex();
|
||||
gl_Position = position + vec4(-0.2f, 0.2f, 0.0f, 0.0f); // 3:top-left
|
||||
gl_Position = position + vec4(-0.2, 0.2, 0.0, 0.0); // 3:top-left
|
||||
EmitVertex();
|
||||
gl_Position = position + vec4( 0.2f, 0.2f, 0.0f, 0.0f); // 4:top-right
|
||||
gl_Position = position + vec4( 0.2, 0.2, 0.0, 0.0); // 4:top-right
|
||||
EmitVertex();
|
||||
gl_Position = position + vec4( 0.0f, 0.4f, 0.0f, 0.0f); // 5:top
|
||||
fColor = vec3(1.0f, 1.0f, 1.0f);
|
||||
gl_Position = position + vec4( 0.0, 0.4, 0.0, 0.0); // 5:top
|
||||
fColor = vec3(1.0, 1.0, 1.0);
|
||||
EmitVertex();
|
||||
EndPrimitive();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user