Skip to main content
edited body
Source Link
Daniel_1985
  • 629
  • 1
  • 4
  • 19

With the help of Bálint, I successfully got the issue fixed.

Bálint suggested using the discard keyword in GLSL to discard pixels that are not visible (i.e, transparent).

So inside my fragment shader, I'm checking the pixel's alpha value and if it's below a certain threshold, the pixel is discarded and therefore not rendered.

vec4 PixelColor = texture2D(Colormap, FragmentUV);

if(PixelColor.a < 0.1)
    discard;

Result:

enter image description hereenter image description here

With the help of Bálint, I successfully got the issue fixed.

Bálint suggested using the discard keyword in GLSL to discard pixels that are not visible (i.e, transparent).

So inside my fragment shader, I'm checking the pixel's alpha value and if it's below a certain threshold, the pixel is discarded and therefore not rendered.

vec4 PixelColor = texture2D(Colormap, FragmentUV);

if(PixelColor.a < 0.1)
    discard;

Result:

enter image description here

With the help of Bálint, I successfully got the issue fixed.

Bálint suggested using the discard keyword in GLSL to discard pixels that are not visible (i.e, transparent).

So inside my fragment shader, I'm checking the pixel's alpha value and if it's below a certain threshold, the pixel is discarded and therefore not rendered.

vec4 PixelColor = texture2D(Colormap, FragmentUV);

if(PixelColor.a < 0.1)
    discard;

Result:

enter image description here

Source Link
Daniel_1985
  • 629
  • 1
  • 4
  • 19

With the help of Bálint, I successfully got the issue fixed.

Bálint suggested using the discard keyword in GLSL to discard pixels that are not visible (i.e, transparent).

So inside my fragment shader, I'm checking the pixel's alpha value and if it's below a certain threshold, the pixel is discarded and therefore not rendered.

vec4 PixelColor = texture2D(Colormap, FragmentUV);

if(PixelColor.a < 0.1)
    discard;

Result:

enter image description here