Skip to content

Commit

Permalink
Update fxaa.fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnik-dmitry07 committed Apr 13, 2020
1 parent 5483105 commit 049479b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions postprocessing/src/main/resources/shaders/fxaa.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ uniform float FXAA_SPAN_MAX;

varying vec2 v_texCoords;

vec4 fxaa(sampler2D texture, vec2 texCoords, vec2 viewportInv) {
vec3 rgbNW = texture2D(texture,
vec4 fxaa(sampler2D texture_, vec2 texCoords, vec2 viewportInv) {
vec3 rgbNW = texture2D(texture_,
texCoords.xy + (vec2(-1.0, -1.0) * viewportInv)).xyz;
vec3 rgbNE = texture2D(texture,
vec3 rgbNE = texture2D(texture_,
texCoords.xy + (vec2(+1.0, -1.0) * viewportInv)).xyz;
vec3 rgbSW = texture2D(texture,
vec3 rgbSW = texture2D(texture_,
texCoords.xy + (vec2(-1.0, +1.0) * viewportInv)).xyz;
vec3 rgbSE = texture2D(texture,
vec3 rgbSE = texture2D(texture_,
texCoords.xy + (vec2(+1.0, +1.0) * viewportInv)).xyz;
vec3 rgbM = texture2D(texture, texCoords.xy).xyz;
vec3 rgbM = texture2D(texture_, texCoords.xy).xyz;

vec3 luma = vec3(0.299, 0.587, 0.114);
float lumaNW = dot(rgbNW, luma);
Expand Down Expand Up @@ -55,16 +55,16 @@ vec4 fxaa(sampler2D texture, vec2 texCoords, vec2 viewportInv) {

vec3 rgbA =
(1.0 / 2.0)
* (texture2D(texture,
* (texture2D(texture_,
texCoords.xy + dir * (1.0 / 3.0 - 0.5)).xyz
+ texture2D(texture,
+ texture2D(texture_,
texCoords.xy + dir * (2.0 / 3.0 - 0.5)).xyz);
vec3 rgbB =
rgbA * (1.0 / 2.0)
+ (1.0 / 4.0)
* (texture2D(texture,
* (texture2D(texture_,
texCoords.xy + dir * (0.0 / 3.0 - 0.5)).xyz
+ texture2D(texture,
+ texture2D(texture_,
texCoords.xy
+ dir * (3.0 / 3.0 - 0.5)).xyz);
float lumaB = dot(rgbB, luma);
Expand Down

0 comments on commit 049479b

Please sign in to comment.