Creating a Voxel Engine (like Minecraft) from Scratch in Python

preview_player
Показать описание
OpenGL Tutorial for creating a Voxel 3D Engine like Minecraft using Python. Libraries and modules used: Pygame, ModernGL, Numpy, PyGLM, Numba, OpenSimplex

------------------------------------------------------------------------------
I have no monetization on the channel, but if you wish to support the channel:

BTC:
bc1qpmpk4swlwtj8kvwva5j7zlth6c33vzp8epx8w9

Any crypto on ETH or BNB:
0x855a59b4c926b96206e492774cd93d81287490ef

Any crypto on TON:
UQCnBXmaYswK9chnjw_KDPbf9uYGd6ZChexNc_iyLKllVKxd

------------------------------------------------------------------------------

Code for each stage:

Source Code:

A Fast Voxel Traversal Algorithm for Ray Tracing (in CUDA C):

00:00:00 Intro
00:00:55 OpenGL Window
00:04:33 Initial Setup
00:10:56 Chunk
00:21:13 World of Chunks
00:28:15 Shading
00:36:15 Packed Data
00:40:38 Interaction with Voxels
00:49:28 Frustum Culling
00:54:27 Texture Array
00:57:23 Terrain Generation

#coderspace #minecraft #python
Рекомендации по теме
Комментарии
Автор

This channel is quite the gem for learning about computer graphics, not only you provide optimal code but also an effective explanation of what we want to program and the logic to achieve it.

Honestly feels like im stealing just by watching this for free, cant wait for the next tutorial.

mokouu
Автор

I like how you made chunks cubic and not tall because you can tile them vertically now and have more height than in Minecraft

rogercruz
Автор

I love your style of making videos. You have adequate explanation of what you're doing but never go into too much depth that you stray away from your workflow. Really interesting to see each project start to form.

whupass
Автор

incredible work! thanks so much! its so fun to play around with your code to visualize world generation through noise

QuickCodeSnippets
Автор

I was going to leave a comment about how you're supposed to pick a *faster* language than Java when making a minecraft clone, not an *even slower* language, but wow, Numba JIT has really changed the game for Python. That's awesome.

I also love how, in a Python video, you unabashedly approach bit twiddling without scaring away the high-level programmers. You've done an amazing job teaching this stuff.

delphicdescant
Автор

you dont know how useful this tutorial is and how much you have opened the barrier entry for people like me to make voxel games. thank you.

Coloride
Автор

I have a voxel engine with a different approach. Storing chunks in a single texture array (single byte value for the material id). This is of course using more memory adding some limitations, but it adds other possibilities like doing chunk reduction in transform and compute shaders. From the texture data I can compute all the reduced chunks into a single vbo and render all the chunks using indirect rendering. It also adds a lot of possibilities for lighting since you can step through the chunk data in the texture using bresenham to add some farily impressive lighting since you can cheaply cast rays. There are probably several other ways you can approach it. The goal was to keep things pure python (no numba) as a challenge.

SuperGrimmy
Автор

Thank you so much for this video! Saw it drop last night and couldn't help but stay up until 1am just working on the first 10 minutes...😅

HisDivineShadow
Автор

This is an amazing tutorial. I myself am dabbling in voxel game creation, can't wait to try out these things in Rust by myself!

idedary
Автор

Bro I just wanted to say they your channel is so underrated (I know really cliche to say this but it’s true), the things you have made have learnt me so so much. Ty for this!! ❤

Huhhh.
Автор

This is the first video to get me to understand opengl.

Twingamerdudes
Автор

It's great that you have made a video of this because I have tried to create voxels on my own and it was never easy to do it on my own, and my level of English is low and it is difficult to understand the forums that talk about this topic.

ezequiel
Автор

Finally, what I always wanted. You are a programming beast

alexanderdavidportilloolme
Автор

damn you made the ambient occlusion convincing

bloom-mania
Автор

Love your videos, currently implementing my own in Rust and a lot of your code has come in really handy to help me understand certain things, like ambient occlusion!!

jumbledfox
Автор

The best person who does such cool things using the Python language!

zactalina
Автор

Bro, you are the chaddesd python programmer that I've ever known! GG and thank you for sharing!

Hyjk
Автор

I've been at this for 4 hours and I'm only 10 minutes in. absolutely insane tutorial, keep it up!

lukagarner
Автор

Это великолепно!!! Спасибо за труд. Узнал много всего нового!

zbeyqyo
Автор

Holy mother of coding... a one hour tutorial! Mate, thank you :D

alexandrepv