Luau Ray Tracer
Path tracing on Roblox with user-defined shaders.
About
Luau Ray Tracer is an object-oriented path tracing library for Luau. The ray tracer has support for user-defined shaders using the Shader and PostProcessingShader classes.
Features
- Path tracing on Roblox
- Per-pixel color, depth and normal buffers
- Users can define custom shaders to achieve various effects like refraction and reflection
- Also supports user-defined post-processing shaders.
What can it do?
Luau Ray Tracer is capable of path tracing any scene at any resolution, as long as it doesn’t take too long for Roblox. Users can define custom shaders that are applied to specific parts, as well as post-processing shaders that are applied to the entire image after the path tracing step is complete.
But why?
I really don’t know
Disclaimers
- This module can not do real-time ray tracing. That’s not possible with game scripts due to how much time ray tracing tends to take.
- Image rendering time is greatly affected by the render resolution.
- Image rendering time is dependent on the amount and complexity of shaders used.
Performance
As mentioned above, the performance is hugely dependent on the render resolution and shaders, and is in no way suitable for real-time rendering. For reference however, the example image at the top of this post was originally 250x250 and took 0.48 seconds to render with a total of 4 shaders and a maximum of 10 bounces per ray.
Links
- Documentation and tutorials on GitHub
- GitHub repository
- Roblox Creator Marketplace
-
Example Shaders.rbxm (3.0 KB)
Note: Does not include the Ray Tracer module.
License
This resource is licensed under the Mozilla Public License Version 2.0.