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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user