Skip to content

Commit e95a3b4

Browse files
authored
Merge pull request #15 from paddy-exe/rename-dissolve-blend-input
Remove uv inputs from blend modes and renamed Color Conversion
2 parents f31f175 + fca39b6 commit e95a3b4

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ All these shader functions are based on publicly available shader functions (ope
5656
* `blend_hard_mix`
5757
* `blend_exclusion`
5858

59-
#### Color Conversion
59+
#### Color Adjustment
6060
* `greyscale`
6161
* `hsv_to_rgb`
6262
* `rgb_to_hsv`

addons/ShaderFunction-Extras/Color/blend_modes.gdshaderinc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ vec3 blend_normal(vec3 c1, vec3 c2, float opacity) {
44
return opacity*c1 + (1.0-opacity)*c2;
55
}
66

7-
vec3 blend_dissolve(vec2 uv, vec3 c1, vec3 c2, float opacity) {
8-
if (random_range(vec3(uv, 1.0), 0.0, 1.0) < opacity) {
7+
vec3 blend_dissolve(vec3 seed, vec3 c1, vec3 c2, float opacity) {
8+
if (random_range(vec3(seed), 0.0, 1.0) < opacity) {
99
return c1;
1010
} else {
1111
return c2;
@@ -16,7 +16,7 @@ vec3 blend_multiply(vec3 c1, vec3 c2, float opacity) {
1616
return opacity*c1*c2 + (1.0-opacity)*c2;
1717
}
1818

19-
vec3 blend_screen(vec2 uv, vec3 c1, vec3 c2, float opacity) {
19+
vec3 blend_screen(vec3 c1, vec3 c2, float opacity) {
2020
return opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2;
2121
}
2222

@@ -88,15 +88,15 @@ float blend_vivid_light_f(float c1, float c2) {
8888
return (c1 < 0.5) ? 1.0 - (1.0 - c2) / (2.0 * c1) : c2 / (2.0 * (1.0 - c1));
8989
}
9090

91-
vec3 blend_vivid_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {
91+
vec3 blend_vivid_light(vec3 c1, vec3 c2, float opacity) {
9292
return opacity*vec3(blend_vivid_light_f(c1.x, c2.x), blend_vivid_light_f(c1.y, c2.y), blend_vivid_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;
9393
}
9494

9595
float blend_pin_light_f( float c1, float c2) {
9696
return (2.0 * c1 - 1.0 > c2) ? 2.0 * c1 - 1.0 : ((c1 < 0.5 * c2) ? 2.0 * c1 : c2);
9797
}
9898

99-
vec3 blend_pin_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {
99+
vec3 blend_pin_light(vec3 c1, vec3 c2, float opacity) {
100100
return opacity*vec3(blend_pin_light_f(c1.x, c2.x), blend_pin_light_f(c1.y, c2.y), blend_pin_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;
101101
}
102102

addons/ShaderFunction-Extras/Color/color_conversion.gdshaderinc renamed to addons/ShaderFunction-Extras/Color/color_adjustment.gdshaderinc

File renamed without changes.

0 commit comments

Comments
 (0)