mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-21 07:19:30 -07:00
Separated cursor and glint intensities from their colors, which can now safely reside in their color spaces.
This commit is contained in:
@@ -7,6 +7,7 @@ uniform sampler2D paletteTex;
|
||||
uniform float ditherMagnitude;
|
||||
uniform float time;
|
||||
uniform vec3 backgroundColor, cursorColor, glintColor;
|
||||
uniform float cursorIntensity, glintIntensity;
|
||||
varying vec2 vUV;
|
||||
|
||||
highp float rand( const in vec2 uv, const in float t ) {
|
||||
@@ -30,8 +31,8 @@ void main() {
|
||||
// Map the brightness to a position in the palette texture
|
||||
gl_FragColor = vec4(
|
||||
texture2D( paletteTex, vec2(brightness.r, 0.0)).rgb
|
||||
+ min(cursorColor * brightness.g, vec3(1.0))
|
||||
+ min(glintColor * brightness.b, vec3(1.0))
|
||||
+ min(cursorColor * cursorIntensity * brightness.g, vec3(1.0))
|
||||
+ min(glintColor * glintIntensity * brightness.b, vec3(1.0))
|
||||
+ backgroundColor,
|
||||
1.0
|
||||
);
|
||||
|
||||
@@ -7,6 +7,7 @@ uniform sampler2D stripeTex;
|
||||
uniform float ditherMagnitude;
|
||||
uniform float time;
|
||||
uniform vec3 backgroundColor, cursorColor, glintColor;
|
||||
uniform float cursorIntensity, glintIntensity;
|
||||
varying vec2 vUV;
|
||||
|
||||
highp float rand( const in vec2 uv, const in float t ) {
|
||||
@@ -31,8 +32,8 @@ void main() {
|
||||
|
||||
gl_FragColor = vec4(
|
||||
color * brightness.r
|
||||
+ min(cursorColor * brightness.g, vec3(1.0))
|
||||
+ min(glintColor * brightness.b, vec3(1.0))
|
||||
+ min(cursorColor * cursorIntensity * brightness.g, vec3(1.0))
|
||||
+ min(glintColor * glintIntensity * brightness.b, vec3(1.0))
|
||||
+ backgroundColor,
|
||||
1.0
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user