Crazytracer [Raytracing Project]

Honestly super cool to see this being done within the Roblox engine! For a long time I believed it was near impossible to achieve systems like this in Roblox which is a 3d engine at its core, especially an entire graphics engine in itself. I don’t know if this is possible due to the addition of editable meshes, or my lack of graphical knowledge :sweat_smile: , but it’s honestly really amazing to see this come to life. I’m also curious; does this use GUI elements such as frames or viewport frames? I would assume so, but if there’s a different way, it’d be great to know. Overall I’m impressed with this project especially considering you said you don’t have previous graphical knowledge.

1 Like

I’m applying an EditableImage to an ImageLabel!
The WritePixelsBuffer method is the fastest way to output a generated image.

More optimisations today, got bored of the old world and decided to load in Crossroads for fun :slight_smile:
Resolution is 213x120, still single-threaded!

2 Likes

This raytracer looks awesome and good! Excellent job on it! How long did it take for you to create this raytracer? It’s cool!

1 Like

Thank you! Been working on it for a bit over a week.

More tweaks today to make the performance more scalable! I can now render 288x162 at 60FPS+, which beats the previously posted video on both fronts! We’re still rendering from a single thread too, so this is going to scale reaaaally well.

3 Likes

It’s a rainy day in crossroads…

7 Likes

WOW big improvement here this is incredible. Can I ask what changed? Also, the real time rendering is quite performant all things considered. I think this rendering style could DEFINITELY be used in some niche circumstances, like a game that would take advantage of the “artstyle” of it. Fantastic job!

3 Likes

I think this rendering style could DEFINITELY be used in some niche circumstances, like a game that would take advantage of the “artstyle” of it.

as someone who built their own optimized renderer for art (this is not realtime, this is designed for offline renders… and i don’t use it anymore becuase i godot now!) , no it isn’t feasible to achieve real time rendering with raycasts. (retroraster isn’t really a good solution, there is noticeable artifacting, and you’re stuck with rendering at an unintelligible resolution far lower than minimum resolution of the n64 or ps1)

raycasts are done in software, and is expensive. doing them too many times per frame will lead to poor performance, being more harshly on lower end devices. (when you’re developing roblox games, your first assumption should be that you’re developing for the low end)

fancy stuff such as lights, reflections, shadows and global illumination, requires more raycasts to be performed, lowering performance to something unplayable. even the most primitive implementations is enough to drag down fps by alot.

these problems wouldn’t matter if you’re doing this on a high end system. in fact this is probably what op is using, because i surely don’t expect my i5 7300u to render a huge magnitude of reflections at 1920x1146 pixels

1 Like

Understandable! I’m not a graphics programmer so im definitely not the most qualified to comment on the viability of these systems, but managing a fairly stable 60 fps is impressive to me considering the rendering hes doing and hox expensive it is.

Anyways, cool project is all I wanted to say! Thanks for the reply :blush:

This is just a demonstration of what the renderer is capable of! I rendered the pretty high-res high-reflective 1024x1024 image in 5 seconds using 1 thread. So it’s the same rendering system but because we are no longer required to provide fast response times for gameplay purposes, we can take as long as we like rendering this.

There are more optimisations to be added and soon I will be exploring texture mapping as that is also important in bringing an environment to life.

I’ve been hesitant to implement multi-threaded support for reasons of unfamiliarity but also I do not want to give myself an easy ‘out’ for what could end up becoming poorly optimised code.

The best way I could sum this up is that we are standing on the shoulders of giants. People were determined to create raytracing programs even all the way back in 1986, despite 1 frame taking 1 hour to render. That alone gives me inspiration to push forward :slight_smile:

2 Likes

Good job, and great mindset! I hope you continue this project.

2 Likes

The features you have on your renderer are very impressive! It’s cool hearing from other people who’ve dabbled in this.

I love RetroRaster, and appreciate what it has done for pushing boundaries with regards to realtime rendering on Roblox. The art style is subjective, but the performance and methods of optimisation they use is something that should not be slept on.

I appreciate how pretty the results your renderer can output, although I completely understand that the visual fidelity you strived for is something that has never been done before in realtime on this platform.

1 Like

This really cool to see! Glad to see more people trying stuff like this out! Very impressive results so far!

1 Like

Here’s today’s demo :slight_smile:

1 Like

That looks really good! I have a few questions about your system. How many reflection parts can you have without having performance issues? Can you have a part that is reflecting off of a part that is reflecting? Can you make a room of mirrors where each face in that room is a mirror? What would it look like inside?

In many rendering systems on roblox, I notice that when you move the camera, there is this “blur” effect. Is that on purpose, or is it intended?

1 Like

I was just thinking the same thing. I’m assuming it’s to help the rendering with performance, but it could be a stylistic choice too.

1 Like

It’s better to think about how many rays can be shot per frame before seeing any performance slowdown. In the video I’ve provided stats in the bottom left showing the amount of rays shot compared to the amount of pixels rendered in a frame.

When I turn on reflections in the video, you can see the ray count shoot up, and it no longer matches the amount of pixels rendered. I wouldn’t expect an environment where everything is completely reflective, but this serves as a proxy for how the system would respond if I added more checks with rays in the future, like shadows and lighting.

The blurring or lines that are left behind when quickly moving the camera helps reduce how many pixels are rendered per frame, allowing for more respectable frame-times.

Luau on the client is interpreted & doesn’t have access to the GPU, so it’s important to scrutinise every line of Luau while taking advantage of any C++ functions I can get my hands on [Faster, lower level language].

The blurring/lines is far from optimal, and in-fact shortly after uploading that previous demo I came across another method that dramatically increases performance in a way that it isn’t as jarring visually, which I will share in my next progress post.

For fun I tried out adding ‘CRT Scanlines’ to match the currently low-res aesthetic the renderer runs best at. Not only for visuals but it aided in further removing more lines to render per frame.

This is something that stylistically limits the renderer though, and for my new rendering method it may not yield any improvement due to upcoming architectural changes.

1 Like

Ray tracing update in Flood Escape 2??? :pray: :pray:

1 Like

Reminds me a lot of the style that the Atari series my dad and I used to play together used. It definitely has that retro style. Could be really cool for something similar to the Atari games, or the fnaf minigames. Honestly super impressed with how far and how fast this progressed!

1 Like