Files
test2/source/blender/gpu/shaders/gpu_shader_image_frag.glsl
Jeroen Bakker e2dc63c5de Fix #147618: PyGPU incorrect colors when drawing images
644fb2b679 fixed a long standing issue
that offscreen example showed the wrong colors. However the fix assumes
that input texture color space is always sRGB.

This adds a shader variation that draws textures that are stored in scene referred
linear color space (like all of our Image data-block).

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/147788
2025-10-16 19:12:16 +02:00

19 lines
505 B
GLSL

/* SPDX-FileCopyrightText: 2016-2022 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/gpu_shader_3D_image_infos.hh"
FRAGMENT_SHADER_CREATE_INFO(gpu_shader_3D_image)
#include "gpu_shader_colorspace_lib.glsl"
void main()
{
fragColor = texture(image, texCoord_interp);
#ifdef BLENDER_SCENE_LINEAR_TO_REC709
fragColor = blender_scene_linear_to_rec709_srgb(gpu_scene_linear_to_rec709, fragColor);
#endif
fragColor = blender_rec709_srgb_to_output_space(fragColor);
}