Reflections In Reflections in my 3d raycaster

I made reflections in reflections… for 5 mins… accidently… so yes, let’s start from begin!
i just was trying to render transparent part, and accidently created reflections in reflections. Yes.

2 Reflections limit:

picture

4 Reflections limit:

picture

8 Reflections limit:

picture

i wanted add objects in, lol

And video(with no limit): RayCaster - Reflections in reflections - YouTube

Any critique pls

5 Likes

You’re supposed to be running your code in Heartbeat for stuff like this. I have a feeling it isn’t based on the FPS in your video. If you’re gonna go down this approach I’d also suggest you use blurs of pixels instead of individual frames.

This code runs full on client, and how im know HeartBeat is for servers, so im using RenderStepped.
Wdym? “I’d also suggest you use blurs of pixels instead of individual frames.” what is that blurs?

You are correct to use RenderStepped

No, from my personal experience doing that exact same thing on the client using HeartBeat made it faster. Idk why…
These blurs are when you get a blurry circle as an image and use it as your pixel. Effectively allowing your resolution to be a lot lower while also not getting that retro look. You can then overlap this with surface guis blur they get to make it seem more natural.

One could also take that knowledge that surface guis create blur at low studs per pixel to create a pixelation effect.

But how ever i run HeartBeat on client?

with RunService.Heartbeat:Connect(function(Delta)
end)

heartbeat can be used on both server and client, just like stepped.

render step is client only though

1 Like

Yo, do you know how i can run more than 256x128?

I think one GUi element has limit of 64.000 elements in it, so maybe you can do like 6 Frames each has 64.000 elements (pixels), never tried, but you can

hmm, good idea, but i mean, how to reduce lag that make roblox run at 0.7 fps/s

You’re kinda capped at the quality you’ll get with rays. You are min-maxing really GUI elements and ray casts. Some quick fixes you could do now is, cache your Color3’s and use Vector3’s for color logic. Do not render directly to pixels as frames, but use the method I told you with the blurred circle. If you want quality at a crisp performance then I would recommend using UIGradient compression.

Damn, i didn’t understand it at all

Instead of counting each pixel in a row, you can do like 100 lines of gradient frames

Basically turning 256x128 to 128
128 frames instead of 32768

Example: Many pixels (100+ frames)

Example: Gradiented frames (5 frames) !INNACCURATE!

1 Like

It’s not inaccurate, it’s a very old method where since you can store 8 colors per gradient you make a 1x8 ui gradient thing. this lowers gui usage by 800%. You’re still sampling all pixels it’s just you are rendering it more efficiently.

1 Like

So, it’s efficiently? Im gonna rewrite my whole raytracer, and maybe use this method to render, but don’t know, i think is more easier to use frames, when u can work with single pixel and etc.

Color sequence can have 20 colors, and you can just multiply gradient frames, like 3 gradients in one X line