- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

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!!

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I do not understand where the problem lies. If the secondary hits the other side, then everything works as expected.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

The problem is a typo;) instead "passes through with hitting" should be "passes through without hitting". It doesn't hit the second face of the cube. Some transparency flag is needed ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Maybe you have backface culling enabled. This is a CMake option that is disabled by default. Otherwise, you likely calculate the transparency ray wrong.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I had it on. Still looking for a solution. Thanks anyway

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

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)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Thanks, I solved it. It was mistake on my part.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page