#version 400 compatibility
#define WORLD_END
#define PROGRAM_GBUFFERS_ENTITIES
#define fsh

#include "/program/gbuffers_all_solid.fsh"  // Ez a fontos rész!
#include "/include/misc/end_effects.glsl"

void main() {
    vec4 color = texture2D(texture, texcoord) * glcolor;
    
    #ifdef WORLD_END
    if (entityId == END_ENDERMAN_ID) {
        // Enderman szem effekt
        if (color.r > 0.5 && color.g < 0.1) { // Ez detektálja a szemet
            vec3 eye_glow = get_enderman_eyes(position_scene, normalize(-position_scene));
            color.rgb = eye_glow;
        }
    }
    else if (entityId == END_CRYSTAL_ID) {
        vec3 crystal_effect = get_end_crystal_effects(position_scene, normalize(-position_scene));
        color.rgb += crystal_effect;
        
        // Heat distortion
        vec2 distortion = get_crystal_distortion(position_scene);
        position_screen.xy += distortion;
    }
    #endif

    gl_FragData[0] = color;
} 