I have something like this:
render_mode blend_mix,depth_draw_opaque,depth_prepass_alpha,cull_disabled;
void fragment() {
vec3 worldPos = (inverse(MODEL_MATRIX) * INV_VIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
vec3 playerPos = vec3(-0.5f, 0.2f, -1.0f);
float radius = 2.0f;
if (worldPos.y > playerPos.y)
if (abs(worldPos.x - playerPos.x) < radius && abs(worldPos.z - playerPos.z) < radius)
ALPHA = 0.0f;
}
But how do i apply this to every material? Next pass is not working because it does not change the transparency and the color at the same time. And when i export a model from blender into gltf/glb the material gets overriden again...