-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6594d7
commit fc4c8d5
Showing
5 changed files
with
31 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
export const BLEND = { | ||
NORMAL: ` | ||
NORMAL: /* glsl */ ` | ||
vec3 blendNormal(vec3 base, vec3 blend) { | ||
return blend; | ||
} | ||
vec3 blendNormal(vec3 base, vec3 blend, float opacity) { | ||
return (blendNormal(base, blend) * opacity + base * (1.0 - opacity)); | ||
}`, | ||
COLOR_DODGE: /* glsl */ ` | ||
float blendColorDodge(float base, float blend) { | ||
return (blend==1.0)?blend:min(base/(1.0-blend),1.0); | ||
} | ||
vec3 blendColorDodge(vec3 base, vec3 blend) { | ||
return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b)); | ||
} | ||
vec3 blendColorDodge(vec3 base, vec3 blend, float opacity) { | ||
return (blendColorDodge(base, blend) * opacity + base * (1.0 - opacity)); | ||
} | ||
`, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
export const FUNCTIONS = { | ||
PI: `#define PI 3.14159265359`, | ||
MAP_RANGE: ` | ||
PI: /* glsl */ `#define PI 3.14159265359`, | ||
MAP_RANGE: /* glsl */ ` | ||
float mapRange(float min1, float max1,float value, float min2, float max2) { | ||
return min2 + (value - min1) * (max2 - min2) / (max1 - min1); | ||
}`, | ||
GREYSCALE: ` | ||
GREYSCALE: /* glsl */ ` | ||
vec3 greyscale(vec3 color) { | ||
float average = (color.r + color.g + color.b) / 3.; | ||
return vec3(average); | ||
}`, | ||
RANDOM: /* glsl */ ` | ||
float random(vec2 st) { | ||
return fract(sin(dot(st.xy, | ||
vec2(12.9898,78.233)))* | ||
43758.5453123); | ||
}`, | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.