     return mix(intensity, rgb, adjustment);
 }
 
-void main() {
-    // Nota: NON SETTARE MAI METALNESS O ROUGHNESS A 0.0
-
+vec4 getAlbedo() {
     #ifdef defAlbedo
         LOWP vec4 albedo = texture(u_albedo, fract(v_texCoord / u_albedoTiles));
         if (albedo.a < 0.01) discard;

        LOWP vec3 N = normalize(v_normal);
    #endif

    LOWP vec3 V = normalize(-v_position);
    LOWP vec3 R = reflect(-V, N);
    R = vec3(inverse(u_viewMatrix) * vec4(R, 0.0));

    LOWP vec3 F0 = vec3(0.04);
    F0 = mix(F0, albedo.rgb, metalness);

    LOWP vec3 Lo = vec3(0.0);

    #ifdef lights
        LOWP int tileX = int(gl_FragCoord.x) / (u_graphicsWidth / GRID_SIZE);

        LOWP vec4 albedo = vec4(1.0);
    #endif

    return albedo;
}

vec3 getRMA() {
    #ifdef defRMA
        LOWP vec2 rmaCoords = fract(v_texCoord / u_rmaTiles);
        LOWP vec3 rma = texture(u_rma, rmaCoords).rgb;
    #else
        LOWP vec3 rma = vec3(0.1, 0.5, 1.0);
    #endif

    return rma;
}

vec3 getNormal() {
    #ifdef defNormal
        LOWP vec3 normalMap = texture(u_normal, fract(v_texCoord / u_normalTiles)).rgb;

