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
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.
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.
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.
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.
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
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
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