Super Optimised Pixel Raytracer with Textures! (120+ FPS!)

Unfortunately not. I have found that this is the best method. And also, not using the bindable event at all and not even setting the pixel hardly changes FPS at all. Itā€™s like a 1% difference, so that part cant be improved much.

2 Likes

Next upā€¦ Textures!

2 Likes

Buffer serialisation is slower than just reading/writing to an array as far as I know

2 Likes

Itā€™s incredible. I wanted to try making pixel games, but after reading this, I got some hope. Are you going to sell them or are you going to distribute them for free?
Iā€™m Korean and I used a translator, so it might be hard to understand. Sorry. If thereā€™s anything you donā€™t understand, please let me know. Thank you

Currently, this is just a personal project as I still want to add and improve a few things, but once I get some proper tests on a mid-range or a slightly low-end laptop done, and if the results are good, I will probably end up distributing this for other developers to use.

Whether it will be free or cost something, that all depends on my time and effort put into this along with the quality.

3 Likes

First of all, even if I have to pay, I will pay unconditionally because what you make is so attractive. I look forward to hearing good news. :smiling_face_with_three_hearts:

1 Like

Added motion blur to hide interlacing artefacts

9 Likes

Added average FPS benchmarks comparing from 3 different types of computers:

  • Low-end
  • Mid-end
  • High-end
2 Likes

Are you using editable images?

Yes. I am using EditableImage paired with my CanvasDraw module for the texturing

i already have canvasdraw before but does it have multithreading? cuz i might make my own raytracer

CanvasDraw doesnt have multi-threading unfortunately. But it isnā€™t really needed for most resolutions and would be super complicated to implement for the API

Fantastic, outstanding, breath-taking work Ethan.
You inspired me to work on this as well and Iā€™m so glad the goal is finally realized, thank you and great job.

2 Likes

this is actually so amazing, im loving the progress!!!

1 Like

Would it be possible to get the texture of a part or mesh and then convert it to what your doing for textures? I know it would probably shoot fps down a bunch, but you could probably preload them into a table by getting all descendants of the game that are surface appearances or mesh textures and then just add to a table with its texture id. Not sure that would work though, correct me if Iā€™m wrong!

its a 100% possible. Iā€™d just have to load an ImageData from a part with a decal or texture once and then add that to my textures list once. CanvasDraw can handle that automatically

it shouldnā€™t impact performance much at all

1 Like

Are there mirrors or glass? If not, add them (or maybe just the mirrors, glass sucks).

How did you get the pixel color of textures?

I did a transformation from the ray hit position on the part compared to the partā€™s position to get UV coordinates, then I sample a pixel colour from an image via my CanvasDraw module with ImageData:GetPixel(X, Y)

1 Like

This is super cool, I tried doing this like a year ago but couldnā€™t get over 10 FPS. Could you open source this?

2 Likes