From 0fcd62473ded12ac2e894293734d205ff55b3d48 Mon Sep 17 00:00:00 2001 From: Guy John Date: Thu, 15 Jul 2021 11:56:25 +0100 Subject: [PATCH] Add ColourMult material variable to more materials --- materials/barycentric.yaml | 4 +++- materials/ceed.yaml | 3 ++- materials/wobbler.yaml | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/materials/barycentric.yaml b/materials/barycentric.yaml index 6684830..000f9fb 100644 --- a/materials/barycentric.yaml +++ b/materials/barycentric.yaml @@ -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; } diff --git a/materials/ceed.yaml b/materials/ceed.yaml index 0540305..dd0bd06 100644 --- a/materials/ceed.yaml +++ b/materials/ceed.yaml @@ -22,6 +22,7 @@ fragmentShader: | in vec3 Normal; in vec3 Barycentric; + uniform vec4 ColourMult; uniform float StrokeSize; float ssize = StrokeSize / 2; @@ -29,7 +30,7 @@ fragmentShader: | 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; } diff --git a/materials/wobbler.yaml b/materials/wobbler.yaml index e4c32b2..5cb94c9 100644 --- a/materials/wobbler.yaml +++ b/materials/wobbler.yaml @@ -24,6 +24,7 @@ fragmentShader: | uniform float Freq; uniform float Depth; uniform float TextureAlpha; + uniform vec4 ColourMult; out vec4 finalColour; @@ -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; }