Minecraft's new post-effect command allows users to apply ShaderToy shaders to the game screen by processing screen pixel coordinates through mathematical functions to determine color output. The key technical insight is that by using matrix inversion to convert screen coordinates back to world space, any ShaderToy effect can be integrated into the actual Minecraft world rather than remaining as a static screen overlay. This works by leveraging the game's existing core shader system, which converts world positions to screen coordinates, and then using the inverse transformation to map screen pixels back to world positions for ray tracing calculations.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
What the new /posteffect command REALLY means for vanilla shaders
Added:Hello everyone. So, last week Minecraft added this new post effect command and basically everyone's going been going crazy about it.
Uh like you can see here, they just added all these different effects and basically how this works is uh they they're just basically taking these effects from ShaderToy. That's like a website where you can upload your own shaders.
And what this does is like it takes uh screen pixel coordinate and then it does a bunch of math with it and then it outputs a uh screen color for this coordinate. So, if you for example uh the middle, that's like coordinates 0.5 0.5.
And then it does some math with it, some mathematical function. And then the function outputs uh like three different numbers that each represent the red, green, and blue channel.
Uh and like these represent different brightnesses along the blue channel in this case.
Uh and the idea is in Minecraft you can do the exact same thing.
And uh just basically copy and paste this code into Minecraft.
Uh and well, that's what they did and it's pretty cool because you can uh like insert all these different effects.
Uh and basically what I was thinking like right right here you can see these are actually 3D effects. Uh like right here it was just uh a 2D pixel coordinate.
But these are like 3D.
But the principle is still the same.
Like uh you can see here. This one's also a 3D effect and when you scroll scroll way down uh you can see it's still just a 2D pixel coordinate and uh well, then it just does some geometry to basically uh turn this 2D pixel coordinate into like a a point in 3D space and a direction that you look at uh like right here.
Like a camera position and uh a vector uh pointing in the direction that you look at and then it casts this ray inside the world and just basically decides which color does it hit.
Uh and this is how all of these different effects work like this one uh and this one. They They all look pretty nice.
And basically what I was thinking uh all of this stuff is just some fixed camera positions like uh it works pretty well as a screen saver.
Like for example Phoenix SC also did a video about it and all of the people in the comments are saying well this is basically a screen saver.
Uh and I was thinking it would be pretty nice if this was not a screen saver but instead you could just move around this like it was a regular Minecraft world.
Uh and basically this is what I did.
Uh so you can see right here I'm moving it around inside my world and uh this is exactly the effect that you see here but inside Minecraft and it's not just a static screen effect. You can actually move inside it and uh like it gets included by walls and everything.
You can also uh like go to the overworld and see how it looks.
And it's pretty nice.
Uh and now you might be wondering like I I explained a bit but how does this actually work?
Uh and the basic idea is that uh this ray direction like uh when you uh look in here here.
All of this code is just for setting up like which position in the world is the camera at and which uh which direction does the current pixel uh which direction in the world do you have to face to point at this pixel.
Uh it does all this different math and then it's just inserts it's into this camera setup function and calls a uh render function.
And then it has this color and outputs it to the screen.
Uh so, I was thinking if we can go inside Minecraft and do like a bunch of math that tells us which direction each pixel on the screen points to.
Uh we can basically insert it into this code and uh we have this effect working inside the world.
And well, you might be wondering how does this actually work. How do you calculate this ray direction?
Uh and there are two answers to this.
First, it's complicated and two, it's actually quite simple.
Uh so, this is basically my project setup and uh the core of the of the whole idea is um >> [clears throat] >> like all of this uh of this random code does like a bunch of matrix math to convert between between uh screen space and world space. Like um this is the core shader. Like this is what's used to draw all the things inside the world.
And uh the game basically has internal logic like uh this uh leaf block is at I don't know which position position uh like negative 116 73 minus 90.
And then this position inside the world needs to be converted into like which screen coordinate, like uh X and Y.
Where does this block need to be drawn?
Uh and this is basically the logic that is done by this core shader. Like all the core shaders are used by the game to draw the things in the world, like the blocks or in this case like item entities in the world.
Uh and all of this uh conversion sounds pretty complicated, but it's actually just this one line of math.
Uh you don't even need to understand how matrix multiplication works, but it's basically just um like some function that when you multiply the position by uh this weird object, you just get a screen position out.
And this is basically uh the whole idea.
Because uh because this is like a mathe- mathematical object, you can just call inverse on it.
This is a built-in function in uh OpenGL, like um just takes this mathematical object and uh gives a new one that that's just uh when you multiply it's back, it's it just undoes the whole operation.
Uh and then when you somehow output this into the into the post shader, like um uh it's been a while while since I read this, but like right here.
When you output this into the post shader, uh here I have it output.
Uh you can just multiply it back into the screen position.
And well, then you get a world position.
and this is basically the whole trick.
Using this, you can take any position on the screen.
Uh and multiply it with this inverse matrix, and it basically gives you a direction inside the actual world. And this is then what I can enter into the ray tracing logic.
And then it just works.
Uh I can plug in any shader code shader toy code uh that I want.
Uh and then the next question is, this is in the core shader, and then this is the post effect shader.
How do I actually transfer the data between the two?
And uh I've been hovering over it uh with my mouse a bit.
Here in the bottom left corner of the screen, uh maybe if I make the screen large, you can see it.
Here in the bottom left corner, you can see some uh marker pixels.
And actually uh when you go into the core shader, you can see it like uh this is the vertex shader. This one's uh one time for every corner of the block, and um then I'm out outputting it into the fragment shader. This This one's for every pixel of the block, and basically decides uh like which pixel which color should be drawn here.
Uh so like right here, you can see the already existing game logic for looking up the uh the leaves texture.
And uh what I just added here is uh like if this special entity is currently being uh handled uh in my case, I'm just um using like a command to spawn a custom item display.
Uh and I'm doing a test if this is if this item display is currently being uh rendered, I'm uh setting this sent data variable to one. And then in the fragment shader, I can test for this.
And uh basically just run any logic I want.
And in this case, um I'm just testing for the uh for the pixel coordinates. And depending on the pixel coordinate, I'm um encoding a different part of the of this matrix.
And this is basically all the logic that is behind it. And that's how I'm uh writing these uh these marker pixels.
And then inside the uh post shader, I'm uh I'm outputting this uh this matrix from the vertex shader to the fragment shader.
The idea behind this is basically the vertex shader only runs one time for every uh corner of the whole screen.
Uh so this is basically more efficient if I read it in here.
And uh yeah.
Uh I forgot how I'm actually setting this. All right, using a a for loop. I'm just iterating over all pixels on the screen.
Uh or like or just up to four pixels.
And I'm iterating over these and uh reading from the screen and decoding it and writing it into the into the matrix.
And this is basically all that is to it.
It sounds pretty complicated and I admit it is, but I hope I could make it a bit understandable how this works.
Uh but now comes the actual uh, the actual mind-blowing part. This is Minecraft 1.21.10.
The change log that I read at the start of this video was for 26.3. So, this was like 1 year ago.
And now people are freaking out about being able to, uh, render all these static images.
And well, the question would be why are they freaking out if I was able to do this 1 year ago?
Uh, and well, it's uh, the answer is actually pretty clear. Like, you have just these simple command blocks and you run one command and, uh, you do like half of what I did here in in all of that.
Uh, and I've also seen some other people, like, um, >> [clears throat] >> uh, use these commands to send data to the, uh, post shader.
And, uh, in my opinion, it's pretty inefficient.
Like, they used one command to send one bit. And right here, I'm using this tiny area of the screen to send, uh, like, this whole matrix.
Uh, but yeah, I I just wanted to show off what what it actually looks like uh, when you do this stuff. And I hope people can use my approach and do some cooler stuff with it because, uh, like, this is a pretty cool start. Uh, most people haven't hadn't even noticed that you can do this shader stuff.
And now that, uh, Mojang added this new command, I hope, uh, people get more into it. Like, I mentioned PhoenixSC.
Uh, he already showed my portal project, but he seemed pretty confused by it. And now he started to actually write his own code and like I I hope people start to share my passion because this stuff is pretty cool.
Uh so this was about everything I wanted to show. I hope it wasn't too confusing.
Uh I hope what I showed you had a bit of a point.
But yeah, thanks for watching. Thanks for listening to me and goodbye.
Related Videos

