// Depth Factor Calculation Module
// Developed by EminGT
// Modified by Haider

#ifndef INCLUDE_DEPTH_FACTOR
#define INCLUDE_DEPTH_FACTOR

// Depth Calculation Function
float GetDepthFactor() 
{
    // Calculate normalized depth based on camera position relative to ocean level
    float normalizedDepth = 1.0 - cameraPosition.y / oceanAltitude;
    
    // Apply eye brightness modulation to prevent extreme values in bright areas
    float brightnessModulation = 1.0 - eyeBrightnessM;
    
    // Clamp result to valid range and apply brightness constraints
    return clamp(normalizedDepth, 0.0, brightnessModulation);
}

// Legacy Compatibility
#define GetCaveFactor GetDepthFactor

#endif // INCLUDE_DEPTH_FACTOR
