Strange artifacts while rendering a dielectric material I am trying to render a dielectric sphere inside the Cornell Box. Some circles are generated on the sphere. Here is the photo generated by path tracer:



And below is my main function:

function trace(surfaces::Array{Surfaces, 1}, ray::Ray, depth::Int64, maxDepth::Int64)
if depth &gt;= maxDepth
    return Vec3(0,0,0)
end
t, material = nearest(surfaces, ray, Inf)
if typeof(material) == Empty
    return Vec3(0,0,0)
end
if material.isLight == true
    return material.emittance
end
ρ = material.reflectance
n = material.normal
if material.isDielectric == true
    cosθ = -dot(n, ray.d)
    ref = material.ni/material.nt
    if cosθ &lt; 0
        cosθ = -cosθ
        n = -1.0*n
        ref = 1/ref
    end
    disc = 1 - ref*ref*(1-cosθ*cosθ)
    if disc &lt; 0
        R = ray.d - 2*dot(ray.d, n)*n
        In = trace(surfaces, Ray(ray.s + t*ray.d, R), depth+1, maxDepth)
        return In
    elseif disc &gt; 0
        R0 = (ref-1)/(ref+1)
        R0 = R0*R0
        Rθ = R0 + (1-R0)*(1-cosθ)*(1-cosθ)*(1-cosθ)*(1-cosθ)*(1-cosθ)
        u = rand()
        if u &lt; Rθ
            R = ray.d - 2*dot(ray.d, n)*n
            In = trace(surfaces, Ray(ray.s + t*ray.d, R), depth+1, maxDepth)
            return In
        else
            R = ref*ray.d + (ref*cosθ - sqrt(disc))*n
            In = trace(surfaces, Ray(ray.s + t*ray.d, R), depth+1, maxDepth)
            return In
        end
    end
end      
BRDF = ρ/Π
R = hemiRand(n)
In = trace(surfaces, Ray(ray.s + t*ray.d, R), depth+1, maxDepth)
return Π*BRDF*In
end


And I think the fresenl effect of the area light on the sphere looks strange and wrong! Am I correct? 

EDIT: I searched a bit and I guess it's the moire effect. But I don't know how to get rid of it.
I solved my problem by adding a small value to t value when the ray is getting refracted.
But I still doubt the result is true. Below is the new generated photo:



Why is the area light reflected twice on top of the sphere? Is there still a bug in my path tracer? The glass sphere is closer to the camera than the area light.