Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
midway through adding the polygon and leaf stuff to the forest class,
it's not running atm though :/
- Loading branch information
1 parent
392999f
commit 511b26e
Showing
15 changed files
with
329 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#version 330 core | ||
|
||
in vec2 UV; | ||
|
||
uniform sampler2D textureMap; | ||
|
||
/// @brief our output fragment colour | ||
layout (location =0)out vec4 fragColour; | ||
|
||
void main () | ||
{ | ||
fragColour = texture(textureMap, UV); | ||
fragColour.a = step(0.0000000000001, fragColour.r+fragColour.g+fragColour.b); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#version 330 core | ||
|
||
layout (points) in; | ||
layout (triangle_strip, max_vertices=4) out; | ||
|
||
in vec4 dir[1]; | ||
in vec4 right[1]; | ||
|
||
uniform mat4 MVP; | ||
|
||
out vec2 UV; | ||
|
||
void main () | ||
{ | ||
gl_Position = gl_in[0].gl_Position + 0.5*right[0]; | ||
UV = vec2(1,0); | ||
EmitVertex(); | ||
|
||
gl_Position = gl_in[0].gl_Position + 0.5*right[0] + dir[0]; | ||
UV = vec2(1,1); | ||
EmitVertex(); | ||
|
||
gl_Position = gl_in[0].gl_Position - 0.5*right[0]; | ||
UV = vec2(0,0); | ||
EmitVertex(); | ||
|
||
gl_Position = gl_in[0].gl_Position - 0.5*right[0] + dir[0]; | ||
UV = vec2(0,1); | ||
EmitVertex(); | ||
|
||
EndPrimitive(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#version 330 core | ||
|
||
/// @brief the vertex passed in | ||
layout(location =0)in vec3 inVert; | ||
layout(location =1)in mat4 inTransform; | ||
layout(location =5)in vec3 inDir; | ||
layout(location =6)in vec3 inRight; | ||
|
||
uniform mat4 MVP; | ||
//out vec3 vertColour; | ||
out vec4 dir; | ||
out vec4 right; | ||
|
||
void main() | ||
{ | ||
gl_Position = MVP * inTransform * vec4(inVert,1.0); | ||
dir = MVP * inTransform * vec4(inDir,0); | ||
right = MVP * inTransform * vec4(inRight,0); | ||
//vertColour = vec3(1,0,0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#version 330 core | ||
|
||
in vec3 vertColour; | ||
|
||
/// @brief our output fragment colour | ||
layout (location =0)out vec4 fragColour; | ||
|
||
void main () | ||
{ | ||
fragColour = vec4(vertColour,1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#version 330 core | ||
|
||
/// @brief the vertex passed in | ||
layout(location =0)in vec3 inVert; | ||
layout(location =1)in mat4 inTransform; | ||
|
||
uniform mat4 MVP; | ||
out vec3 vertColour; | ||
|
||
void main() | ||
{ | ||
gl_Position = MVP * inTransform * vec4(inVert,1.0); | ||
vertColour = vec3(0.3,0.3,0.3); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.