Rendering a minimap with a 3D feel

Started by
5 comments, last by realh 8 years, 11 months ago

Hello Everyone =)

Below is a screenshot of a map in minecraft. It can also be displayed smaller as a minimap. You can see that it has this 3D feel to it -- dark tones below and light tones above any where that there is height in the actual 3D world. I am able to get the blocks around me, their texture/colors, etc, but I don't know how to give the top down view of the world the height shadows that make it look 3D. What is this kind of rendering called and how can I learn about it in order to accomplish similar results?

Thanks so much!

sammy

2013_07_31_20_23_46.png

Advertisement

You could, for each pixel, calculate the gradient/normal (based on surrounding pixels) and then use those to apply some basic lighting (if it faces away from the light direction, make it darker, otherwise lighter)

This is roughly equivalent to treating the 2D map as a smooth heightmap and applying simple directional lighting (if you didnt 'smooth' it, you would only see the top surfaces, which without shadowing would all receive the same lighting and look pretty flat - of course you could add proper shadows but at that point you probably should just render the world from above and use that as a minimap...)

Not sure about the transparent voxels (see the water), might be easier to not apply shadows there.

You might be able to find the source for the map rendering code (apparently you can use this thingy to somehow get readable source for mod making purposes and supposedly its not illegal) and see how they implement it.

But the basic idea is that surfaces are darkened based on what direction their normal is in. All you need to do is define exactly what is considered a surface, and how to compute its normal (which is probably different than how its done for the 3D world)

o3o

the elevation contours make it look like its procedurally generated somehow, as opposed to being implemented with some sort of 2d tile set with 3d renders on them.

might as well get it straight from the horse's mouth if you can. see if you can get a hold of the source code.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

I think your example is "simply" a render to texture with camera 90° above the scene, and then the display of the texture on a quad (or in ortho proj). So no strange algorithm, only the 3d projection blitted to a texture.

Here's an open source project that produces that.

http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1286882-mapwriter-an-open-source-mini-map

Thank you all very much. I'm still pretty lost but at least I have some directions to pursue. It's funny, I don't care much to write a map mod -- the allure is in how it works. Thanks again!

I think your example is "simply" a render to texture with camera 90° above the scene, and then the display of the texture on a quad (or in ortho proj). So no strange algorithm, only the 3d projection blitted to a texture.

I don't think it's that simple. Everything in Minecraft is made of cuboids, so in an ortho projection all you'd see is the flat top faces with identical lighting. I don't think it's using shadows either, because you can also see highlights in the map. It looks as if it's doing something like waterlimon said, calculating a gradient for each pixel based on its neighbours.

This topic is closed to new replies.

Advertisement