How do I make 3d fractals in Roblox without lag?

Hello World!

I have gotten this idea lately of making 3d fractals in Roblox without making the whole game lag a bit too much. And I have also gotten ideas on how to make these like :

  • cloning the obj(s) ( Cause way to much lag. )

  • Using Raymarching ( It might not be possible, and if it is the renders will be pixelated with the current raymarching scripts we have right now on Roblox. )

  • Cloning the obj(s), then union them ( Might crash the player’s game. )

I am not sure on how to achieve this but… If I can get a bit of help and translate some math equations to lua, we might be able to do it.

I am also aware that this might be very hard to make, but I’m just hoping that I could make history with this.

And I might make the code open sourced once this is finished so some awesome games with this code can be made.

What I want to achieve / Images :




image_2022-09-04_125955082


I don’t really know how to make or how to achieve this but, it’s only an idea for now and might be a reality in the future.

Note :
I am not sure if this is supposed to be in building or scripting, since this includes both. So I just decided to put it here.

So if you do have the time you can help me with this journey.

5 Likes

Note :
I am not sure if this is supposed to be in building or scripting, since this includes both. So I just decided to put it here.

I honestly don’t think that Roblox is meant for this kind of thing as it is right now. Maybe if Roblox ever gives us meshing API. As far as the code goes, you can use Parallel Scripting. But that doesn’t really help with the rendering.

Hm, well I guess that could be used. But as you said it doesn’t help with the rendering. Do you have anymore solutions besides that? [ Even if the solutions are complicated. ]

Sadly I don’t have anything for this. I’ve struggled enough with procedural generation to know that Roblox is very limiting in that area at this point in time.

1 Like

Well that’s sad. And I agree too, limitations in Roblox is really kind of annoying when it comes to this. Thanks anyways. I’ll just wait for other replies.

Update :

So I tried using meshes and it decently reduced the lag but It’s still very buggy.

Have you tried caching the parts and hiding parts you can’t see? E.g. with a system like PartCache
This avoids cloning lag

No but I might try that actually.

How do I do that exactly? Raycasting?

You could also try implementing some sort of greedy meshing if blocks are going to be attached to each other.

Well I guess it works but how about making the fractals? Like generating them and not building them hand by hand.

The concept is basic, but the module PartCache exists to simplify it. Essentially, you make a ton of clones beforehand. When you want to place a new clone, you take one from your pool and modify the cframe to be in the right place. When you want to destroy it, you actually just set the CFrame to somewhere out of sight. Very efficient.

Alright I’ll also try to understand it.

I have a question though, can this make like infinite dimensions or structures without lag?

This is impossible on Roblox there is way too much geometry in these images. You could try raymarching, but it will lag since you need thousands of frames to draw the screen.

Try looking into these:

2 Likes

Okay the second one looks absolutely amazing, how did he do this though?

It’s open source and public on his GitHub repo.

When I played the .rbxl file it only crashed my game. So I guess it is very laggy.

When Roblox is asking us for what feature do we want on Studio I guess I’ll request for a thing that makes us customize the Roblox camera rendering types for more amazing things.

There are a lot of interesting visual stuff that we simply cannot do in Roblox and it’s quite annoying. I would love if Roblox gave us direct access with render/graphics API. But equally as much, Roblox needs to add meshing API so that we may generate custom meshes via scripts. Many of my more advanced projects would immensely improve with a feature like that. It would also allow for unique visuals in of itself.