Hi,
I'm trying to implement refraction using embree but the problem is that transparency doesn't work. More precisely i added a cuboid and primary ray intersect the first face but the second passes through with hitting the other side.I tested with bias and it doesn't change anything. I have standard cube 8 vertices and 12 triangles and implementation is taken from triangle example in tutorials. Is it about turning on some flags ? I tried rtcSetSceneFlags(scene, RTC_SCENE_FLAG_ROBUST); but it doesn't change a thing . Help me pls!!
链接已复制
Still haven't found it.
The thing is that transparent cube has duplicate vertices and when i cast rays from first face to the second face i dont have a hit.
(each triangle of the cube has separete vertex + normal)
Are normals taken in account in calculation of intersection ? (Based on vertices orientation ) . I removed duplicates and it doesn't work - pls help im really stuck.
Could you please modify the triangle_geometry tutorial (which also has a cube) to illustrate the problem and then send us the code? We will then have a look what is going on here, but pretty sure you do not calculate the secondary ray properly.
Hi,
It's quite difficult to post the precise code as it's a part of much bigger project. After doing few tests it looks like it never hits second side of the object. Double sided test? I dont pass any normals and i havent seen any embree example with that. I geuss he computes normals from triangle. How can i get around it ? is the a swithc to treat all geometries as double sided? (Embree 3.2.0)
Did you compile Embree with enabled back-face culling (cmake option)? I think Sven's suggestion to modify our very simple triangle_geometry tutorial to illustrate the problem is the best path forward to debug this issue.
