mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-19 22:44:59 +01:00
The sides of the trackbed (and grass, fences, foliage) are cut out of their textures by the alpha test, which keeps or drops whole pixels, so their edges stayed jagged at any multisampling level; only geometry edges got smoothed. With multisampling on, the alpha tested materials of the opaque colour pass now draw with GL_SAMPLE_ALPHA_TO_COVERAGE. Their shaders do the alpha test with alpha_test_fail() of glsl_common and write as alpha the coverage of the test edge: the alpha sharpened around the opacity threshold to go from 0 to 1 over about a pixel, so the edge keeps the place it had and gets the samples it covers. The renderer turns alpha to coverage on per material, only for shaders which use the helper and only in the opaque pass with a positive opacity, so translucent, water, terrain and the other shaders are unchanged. Without multisampling the shaders work as before.
16 lines
317 B
C
16 lines
317 B
C
#pragma once
|
|
struct _global
|
|
{
|
|
bool gfx_shadowmap_enabled;
|
|
bool gfx_envmap_enabled;
|
|
bool gfx_postfx_motionblur_enabled;
|
|
bool gfx_skippipeline;
|
|
bool gfx_extraeffects;
|
|
bool gfx_shadergamma;
|
|
bool gfx_usegles;
|
|
int iMultisampling;
|
|
};
|
|
|
|
extern _global Global;
|
|
|