# Black hole lensing effect

So i was just wandering around in studio where i got an idea of what if i can make a black hole so i created a script that pulls objects when its near but the problem is idk how to make lensing effect for black hole

Black hole lensing ^

so i want help on how i can make it

any help be appreciated

This isnâ€™t possible in roblox (since we canâ€™t write our own shaders), unless you could use the glass material in some way. Thereâ€™s some GLSL code on this site which does refraction if you are interested.

1 Like

but that glsl code is useless since i cant write shaders lol
anyways thanks

1 Like

Try using robloxâ€™s particle system

hows that possible i dont think i can do anything with roblox particles lol

1 Like

For simulating the blackhole:

Firstly and the most important part. Physics. It requires a lot of math. Force of Gravity. Gravitational Attraction/Pull. A bit of trigonometry and basic physics such as working with velocities, acceleration, mass etc. Secondly, the curves, they require a lot of math.

And for the lensing effect, I found this paper:

http://rantonels.github.io/starless/

It requires hours and hours of work to create a realistic and a smooth black hole simulation or lensing effect. Its quite hard to do that, afaik. But Iâ€™ll look into creating something like this, since you brought this up. Really fascinating.

1 Like

thx but i suck at math i did not understand any word in that equation you showed

The equations are a combination of basic trigonometry, math, and physics. Good luck

I guess it is possible to emulate that effect with basic optics that roblox have, but I have no any idea how to make it. Already tried to play with unions and meshes and glass material, and achieved nothing of that kind. Here is a screenshot from pirateâ€™s tale that is I was basing on:

Upd: nvm, both unions and meshes gives the needed effect, but only when render is began, like a play test started.

1 Like

i tried experimenting with the glass effect and kind of got somewhere
robloxapp-20210830-1109296.wmv (2.1 MB)
i made it using by putting an inverted sphere mesh with glass material and also relection to 1 and transparency .2

I made something looks like it but itâ€™s not quite what itâ€™s needed to be but yeah a â€ślittleâ€ť looks like the â€śblack hole lensing effectâ€ť. I wouldnâ€™t say I made it, I actually just grab a reflective sphere and play around with lighting etc, and the results are shown below.

You can contact me via Discord if youâ€™re interested of how I done it.
My Discord: NAS_.A#5927

5 Likes

Solution For blackhole effect:

Little story:
I to, was despartly looking for the solution to create a lensing effect for around a year.
Then, In the game oaklands, the devs posted dev footage which used the effect. After this, I knew it was possible to do so. Later, I saw a post by one of the devs on the dev fourm in which he stated he used a highlight effect on a high transparency inverted glass sphere.

This Only works with higher graphics settings.
Lenses everything, including parts, players, skybox, buildings etcâ€¦

Tutorial
Place an inverted sphere mesh.
Change its material to glass
Add a highlight effect â†’ Set outline transparency to 1, and fill transparency to 1
For lensing, make the transparency 2-300
the higher the transparency, the more the lensing

Reflectance will not effect the lensing

Transparency = 25

Transparency = 25, with black neon inverted sphere in center

You can also layer multiple lensings with different transparencies for cool effects

If you add non-translucent white glass with reflectance of 10000, and make the size slightly larger than one of the smaller lensing layers, you can get cool rings

Hopefully, this is the final solution

Model for examples:
Blackholes.rbxl (74.0 KB)

17 Likes

This is my version. I managed to bypass the black distortion by making it a particle instead of a mesh

3 Likes