Do you know the main sources of lag from your renderer? Cause if you find out what causes the most lag, we can help with optimizing that.
So I’ve boiled it down to these main factors:
-
The sheer quantity of loops
-
The calculations needed for each frame (can be set into a lookup table for better performance.)
-
The raycast itself. (is only like 50% of the total performance drain.)
-
Calculating the
ColorSequence
values for each paxel (which could be made more efficient by what @BlackShibe said, setting the frames to a solid color if it’s all determined to be the same color.)
These are all the primary consumers of performance. Obviously there’s no way to make the raycasts more efficient, but the calculations for the raycasts can be set to a lookup table every time the frame is set, stuff like direction can simple be static values, they don’t need to be recalculated every frame.
Wow! I’m using this 100%.
I noticed an issue in v2(Are you still on that one?) where if you zoom out and look directly at yourself it creates a partial(Shoulders) unpixellated version behind it including part of the baseplate.
Good job, I’ll make my retro game soon >:)
Haha, no we’re stopped all support on previous versions. V4 is the current version.
Oh thanks, I didn’t see.
I’m using this 100%
Suggestion: Light sources.
It would be so cool if this was a thing. And maybe shadows that can cast from them too.
Also could you please add a way to make all the UI smaller for smaller devices, such as a laptop:
Cause this isn’t very fun to navigate half the time
Also you should make your sun look a little bit more like a sun, rather than just a yellow circle in the sky.
Wow this is really cool!!! And we have your permission to use this for stuff? Cool!!! Im going try to get it working in a viewport frame and make a working pac-man arcade machine. Havent looked at the code yet - guessing its all local?
Woah! That’s a crazy cool idea for this!
I never even thought of putting it in a viewport frame and making an alternate workspace to render it from.
Sorry for the bump, but this method could work really damn well. I reccomend you trying it because the full block character appears to leave almost no spaces/gaps in a text label.
I did a quick example with a textlabel with rich text enabled that uses the full block character > █ <
And as you can see there are almost no gaps in the text label.
You just might have to mess around with the sizing and fonts a bit.
I reckon you should make this a second option
also didn’t mean to reply to BlackShibe.
I know that UI Gradients can support up to 18 pixels, have you tried building support for that? I also would love to see you integrate Roblox’s new Parallel support to help reduce the burden of ray casts.
Hey @AJRuski last time I played with these UIGradients, it simply would error and discard any edits I made if I attempted to implement more than 10 segments, but if you say so I will 100% look into it.
Also, are you saying parallel support is now live? I hate to admit it but I really don’t keep up to date with these updates, but if it is omg I can’t wait to use it.
this is very cool you do plan to give it out to the public right or just a personal project?
Hey @timothyco1!
The source for this is entirely free even right now!
It’s also all compact into a single ScreenGui
that when placed into any game’s StarterGui
will automatically work without any adjusting.
Okay so I just looked into parallel lua again after a bit and testes out the beta. Their test ray tracer is very cool!
They obviously aren’t implementing the optimizations that we have all collectively worked toward and even still are getting the same fps. I can only imagine how much faster we can make this run, and how much closer we can get this project to be fully capable in real games in the future!
My main concern about using Text instead of frames is simply that it won’t solve our issue of 10 pixels per paxel and I haven’t been able to find a perfectly square block character.
I don’t believe it will increase performance, I actually think it might decrease performance.
How would it be possible(if at all) to get kind of a diamond-shaped pixels?
Like certain 2d games.
I’m not sure I understand, could you show me an example?
Nobody asked for it, but I added reflection to this.
Despite the fact that we are casting an extra ray per pixel of a reflective part, this thing runs very well. I only seem to lose 4-10 FPS when using this setting.
Since I’ve just made this in like 10 minutes, there are a few things missing, such as transparency and skybox colour not being reflected. But all of those issues are relativity easy to fix.
Feel free to implement and improve this into the official version.
Original place but with the reflection setting already implemented:
Pixel test 4 but with reflection.rbxl (55.2 KB)
Main Reflection process function:
function ProcessReflection(Raycast, IntersectPos, Normal, Params, OriginalColor)
if Raycast.Instance.Reflectance > 0 then -- No need to create an extra ray if the part isn't reflective
local ReflectedNormal = Normal - (2 * Normal:Dot(Raycast.Normal) * Raycast.Normal) -- Relfect the direction.
local Direction = ReflectedNormal * FC.RenderDist -- New reflected direction
local NewRayCast = PerformRaycast(IntersectPos, Direction, Params) -- Create the reflected ray
if NewRayCast then
return NewRayCast.Instance.Color:Lerp(OriginalColor, 1 - (Raycast.Instance.Reflectance / 1))
else
return OriginalColor
end
else
return OriginalColor
end
end
Coolio! Might use this in the future!
This looks amazing. Is it possible to change this so it raycasts and renders from the front of a specific part or is it only possible for characters?