How does Minecraft sort semitransparent blocks?
How does Minecraft sort semitransparent blocks?
I know Minetest does not support semitransparent textures. AFAIK semitransparency is difficult because everything with a semitransparent textures needs to be sorted by distance when it's drawn. Does anyone know how Minecraft sorts its semitransparent blocks? The only solution I can imagine is recreating the VBO for the chunk (block) model as the player moves around it. i.e. if you're standing at the northeast corner of the chunk, it creates the VBO from southwest to northeast so the southwestern blocks are drawn first. (EDIT: That wouldn't even work because it doesn't consider being in the middle of the chunk) Am I over-thinking it? Does anyone know? What do you think?
Code: Select all
#include <iostream>
int main(){while(true) std::cout << "nyan ";}
Re: How does Minecraft sort semitransparent blocks?
Try googling, for example, I found this
https://www.reddit.com/r/opengl/comment ... h_sorting/
https://www.reddit.com/r/opengl/comment ... h_sorting/
- TumeniNodes
- Member
- Posts: 2941
- Joined: Fri Feb 26, 2016 19:49
- GitHub: TumeniNodes
- IRC: tumeninodes
- In-game: TumeniNodes
- Location: in the dark recesses of the mind
- Contact:
Re: How does Minecraft sort semitransparent blocks?
You did a better job googling than me. I only found "how to make transparent skins" and "sorting machines" lolFixerol wrote:Try googling, for example, I found this
https://www.reddit.com/r/opengl/comment ... h_sorting/
EDIT:
Thanks, I think that's the answerFor water and clouds, the traditional methods of handling transparency (e.g. a sort on the object, and separate draw call) are probably your best bet. (but maybe not. profile). The other stuff (ice and the like) is rare enough that this might be good enough for it as well, but it's hard to say with certainty.
Last edited by wes on Wed Jul 12, 2017 07:24, edited 1 time in total.
Code: Select all
#include <iostream>
int main(){while(true) std::cout << "nyan ";}
Re: How does Minecraft sort semitransparent blocks?
Interesting, thanks. There's two rendering passes. Still doesn't explain how the semitransparent blocks are sorted, but because there are less of them there's more options.TumeniNodes wrote:http://greyminecraftcoder.blogspot.com/ ... locks.html
Code: Select all
#include <iostream>
int main(){while(true) std::cout << "nyan ";}
Who is online
Users browsing this forum: No registered users and 4 guests