float intersetCloudPlane(vec3 r0, vec3 rd) {
    // vechitNormal = -normal*sign(dot(normal, direction));
    vec3 point = vec3(0.0, CLOUD_HEIGHT, 0.0);
    return clamp(dot(point - r0, vec3(0,-1,0)) / dot(rd, vec3(0,-1,0)), -1.0, 9991999.0);
}

float intersetCloudPlaneTop(vec3 r0, vec3 rd) {
    // vechitNormal = -normal*sign(dot(normal, direction));
    vec3 point = vec3(0.0, CLOUD_TOP, 0.0);
    return clamp(dot(point - r0, vec3(0,-1,0)) / dot(rd, vec3(0,-1,0)), -1.0, 9991999.0);
}

float intersetPlanarCloudPlane(vec3 r0, vec3 rd) {
    // vechitNormal = -normal*sign(dot(normal, direction));
    vec3 point = vec3(0.0, PLANAR_CLOUD_HEIGHT, 0.0);
    return clamp(dot(point - r0, vec3(0,-1,0)) / dot(rd, vec3(0,-1,0)), -1.0, 9991999.0);
}