Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_image_overlays_merge_frag.glsl
| /* Merge overlays texture on top of image texture and transform to display space (assume sRGB) */ | /* Merge overlays texture on top of image texture and transform to display space (assume sRGB) */ | ||||
| #ifndef USE_GPU_SHADER_CREATE_INFO | |||||
| uniform sampler2D image_texture; | uniform sampler2D image_texture; | ||||
| uniform sampler2D overlays_texture; | uniform sampler2D overlays_texture; | ||||
| uniform bool display_transform; | uniform bool display_transform; | ||||
| uniform bool overlay; | uniform bool overlay; | ||||
| in vec2 texCoord_interp; | in vec2 texCoord_interp; | ||||
| out vec4 fragColor; | out vec4 fragColor; | ||||
| #endif | |||||
| float linearrgb_to_srgb(float c) | float linearrgb_to_srgb(float c) | ||||
| { | { | ||||
| if (c < 0.0031308) { | if (c < 0.0031308) { | ||||
| return (c < 0.0) ? 0.0 : c * 12.92; | return (c < 0.0) ? 0.0 : c * 12.92; | ||||
| } | } | ||||
| else { | else { | ||||
| return 1.055 * pow(c, 1.0 / 2.4) - 0.055; | return 1.055 * pow(c, 1.0 / 2.4) - 0.055; | ||||
| Show All 26 Lines | |||||