Adding Realistic Shadows to my 3D Python Game
HTML-код
- Опубликовано: 5 июн 2024
- Check out brilliant.org/DaFluffyPotato/ to start your free 30 day trial of Brilliant and receive 20% off a premium subscription.
The most important feature in Minecraft shaders are the dynamic shadows. While I was working on a game engine for a future project of mine, I decided to take a quick stop to create Minecraft along with some fancy shadowmapping shaders using Python, Pygame, and ModernGL.
Wishlist Yawnoc:
store.steampowered.com/app/28...
Learning resources for shadowmapping:
learnopengl.com/Advanced-Ligh...
My Discord:
/ discord
Support Me (and get source code for the project in this video):
/ dafluffypotato
/ @dafluffypotato
My Website (links to games):
dafluffypotato.com
Special thanks to my Potato Tier Patrons:
Agent Effe
Damion
Eivind Teig
f0ursqu4r3
Levi Jeske
Rethanon
Sam Cork
Szabolcs Dombi
tbf135
Timestamps:
0:00 - shadows are key
0:50 - why
1:08 - world generation
1:42 - a simple concept
2:19 - what's a shader?
3:52 - depth buffers
4:12 - implementation
6:05 - polishing the shadows
7:03 - final thoughts
#gamedev #pygame #python - Наука
To be clear, I meant that the concept behind shadowmapping is easy to understand, but coding it is more difficult (which is why I said "the implementation takes more thought").
If you're interested in implementing shadowmapping yourself, LearnOpenGL.com has a good tutorial:
learnopengl.com/Advanced-Lighting/Shadows/Shadow-Mapping
Also, wishlist Yawnoc: store.steampowered.com/app/2824730/Yawnoc :)
how did you learn pygame
DaFluffyPotato: Ahh yes its pretty easy anyone can understand
Proceeds to pull up the code to the matrix
The code for this one is quite complex, but the shadowmapping concept itself is rather simple.
@@DaFluffyPotato ahhh yes shadowmapping mhm
----
*Frantically grabs dictionary*
@@BentoSushi1 LMAO imagine not knowing that haha
panics cus cant find definition for 'depth buffer'
someone who doesn't have a good grasp on coding will tell you what they are learning is complex and difficult, I often find the smarted developers will say what they are doing is simple and easy, you just have to learn the right languages and tools.
When I say the concept, I specifically mean the idea of comparing what the player sees to what the light sees. At the top level, it's very simple. It just gets more complicated as you break it down (depth buffers, transformation matrices, framebuffers, etc.).
I'm supposed to be doing homework, stop making good videos!
same, but I cant resist
I need to get distracted from my problems, continue making good videos 😂
Man, I think you've become so experienced dev you got "the curse of knowledge" cognitive bias, cause this is not easy.
The code isn't, but the concept is. I was referring to the concept.
AYOOOOO, YOU GOT A FUCKING SPONSOR!! LETS GOOOOOOOOOOOOOO
I can't believe I caught this so fast. I love graphics programming.
Voxel engines with teeny tiny voxels that have a color rather than a texture and use high definition scans of real world places must the coolest applications of voxel rendering.
FluffyPotato showcasing his projects while also desperately trying not to come across as just flexing.
Any video that aims to make a Minecraft style game is a banger tbh
Congrats on the brilliant sponsor, love the tutorials
bros brain is bigger than my head
Bro is cooking as always
My dude finally getting sponsors and pulling in the big money 🗣️ congrats
this was very fun to watch :)
You should do a tutorial series, and show off everything you can make. This stuff is cool
Bro, i love your worth ethic so much.
i cant begin to understand how youre doing this in python, its amazing, great job
Next time someone says you can only make games with C/C++ or that interpreted languages are too slow I'll just link them this, excellent job!
The problem starts when you start doing things that are even slightly more CPU dependent. Just like you wouldnt decode audio using python, its a lot slower to do things like chunk generation with it.
Although i am sure most languages that are at least compiled will get adequate performance for these use cases, not just C/C++.
@@atiedebee1020 yeah you’re right, just tired of people thinking C/C++ is the only way, I use C++ just because that’s the golden standard but it’s not the only fast language around the block anymore.
@@protosevnThats why I started use love2D and lua, and I got a lot of things to work on this, like an Engine and a programming language. sometimes I need C if I want low level control but most of the time, I use pure lua
bro you are so good !!!!!
Nice work
I love your videos, youre such a huge inspiration for me! As always, great video!
Shaders go brrrrrrrrrrrrrrrrrr
Do you ever plan to release your planet generator like the rest of your games? I'd love to take a peek into how something like that is even done.
It's on my Patreon
I’m not at a level to understand a lot of what you’re talking about but I like hearing you break down the concepts.
Also, if this was the first video of yours I saw I could easily say, easy for him. He’s a genius.
Maybe you are a genius but also, from your videos it’s clearly a lot of hard work for over ten years building on top of itself. It feels like a really candid view of how a talented normie becomes S tier.
Even though I don’t use python nor do I plan on doing so, I just can’t get enough of your videos man. Keep up the amazing work! ❤🎉
This looks fantastic, although sounds like a huge project. How long are you expecting to work on this?
Just a little on the side here and there. I don't have a specific end point in mind.
What are you using for networking? Websockets or custom stuff?
My own framework built on sockets.
Hey just saying it would be better to use fractal perlin noise as that would generate more natural and good-looking landscapes and is what Minecraft itself uses iirc
Damn you're a wizard!
i would reccomend getting mojo installed, its python and even backwards compatible but alot faster, im 99% sure ur using vs code and that even has its own mojo sdk!
Making a minecraft clone in python with moderngl is very frustrating and challenging, i suggest switching to c++ while you still can, it is much harder but offers so many more features.
no
@@DaFluffyPotato ok
bro u literally teach us better than 1 month of teacher lol
Is your point of origin fixed?
In infinite world you have to shift shadow matrix correctly, otherwise there's unstability of shadows when the sun goes down
It doesn't move in this demo, but it will in the project I'm working on next.
I wonder if the GLSL and python coding could be combined into a usable shading module that could be pip installed for the less... "DaFluffyPotato" of us
ModernGL is very easy to use. I have a tutorial for it.
You're insane
how often do you use higher level math in basic game development?
once every other month for what I do. almost never for "basic" stuff.
Ok soo thats what a shader is
Good vid
i love you your the best
The background music is
Blue Dream by Cheel
That's not the original. It's Blue Dream by Cheel.
@@DaFluffyPotato oh, okay. that's where I found it first.
pls make a minecraft mmo.. i would hand over all my money
Python, now I know why my pc burns with these mods 😮
Minecraft mods aren’t in python
Haven't watched the video yet but I see no python but C#
hay how was your day?
busy
@@DaFluffyPotato i know that feeling lol just rember to take time to youself :)
shadowmapping now seems to be less complex but plz try ray-tracing because it needs less buffers for some cool effects like reflections,transperency,shadows and portals.. you can stylize raytracing too that it looks like minecraft. or add it as a option. a compute raytracer isn't too hard to implement if you use ChatGPT
I don't think you could say this is "just Python"... But it is remarkable anyway.
First... I guess😂
When you said "actually just python", I expected you to replace glsl with python.
Disappointed.
Bro stop it!! You are way too far.
I’m feeling stupid
9 views in 1 minute bro fell off