Skip to content

Commit

Permalink
Add ColourMult material variable to more materials
Browse files Browse the repository at this point in the history
  • Loading branch information
rumblesan committed Aug 5, 2021
1 parent 7a4cb0c commit 0fcd624
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion materials/barycentric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ fragmentShader: |
in vec3 Barycentric;
uniform vec4 ColourMult;
out vec4 finalColour;
void main(void) {
finalColour = vec4(Barycentric, 1.0);
finalColour = vec4(Barycentric, 1.0) * ColourMult;
}
3 changes: 2 additions & 1 deletion materials/ceed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ fragmentShader: |
in vec3 Normal;
in vec3 Barycentric;
uniform vec4 ColourMult;
uniform float StrokeSize;
float ssize = StrokeSize / 2;
out vec4 finalColour;
void main(void) {
if(Barycentric.x < ssize || Barycentric.y < ssize || Barycentric.z < ssize) {
finalColour = vec4( 0.5 * Normal + 0.5, 1.0 );
finalColour = vec4( 0.5 * Normal + 0.5, 1.0 ) * ColourMult;
} else {
discard;
}
Expand Down
3 changes: 2 additions & 1 deletion materials/wobbler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fragmentShader: |
uniform float Freq;
uniform float Depth;
uniform float TextureAlpha;
uniform vec4 ColourMult;
out vec4 finalColour;
Expand All @@ -34,5 +35,5 @@ fragmentShader: |
}
void main() {
finalColour = texture(Texture, Texcoord + wobble(Texcoord, Freq)) * vec4(1, 1, 1, TextureAlpha);
finalColour = texture(Texture, Texcoord + wobble(Texcoord, Freq)) * vec4(1, 1, 1, TextureAlpha) * ColourMult;
}

0 comments on commit 0fcd624

Please sign in to comment.