Fix Shader compilation error on MacOS & some other platform/driver

texture2D() is no longer supported by modern opengl, use texture() instead.
This commit is contained in:
Clément Foucault 2019-05-14 16:43:37 +02:00
parent 3db428406f
commit 8437519d02
Notes: blender-bot 2023-02-14 11:28:43 +01:00
Referenced by issue #64617, I'm trying to add a background image
Referenced by issue #64598, Add texture paint slot crash
5 changed files with 5 additions and 5 deletions

View File

@ -103,7 +103,7 @@ vec4 texture_read_as_srgb(sampler2D tex, vec2 co)
{
/* By convention image textures return scene linear colors, but
* grease pencil still works in srgb. */
vec4 color = texture2D(tex, co);
vec4 color = texture(tex, co);
color.r = linearrgb_to_srgb(color.r);
color.g = linearrgb_to_srgb(color.g);
color.b = linearrgb_to_srgb(color.b);

View File

@ -61,7 +61,7 @@ vec4 texture_read_as_srgb(sampler2D tex, vec2 co)
{
/* By convention image textures return scene linear colors, but
* grease pencil still works in srgb. */
vec4 color = texture2D(tex, co);
vec4 color = texture(tex, co);
color.r = linearrgb_to_srgb(color.r);
color.g = linearrgb_to_srgb(color.g);
color.b = linearrgb_to_srgb(color.b);

View File

@ -41,7 +41,7 @@ vec4 texture_read_as_srgb(sampler2D tex, vec2 co)
{
/* By convention image textures return scene linear colors, but
* grease pencil still works in srgb. */
vec4 color = texture2D(tex, co);
vec4 color = texture(tex, co);
color.r = linearrgb_to_srgb(color.r);
color.g = linearrgb_to_srgb(color.g);
color.b = linearrgb_to_srgb(color.b);

View File

@ -28,7 +28,7 @@ vec4 texture_read_as_srgb(sampler2D tex, vec2 co)
{
/* By convention image textures return scene linear colors, but
* overlays still assume srgb. */
vec4 color = texture2D(tex, co);
vec4 color = texture(tex, co);
color.r = linearrgb_to_srgb(color.r);
color.g = linearrgb_to_srgb(color.g);
color.b = linearrgb_to_srgb(color.b);

View File

@ -30,7 +30,7 @@ vec4 texture_read_as_srgb(sampler2D tex, vec2 co)
{
/* By convention image textures return scene linear colors, but
* overlays still assume srgb. */
vec4 color = texture2D(tex, co);
vec4 color = texture(tex, co);
color.r = linearrgb_to_srgb(color.r);
color.g = linearrgb_to_srgb(color.g);
color.b = linearrgb_to_srgb(color.b);