TOP 15 Data compression Interview Questions and Answers 2019 Part-2 | Data compression | Wisdom jobs
wisdomjobs
281 views•2019-06-28

CTS 158: 802.11w Management Frame Protection
ClearToSend
4K views•2019-02-04

NDSS 2019 Send Hardest Problems My Way: Probabilistic Path Prioritization for Hybrid Fuzzing
NDSSSymposium
496 views•2019-04-02

How realistic is Cities: Skylines?
CityBeautiful
159K views•2019-02-14

GUIs & TUIs: Choosing a User Interface for Your Python Project | Real Python Podcast
realpython
2K views•2025-04-04

The OSI Model - Explained by Example
hnasr
225K views•2019-05-12

Cloud Computing - Introduction
elithecomputerguy
98K views•2019-10-07

From Traveler's Dilemma to Dynamic Routing | Demystifying Networking
IITBombayJuly
5K views•2019-08-04
Trending

Playstation NO DISC/NO BUY Fight Is Over...
DavidJaffeGames
4K views•2026-07-23

Steam and Xbox Just Dropped The Hammer On PlayStation
OhNoItsAlexx
9K views•2026-07-23

Americans Confused in Australia for 17 Minutes Straight
IWrocker
17K views•2026-07-23

SuperBike Factory Has Gone... What's Next for the Motorcycle Industry?
thatbikersimon
11K views•2026-07-22