apparent ray divergence problem in refraction

Hi OptiX forum,

I’ve a textured plane underneath of a refractive dome – think of a glass paperweight, for example, and you’ll have the right idea.

When it’s near the origin, it renders great; however, once it’s close to 50 units away, the refraction of the textured pattern on the plane under the dome becomes increasingly more and more “spread out” as the object is translated further from the origin (I translate the camera along with it so that I can see what’s happening).

This strikes me as being a precision related problem, but I’m not sure how how I can fix it.

Any ideas? Thanks in advance for your time.

Just so I understand correctly, do you mean the distance from the camera to the dome remains the same while you translate the dome/camera’s position, and the textured plane is essentially the ground of the scene? Does the texture get more and more distorted as you move away from the origin? Posting some pictures would be helpful.

I would recommend revisiting the way you map the hit point on the refractive surface to texture coordinates. What makes you think it’s a precision issue?

Try computing the refraction direction using unit length vectors and see if that helps. You can scale the resulting vectors using the length of the incoming vector if you wish to preserve the length.

Just so I understand correctly, do you mean the distance from the camera to the dome remains the same while you translate the dome/camera’s position, and the textured plane is essentially the ground of the scene?[i][/i]

No. Dome, textured plane, and camera all move together. Distance between all items is fixed, the only thing that changes is their offset from the origin.

The refraction behavior and texture mapping behave perfectly when rendered at the origin and I move the camera about them. Couldn’t be happier.

I think it’s a precision related issue because I have a separate precision related issue that manifests under the same conditions – that is, it happens when I render at some distance offset from the origin, and becomes progressively worse with distance. I’ve seen similar things over the years in software renders; only given much greater distance from world zero. So, you know – walks like a duck, swims like a duck…

The incident and normal direction vectors used to refract() are of unit length.