First adjustments to the Entity System to make it work with different types
This commit is contained in:
@@ -12,6 +12,9 @@ uniform float brightness_add : hint_range(-1.0, 1.0) = 0.0;
|
||||
// Contrast multiplier in RGB space. 1.0 means no change.
|
||||
uniform float contrast_mult : hint_range(0.0, 2.0) = 1.0;
|
||||
|
||||
//Cached Color value to reapply modulate
|
||||
varying vec4 modulate;
|
||||
|
||||
// Converts an RGB color to HSV.
|
||||
vec3 rgb2hsv(vec3 c) {
|
||||
float cMax = max(max(c.r, c.g), c.b);
|
||||
@@ -65,6 +68,10 @@ vec3 hsv2rgb(vec3 c) {
|
||||
return rgb + vec3(m);
|
||||
}
|
||||
|
||||
void vertex(){
|
||||
modulate = COLOR;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// Get the original texture color.
|
||||
vec4 tex_color = texture(TEXTURE, UV);
|
||||
@@ -89,4 +96,6 @@ void fragment() {
|
||||
|
||||
// Output the final color while preserving the original alpha.
|
||||
COLOR = vec4(col, tex_color.a);
|
||||
//reapply vertex color value to keep modulate changes
|
||||
COLOR = COLOR * modulate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user