Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_image_shuffle_color_frag.glsl
| #ifndef USE_GPU_SHADER_CREATE_INFO | |||||
| in vec2 texCoord_interp; | in vec2 texCoord_interp; | ||||
| out vec4 fragColor; | out vec4 fragColor; | ||||
| uniform sampler2D image; | uniform sampler2D image; | ||||
| uniform vec4 color; | uniform vec4 color; | ||||
| uniform vec4 shuffle; | uniform vec4 shuffle; | ||||
| #endif | |||||
| void main() | void main() | ||||
| { | { | ||||
| vec4 sample = texture(image, texCoord_interp); | vec4 sampled_color = texture(image, texCoord_interp); | ||||
| fragColor = vec4(sample.r * shuffle.r + sample.g * shuffle.g + sample.b * shuffle.b + | fragColor = vec4(sampled_color.r * shuffle.r + sampled_color.g * shuffle.g + | ||||
| sample.a * shuffle.a) * | sampled_color.b * shuffle.b + sampled_color.a * shuffle.a) * | ||||
| color; | color; | ||||
| } | } | ||||