Quote:Original post by phantomus
Hm you're right, perhaps that's causing the small speckles I have in the demo I pointed to a few posts above this one (did anyone try it? could you post some performance figures and machine specs?). Basically I start with ID 0, and add one to this for every generated ray. It's an unsigned int, so there are quite some rays generated before it wraps. Should be pretty safe.
ill try it after i finish this post.
uint, 4 billion isnt it? i agree, considering you only cast a couple of million rays / frame, there would only be a change once every 1000 frames for a patch not to be hit at all 1000 frames long, then to be hit by a ray with the exact same ID. not going to happen, realisticly. not an optimal solution though, imho.
Quote:
Using your one bit approach requires you to reset the bits. And that's not going to help performance. That list that you mention is going to be huge, on my bunny model about half of the triangles will be in it. For the 1.1M buddha model it's a nightmare. And even for that model, the incrementing ID will cycle only every x frames so why bother. ;)
i dont think its that bad. i keep my patches in an array inside my mesh class. if i just swap the references to the tested patches to the front of the array (a cheap operation youll agree), resetting the bits will be a joke. just count how many patches youve intersected (only something like 3 on average at most) and reset their bits.