Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real time raycaster? #57

Closed
NukeBird opened this issue Jun 2, 2020 · 2 comments
Closed

Real time raycaster? #57

NukeBird opened this issue Jun 2, 2020 · 2 comments

Comments

@NukeBird
Copy link
Contributor

NukeBird commented Jun 2, 2020

My first attempt was a creation of real-time raycaster (single hit, no recursive rays aka ray tracing)

For a blender monkey with ~15k tris I got ~100ms for FullHD frame. I tested every pixel on the screen (so 1920*1080 = 2073600 rays), model occupied 30-40% of window space

I knew that such a raycaster won't be fast, but to be honest I expected a bit more. Maybe I did something wrong? Or is here any tricks to achieve better performance? BVH and traversal settings are default, I'm testing everything in 1 thread

It's theoretical question, just wanna know how much speed I can get. Atm I'm using software rasterization (7-8ms for 1920x1080, 10-16ms at close range) and planning to use nanort for occlusion culling (so I'll stop rasterize triangles I can't see)

I'm sorry for such a silly question I just wanna know the limits. Here is always possibility that I'm doing something wrong :)

@NukeBird
Copy link
Contributor Author

NukeBird commented Jun 2, 2020

i7-7700

@syoyo
Copy link
Contributor

syoyo commented Jun 2, 2020

NanoRT is not designed for realtime use. But you can implement ray-packet traversal(e.g. for efficient occlusion culling), SIMD ray traversal, etc. based on NanoRT code.

You can use Embree(as you may know, fast(est) CPU ray tracing kernel) to measure how much you can achieve by utilizing (general purpose) CPU raycaster.

According to our internal experiment, NanoRT(scalar) ray casting performance is 3 to 4 times slower than Embree(SSE2 or AVX) for triangle scene, 5 to 7 times slower for hair geometry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants