From 2f1021f95589b7af1e63569be83bde2a4f812fd8 Mon Sep 17 00:00:00 2001 From: Songtronix Date: Sun, 9 Jun 2019 20:20:29 +0200 Subject: [PATCH] Replace texture2D with texture to fix MacOS crash --- voxygen/shaders/postprocess.frag | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/voxygen/shaders/postprocess.frag b/voxygen/shaders/postprocess.frag index 62bd919f91..5e56224797 100644 --- a/voxygen/shaders/postprocess.frag +++ b/voxygen/shaders/postprocess.frag @@ -74,11 +74,11 @@ vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution, vec2 v_rgbM) { vec4 color; mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y); - vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; - vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; - vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; - vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; - vec4 texColor = texture2D(tex, v_rgbM); + vec3 rgbNW = texture(tex, v_rgbNW).xyz; + vec3 rgbNE = texture(tex, v_rgbNE).xyz; + vec3 rgbSW = texture(tex, v_rgbSW).xyz; + vec3 rgbSE = texture(tex, v_rgbSE).xyz; + vec4 texColor = texture(tex, v_rgbM); vec3 rgbM = texColor.xyz; vec3 luma = vec3(0.299, 0.587, 0.114); float lumaNW = dot(rgbNW, luma); @@ -102,11 +102,11 @@ vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution, dir * rcpDirMin)) * inverseVP; vec3 rgbA = 0.5 * ( - texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + - texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); + texture(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + + texture(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); vec3 rgbB = rgbA * 0.5 + 0.25 * ( - texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + - texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); + texture(tex, fragCoord * inverseVP + dir * -0.5).xyz + + texture(tex, fragCoord * inverseVP + dir * 0.5).xyz); float lumaB = dot(rgbB, luma); if ((lumaB < lumaMin) || (lumaB > lumaMax))