Skip to content

devdinc/minimap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Emily's Minimap Shader

A minimap created within Minecraft's Core Shaders.

Creating the minimap

  1. Create a background texture to be used for the minimap.
    • Generate a 256x256 texture containing the background.
    • The background size can be configured in the shader's configuration file.
  2. Add the background texture to your resource pack's font
  3. Spawn a text display in the center of the 256x256 area.
    • The text display must have a scale of zero
    • The color of the text in the text display must be #454D00
    • Note: The view distance of the text display is smaller than the 256x256 area Now you should have a minimap displayed on screen while in view range. You are able to make larger backgrounds by placing entities at regular intervals.

Adding icons to the minimap

  1. Create a texture for your icon.
    • This can be any size that is a multiple of two between 2 and 128
  2. Add the texture to your resource pack's font
  3. Spawn a text display where you want the icon to appear on the map
    • The text display must have a scale of zero
    • The color value of the text encodes two key properties:
      • The 2 most significant bits represent the Z-position of the icon minus 1.
      • The 6 least significant bits represent HALF the size of the texture minus 1. Now you should have icons displaying on your minimap. If you wish to center an icon on the minimap (an arrow showing the player) you can simply make the text display ride the player.

Icon color cheatsheet

Z Index 4×4 8×8 16×16 32×32 64×64 128×128
1 #454D01 #454D03 #454D07 #454D0F #454D1F #454D3F
2 #454D41 #454D43 #454D47 #454D4F #454D5F #454D7F
3 #454D81 #454D83 #454D87 #454D8F #454D9F #454DBF
4 #454DC1 #454DC3 #454DC7 #454DCF #454DDF #454DFF

Configuring the shader

The shader can be configured in the assets/minimap/shaders/include/minimap_config.glsl file.

Information to know

  • The minimap doesn't scale with GUI scale as we don't have access to it. That being said ScreenSize variable can be used to dynamicly scale minimap.
  • This shader doesn't provide any decorations (minimap frame YET, background when you reach the border etc.)

Known caveats

  • Name tags of entities spawned after the minimap entities can sometimes show through the minimap. Solution: Spawn text display above build limit + 10 blocks
  • If the player has a low render distance, the minimap can stop rendering at shorter distances. Solution: Since minimum render distance is 4(64) set, texture size to 128, and to always show full map (when in between sections) set it to 64.
  • You must be mindfull of entity display/track settings in your server configuration, since text-displays are entities, not seeing them means not seeing the minimap.

About

A minimap created within Minecraft's Core Shaders.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • GLSL 100.0%