# Minecaft-style crosshair that inverts color

**URL:** <https://forums.unrealengine.com/t/minecaft-style-crosshair-that-inverts-color/788657>\
**Category:** Blueprint\
**Tags:** unreal-engine, Widget, Blueprint, question\
**Created:** [March 11, 2023, 6:24pm UTC](https://forums.unrealengine.com/t/minecaft-style-crosshair-that-inverts-color/788657 "2023-03-11T18:24:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![V\_vix](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/v_vix/32/613734_2.png) [@V\_vix](https://forums.unrealengine.com/u/V_vix)\
**Post date:** [March 11, 2023, 6:24pm UTC](https://forums.unrealengine.com/t/minecaft-style-crosshair-that-inverts-color/788657/1 "2023-03-11T18:24:04Z")

</div>

Hello. I was working on a new game idea when I noticed that my white crosshair is barely visible on the background of snowy mountains (a place where 90% of the game happens) and, while thinking of resolving this problem, I remembered Minecraft’s crosshair, which would invert colors (It doesn’t exactly invert the color as it’s still white most of the time, but does display the world trough some kind of shader, but I’m not sure how to better describe it) of whatever you looked at. I tried finding out how did Minecraft’s developers created it, but trying to google anything about the crosshair only results in tutorials about customizing its textures in-game. Here are some examples of how it looks in game.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/0/a80fb10f3277bcafccc1f22ed9bc0c26a35c73f2.png)  
Crosshair while looking at dark green grass

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/f/d2f77e9644e5a57a858a2ad026ca99136ccc3513.png)  
Crosshair while looking at white clouds

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/a/eda4a3581ce2f8c8746b97aa47dee989aeb3b25c.png)  
Crosshair looking at white snow.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/3/d/83d9e4c1eb9b623bcaaa6d8fe4673149b407469d.png)  
Crosshair looking at both white snow and black coal

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/4/cf444f0bf53463438a7d0e18fca6c83307b9878f.png)  
Crosshair looking at a red-white mushroom

EDIT: Now I realized, UE’s editor crosshair looks and behaves exactly the same 🤔

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [March 11, 2023, 9:45pm UTC](https://forums.unrealengine.com/t/minecaft-style-crosshair-that-inverts-color/788657/2 "2023-03-11T21:45:42Z")

</div>

Hey there @V_vix! You might be able to get this effect using a PostProcessMaterial, but the harder part is getting it to only be for the crosshair. You’d have to set up it’s shape and size in the PPM. I know you can invert anything visually with the MinusOne node, but masking it to only your cross is going to take shaping.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/7/7/c7728c8713d57321abbee3e0eef4c03576e54153.jpeg)

> **[Post Process Materials](https://docs.unrealengine.com/5.1/en-US/post-process-materials-in-unreal-engine/)**
>
> How to author and blend custom Post Process passes with the Material Editor.

---

<div class="post-metadata">

**Author:** ![jwatte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jwatte/32/744941_2.png) [@jwatte](https://forums.unrealengine.com/u/jwatte)\
**Post date:** [March 11, 2023, 10:59pm UTC](https://forums.unrealengine.com/t/minecaft-style-crosshair-that-inverts-color/788657/3 "2023-03-11T22:59:37Z")

</div>

Presumably you’d map a texture across the display, and read this texture in the post-process material.  
You’d probably want to clamp the texture and only map it across the center 128x128 pixels or so.  
Make the texture black where there’s no crosshair, and white where there’s crosshair, and make this value linear interpolate between the “normal” value and the “inverted” value.

Note that gray backgrounds (rock walls, concrete, …) have problems with one-minus inversion, because inverser of gray is gray. There are a few ways to fix this. One is to use subtraction-with-wrap instead of invert. Another is to only invert some color channels (say, green and blue) and instead just overlay red on there. A third is to calculate the color space distance between the texture and the framebuffer, and only invert if the distance is smallish.

---

<div class="post-metadata">

**Author:** ![Nizami\_Nz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nizami\_Nz](https://forums.unrealengine.com/u/Nizami_Nz)\
**Post date:** [August 31, 2026, 4:32pm UTC](https://forums.unrealengine.com/t/minecaft-style-crosshair-that-inverts-color/788657/4 "2026-08-31T16:32:22Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/b/efbffc8866bb35a5bd70e070235570cb7505f80d.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/e/deeac050bbc421593f7ee51bb2892f5430655e50.png)
