Parallax Mapping with Images

Recently, I’ve been working on a Parallax Mapping script which calculates the size and position of an imagelabel and display it onto the surface of a part. You set a certain offset and it will display that ImageLabel as if it were a 2D plane at that point in 3D space.

Though it is very good, there are still flaws with the system, like how I can’t rotate the images as Image deformation is not a feature of imagelabels. However it can be used to mimic the way a viewportframe would display parts in 3D space, but at a fraction of the performance cost.

In this video there are three images which are placed 15 studs backwards from the part and offset with different values.

This can be used to fake the interior of rooms like seen below. Though it isn’t perfect as the walls surrounding the interior have to be faked with the size of the image, giving it a weird distortion when you look at it from angles that don’t show the back flat wall

The module also supports angled parts, as the Images are always rectangular they will also rotate with the part as seen below. It updates in real time, so it would support spinning/moving parts

The Images also work like any other normal ImageLabels, meaning you can apply transparency, etc. Since the code uses ImageLabels and not viewportframes, you are able to render a lot of them efficiently, seen below is one Part with 400 ImageLabels being rendered. Each Image is 500x500 Pixels.

If you have any ideas on how to correct the weird distortion for the interiors please post below about it!

UPDATED VERSION

I’ve managed to clean up the images and add a bunch of customization to allow certain restraints to be set on how well the editablemeshes will render as they aren’t bounded by the surfaceGUI.

This technique is 4 times as expensive though, which means that it would only be used in niche spots where imagelabels wouldn’t work. But since it supports both EditableMesh and Imagelabels, you can have them both co-exist on the same part at the same time. Though there are some problems with the editablemeshes vanishing at certain angles.

20 Likes

this is really cool

bruh

I’ve updated it, adding support for rotation of the planes, allowing me to do what is seen below.

While the image does start to artifact when you get too close to the part, if you’re about 20 studs away or the part is obstructed, the illusion is basically perfect.

I achieved this through the use of editablemeshes and calculating each of the vertexes of the image individually, meaning the angled planes are 4 times as expensive to render as flat images in theory.

EDIT: Since I’m using meshes to render the rotated walls, it doesn’t get subjected to clipping, which is why you can see it in angles where you shouldn’t as the module places the vertices off of the part that it is rendering on.

2 Likes

is there a way to do this but with a meshpart? to create parralex mapped bulletholes? if so could you make a basic module to do it?