I achieved promising results with lenses made of quite fine meshes, and normals interpolated from face normals. Now I want to optimize precision and performance. I need validate my understanding of normals.
My understanding is that (with BIDIRCPU) luxcore takes the normals to bend/curve faces to calculate the ray-face crossing points and angle for refraction. This smoothes the approximation of concav/convex surfaces by meshes. Is this correct?
Lets take it to the extreme with the following vertices, connect each three neighbors to 8 faces, and copy the vertices as normals.
-1 0 0
0 -1 0
0 0 -1
1 0 0
The results would still have the geometry of a cube, appears as a cube, has the shadow of a cube. But the color is smoothly shaded leaving no edges visible in the shading.
And the refraction should actually be like from a perfect sphere.
So it produces the refraction from a sphere but the shadow of a cube???
Here rendered without normals vs. with normals:
Normals and refraction
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Re: Normals and refraction
Only the (shading) normal is interpolated across the face vertex normals, the point of intersection is still the same (i.e. still on the face of a cube).
Re: Normals and refraction
So what is the effect of normals on refraction then. They just define which IOR to use for which side of the face? Or is there more like e.g. interpolating angle?
Re: Normals and refraction
Yes, the interpolated (shading) normal is used to compute the angle of refracation (in place of the geometry normal, i.e. the triangle face normal). When the triangle is small enough, it produces a convincing approximation of the curved surface.
Re: Normals and refraction
Thanks. I think I've a reasonable understanding now.
So even for simple homogenous geometries like spheres there is now way around fine meshes to get precise results for refraction (not for the object itself), right?
So even for simple homogenous geometries like spheres there is now way around fine meshes to get precise results for refraction (not for the object itself), right?
Re: Normals and refraction
Yes because all the objects are approximate as triangle meshes. Anyway, it is debatable because you can easily have triangles small enough to be practically the same of rendering a primitive sphere (given the floating point 32bit precision).