Created
August 20, 2019 11:23
-
-
Save ydaniv/9638bb44f19187e7649c9deffb681c2a to your computer and use it in GitHub Desktop.
Introducing Kampos examples :: duotone simplified
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
export default function () { | |
return { | |
fragment: { | |
uniform: { | |
u_light: 'vec3', | |
u_dark: 'vec3' | |
}, | |
main: `vec3 gray = vec3(dot(lumcoeff, color)); | |
color = mix(u_dark, u_light, gray);` | |
uniforms: [ | |
// Light tone | |
{ | |
name: 'u_light', | |
type: 'f', | |
data: [1.0, 1.0, 1.0] | |
}, | |
// Dark tone | |
{ | |
name: 'u_dark', | |
type: 'f', | |
data: [0.0, 0.0, 0.0] | |
} | |
] | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment