user8421762
user8421762

Reputation: 9

How do you extrude a texture to 3D in OpenGL?

First of all, I need to explain you all what I mean. An example of what I am talking about is the game Minecraft where the item the player is holding is rendered as a texture extruded into the third dimension.

On the right - 3D extruded texture of diamond sword.

So how do I take a texture and extrude it?

Upvotes: 0

Views: 555

Answers (1)

ChaoSXDemon
ChaoSXDemon

Reputation: 910

Minecraft does not extrude any polygons. Minecraft uses simple polygons such as a rectangle and places a 16x16 texture on it. (Mods may use different resolution ones). The sword you are holding is made of polygons, it's not 2D.

To answer your questions anyways, there are several ways to "extrude" from 2D textures. Usually you use a technique called normal mapping or bump mapping. You may also use parallax mapping. Finally you can also use geometry shader to literally create new geometry.

Upvotes: 1

Related Questions