#if !defined POS_DEPTH_LIB
#define POS_DEPTH_LIB
    struct positionDepth {
        float depth0;
        float depth1;

        mat2x3 screenPosition;
        mat2x3 viewPosition;
        mat2x3 scenePosition;
        vec3 shadowViewPosition;
        vec3 shadowClipPosition;
    } pd;

    void fillPositionStruct() {
        pd.depth0 = texture(depthtex0, textureCoordinate).r;
        pd.depth1 = texture(depthtex1, textureCoordinate).r;

        pd.screenPosition[0] = vec3(textureCoordinate, pd.depth0);
        pd.viewPosition[0] = screenSpaceToViewSpace(pd.screenPosition[0], gbufferProjectionInverse);
        pd.scenePosition[0] = viewSpaceToSceneSpace(pd.viewPosition[0], gbufferModelViewInverse);

        pd.screenPosition[1] = vec3(textureCoordinate, pd.depth1);
        pd.viewPosition[1] = screenSpaceToViewSpace(pd.screenPosition[1], gbufferProjectionInverse);
        pd.scenePosition[1] = viewSpaceToSceneSpace(pd.viewPosition[1], gbufferModelViewInverse);


        pd.shadowViewPosition = sceneSpaceToShadowView(pd.scenePosition[0], shadowModelView);
        pd.shadowClipPosition = shadowViewToShadowClip(pd.shadowViewPosition, shadowProjection);
    }
#endif