I created two objects in Optix, a concave spherical surface and a cylindrical surface. The rays are designed to hit concave spherical surface first and then refracted to the cylindrical surface. The ray would stop on the cylindrical surface.
I traced a ray and printed where the ray hit:
SphericalSurface From (-0.0000,30.0000,0.0000) To(6.0041,0.9227,-0.0166)
CylindricalSurface From (6.0041,0.9227,-0.0166) To(9.9998,-15.5348,-0.0276)
The ray starts from(0,30,0),hits the spherical surface at (6.0041,0.9227,-0.0166), and then stops at (9.9998,-15.5348,-0.0276) on cylindrical surface. Everything goes as planned before.
However, when I leave the spherical surface unchanged, but translate the cylindrical surface along the y-axis for about 0.2f. The ray goes like this:
CylindricalSurface From (-0.0000,30.0000,0.0000) To(-9.9995,-18.2402,-0.0554)
The ray missed spherical surface and go straight to the cylindrical surface.
I didn’t change the position of spherical surface here. There is no doubt that Point(6.0041,0.9227,-0.0166) is much closer to the Origin than Point(-9.9995,-18.2402,-0.0554).
The boundingbox program and intersection program are copied from optixIntro in Optix-Advanced-Samples. The objects are separately created from geometry to geometrygroup. Different materials are attached to the geometryInstance.Finally geometrygroups are added to the group as a child.
Is there any clue about what happpened here? Thanks a lot!
PS:Win10, GTX1050, DriverVersion 398.36, OptiX version 5.1.0, CUDA toolkit version 9.0.