How to make a 3D platform with a repeating texture

How to make a 3D platform with repeating texture.

3D platform with a repeating texture can be made by toggling UV1 toggles: TriplanarWorld Triplanar.

Here is a simple walkthrough.

I will use a kenney_voxel-pack/PNG/dirt.png image texture.

First let’s make regular platform.
image
It’s a simple StaticBody3D with sub-nodes CollisionShape3D and MeshInstance3D.


The CollisionShape3D Shape should be set to BoxShape3D
image

Setting MeshInstance3D Mesh

The MeshInstance3D Mesh should be set to New BoxMesh

Setting MeshInstance3D Material

Then we click on the Mesh of MeshInstance3D to expand options.

In the MeshInstance3D Mesh options we should see Material to which we drag our dirt.png image.

Setting MeshInstance3D Material to Triplanar: World Triplanar

This is the core of our tutorial. It will make Material a world Triplanar
which as you will see, will make Material into a seamless repetitive texture.

Now we click on the Material to expand options.
image

Scroll down and click on the Material UV1 Option.
image

In the UV1 toggle: Triplanar and World Triplanar.

All done.

Test: Scaling StaticBody3D into a 3D platform

To test your seamless textured StaticBody3D, let’s apply some basic scale transformation.

Let’s click on StaticBody3D and expand Transform Option.
Click on icon (2.) to stop uniform transformation and set X and Z values to higher.
image

Final result


1 Like

FYI from the PhysicsBody3D docs:

Warning: With a non-uniform scale, this node will likely not behave as expected. It is advised to keep its scale the same on all axes and adjust its collision shape(s) instead.

I realise you are scaling to test, but it’s probably better for a tutorial/guide to not suggest bad practice even for testing!

2 Likes

Indeed for a production environment and prototyping it is advised to achieve correct non-uniform scale by adjusting sub-nodes: MeshInstance3D and CollisionShape3D instead of nodes like StaticBody3D and other PhysicsBody3D.

Thanks for pointing that out, I may update it in the future.

1 Like