So I have been working on a Ray-Tracer plugin for ROBLOX Studio for the last couple of days.
There have been some quiet interesting results.
I just felt like charing my results with you guys. Maybe I get some feedback to current problems.
What can the plugin offer so far?
- The plugin offers (Soft) Shadows
- Reflections with custom depth
- anti-aliasing
- sampling
How does the Plugin work?
- The Plugin lets you select an area on the Viewport you want to render.
After selecting the area and clicking on “Render” it starts to Render the image pixel by pixel.
That means the resolution of each Render is 1:1! The image is drawn with Frames. Each frame with a size of 1x1 pixel. Roblox has a limit to how many UI-Objects you can have on your screen at once. The plugin has a build in compression algorithm that reduces the Frame-count by up to 68%!
Problems with the Plugin:
- It has a huge, and with huge I mean enormous, memory leak. When rendering a big scene you might need to reload the game before doing another render the same size. The memory usage stays high even if you remove all frames. Thats why you have to reload the game. I am not sure why that happens as each frame is removed using :Destroy(). There are no references to the frames either. It might be a problem on ROBLOX’s end but I am trying to fix it non the less.
- Another thing are the “Soft” shadwos. They look kinda blocky still. (Images below) I have tried shooting multiple rays at different locations on the light to calculate the strength of the shadow and I have tried to average all samples but the blocky-shadow effect does not want to let me alone. If you have any idea on how to fix that, please let me know.
Here are some Renders:
Scene-Size: 1112x501 (557112 Pixels)
Reflection-Depth: 4
Anti-aliasing: true
Time to render: ~20seconds
Threads: 1
(yes, 20 seconds on one thread, I was curious, that’s why)
Frame-Count (compressed): 5291
Light-Parts: 1
Scene-Size: 1112x501 (557112 Pixels)
Reflection-Depth: 4
Anti-aliasing: true
Time to render: ~4min
Threads: 2
Frame-Count (compressed): 9736
Light-Parts: 2
Note: It has not the best quality but that’s roblox’s fault. A ray detects a mesh even if that part is not rendered (doublesided off), even with such limitations it turned out good in my opinion. (Windows have no reflection modefier, I forgot to add them)
Another Note:
- As of now I am not planing to release the plugin anytime soon as it’s still in alpha.
Feedback and suggestions are appreciated!