/*
====================================================================================================

    Copyright (C) 2025 Pyvtron VX Shaders - Pyvton

    All Rights Reserved unless otherwise explicitly stated.

    Before You Do Something With Pyvtron VX Shaders, You MUST Read This:

    You Must Read The License: https://pyvton.pages.dev/minecraft-shaders/pyvtron-shaders-license
    And Read The Agreement: https://pyvton.pages.dev/minecraft-shaders/pyvtron-shaders-agreement

====================================================================================================
*/


layout(location = 0) out vec4 compositeOutput1;


#include "/Include/Core/Core.glsl"
#include "/Include/Uniforms.glsl"

const bool	colortex1MipmapEnabled  = true;


in vec2 texcoord;

#include "/Include/Core/Mask.glsl"

const float TAU = radians(360.0);
const float PHI = sqrt(5.0) * 0.5 + 0.5;
const float goldenAngle = TAU / PHI / PHI;


float ScreenToViewSpaceDepth(float depth) {
    depth = depth * 2.0 - 1.0;
    return -1.0 / (depth * gbufferProjectionInverse[2][3] + gbufferProjectionInverse[3][3]);
}


vec2 CalculateDistOffset(const vec2 prep, const float angle, const vec2 offset) {
    return offset * angle + prep * dot(prep, offset) * (1.0 - angle);
}

#ifdef DOF
#include "/Include/DepthOfField.glsl"
#endif

void main() {

    #ifdef DOF
    vec3 color = LinearToGamma(DepthOfField());
    #endif

    compositeOutput1 = vec4(color, 1.0);
}
/* DRAWBUFFERS:1 */
