Mirrors with reflection in Godot 4
Vložit
- čas přidán 6. 06. 2024
- In this tutorial I show how to implement mirrors with character reflection in Godot 4.
Wishlist Dreamed Away on Steam: store.steampowered.com/app/19...
Join the Discord: / discord
Follow us on Twitter: / dreamedawayrpg - Věda a technologie
Short, to the point, and easily understandable. You e got a new sub,
I think Godot devs might be the only people online who know how to get straight to the point. People posting recipes online could learn something.
Today we're going to make scrambled eggs. Eggs are nutricious, affordable, a good source of protein, and so much more than just a breakfast staple. There are so many ways to prepare an egg, that no matter the occasion, you'll find there's an egg recipe that's totally suitable to the occasion.
I can still remember the first time I tasted an egg as a 4 year old, when my grandmother made us breakfast on one of those seemingly endless summers, when me and my sister had a sleepover on her farm. They had chickens, so they had an abundance of fresh eggs, and one morning she took us out to the chicken coop to...
And by that time I've already switched the channel. 😂
@@EvenTheDogAgrees if it’s a text site, you forgot a bunch of on-page ads breaks.
But “change the channel” means it’s a video, so you forgot the unnecessary theme song and logo, “please like and subscribe for more recipes”, and finally “but first, a word from this video’s sponsor…”
@@ShaolinDave Nah, I just didn't feel like being dragged before a tribunal for crimes against humanity. 😂
@@ShaolinDavesponsorblock ;)
That's genius! The effect looks amazing over the aquarium, too. Thank you
Thanks for this. In my version, i added an area2d to the mirror that creates a sprite for the body that enters the mirror’s area2d. This way it should make a reflection for all players or npcs that enter the area.
Thank you dude! Didn't even realize what the project was or what the channel was until I realized. "Wait. This looks like Mother 3. Wait. The channel is called Dreamed Away. Wait. I've seen them in a Mother Direct." You've earned a Sub!
haha, awesome! Glad you found the channel!
I love your art style. Looks very earthbound-y.
Thanks!
Wow... Amazing, Just loved the game, nos seeing this tutorial Just have to thank you for the result Dreamed Away achieved. Congrats.
Top Tutorial. I really liked to see how you make those ingame lights. They look very good!
I'll make another tutorial :)
You're an excellent communicator. I hope you have time for more of these tutorials!
wow. awesome music. good content. great execution. well done!
Even though I don't use Godot, this tutorial looks pretty neat.
Brilliant, thank you. I'm thinking you could also reduce the reflection in size (by a small percentage) as it moves further away too.
Absolutely beautiful, thank you!
You're welcome! Glad it's useful :)
make more of these! this is great!
Brilliant guide! Thank you for sharing, definitely going to use this idea :D
After everything, It's still you.....
Thank you for the great instructions.😊
Very cool function, thanks for the tut.
This is very easy to follow! Thank you very much!
Glad it was helpful!
Thank you for sharing!
Great tutorial. Short, to the point, and easy to follow. Just subbed. I hope you keep making videos like these!
Thanks for the awesome tutorial! Can't wait for Dreamed Away to come out!
Amazing tutorial! Short, easy to follow and cool effect! Subscribed!
Great tutorial!! Thanks for making it, it is really appreciated
Marvelous effect, thank you so much!
thank you for teaching us
You make life easier, thank you!!!
At the point, no innecesary waste of time, easy to understand!!! OMG!!!
wow, just amazing, beautiful and well explained. Instant subscribe!
This is amazing
Great tutorial! I just liked and subbed. Hope to see more amazing material like this. Thanks!
Could you do a tutorial for your lighting shader?
Great video! I have some questions. Why did you use a light to make the clip mask? Did you notice any advantage in using a light instead of placing the "Reflection" as a child of the "Sprite" and using "Visibility->Clip Children->Clip only" on the "Sprite"? Thanks for the video.
Initially this was implemented in Godot 3, where's clipping children doesn't exist (AFAIK). But also, I don't want to clip using the entire mirror sprite.
@@dreamedawayrpg Portability, I get it. Thanks for answering.👍
@@dreamedawayrpg You can still use the sprite resource you used for the Light2D and clip the sprite within that sprite. Should work the same.
@@awfyboy Yes, you're right.
looks so good
you deserve more subscribe bro
... I've been wondering how to make masks in Godot. Just for that I'm already thankful! XD
This is super interesting, thank you!
You're welcome, glad you liked it!
PERFECTION.
+1 Sub.... love it... right to the point. Appreciate the knowledge sharing as well 👍
Awesome tutorial!! Please keep making more like this!
I will! If there are topics you'd like me to cover, please let me know :)
@@dreamedawayrpg maybe something about shadows, lighting, shaders or just any cool trick to simplify things.
I think more basic stuff like "how to work with tilemap" already explained by other guys.
just WOW :)
very nice
you are the best!
awesome!
Bravo
👍 + Subs!
Very Nice Tutorial, Thank you!
Make more of this!!!
ayy lets go
I'm very new to Godot and game dev but I like to have notes on different ways to do things, so thank you for this video and how you did things. Would this be a good use case to learn how to use shaders? TIA.
Amazing. How do you get the light halo particle effect around the player?
That might be the topic for my next tutorial! :D
great! can you do the same with water reflection on the ground? using tilemap, autotile water
Excellent video. Thank you. What is the name of the background music?
Interested in hearing more from the composer. The few songs of the OST that seem to be available are amazing.
@@johneicher6683 Thanks! I'm working mostly solo on the game and I've composed all tracks except for a few ones in the second chapter.
Great tutorial, thanks. One detail as I guess that's the issue: the reflection is lagging just a bit, is it possible that in your code you calculate the reflection before calculating the new frame for the main character? If you watch the video at 0.25 speed it becomes noticeable enough. Thanks!
Good catch! You're totally right, that's exactly what's going on. You need to order the nodes so that the mirror's process function is called after the character.
paper lily mirrors, les go
Please can you make car mechanics in godot 4 like how to drive car and enter exit
In car😊.
Love the tutorial!
I have one question, does this means the "mirrored sprite" is always rendered?, or the mask avoids it from being rendered?.
I would love to be able to use this trick for all character sprites and reflect them on different stuff, like water bodies, mirrors and even metalic surfaces, but I'm a bit worried about the rendering cost of this.
I guess the mask is a post-processing thing, but maybe godot has optimizations to know if he has to render something or not 🤔
any opinions?
how would i add a shader to the reflection aswell as the canvasitemmaterial needed to clip?
I need someone more skilled with coding than I am to integrate pixel editors into godot. Having to switch between aseprite or GameMaker to create sprites is so frustrating and pulls me out of productivity mode.
Simple maths,
For a small room, okay but what if you have a huge map and hundreds of mirrors. That would mean you have hundreds of reflections and move them? And why fade out when walking away? No mirror does that in real life. I mean it’s okay for that small room but scaling it up will crash that game probably 🥹
I use a variation of this in Dreamed Away, not hundreds of mirrors but quite a few in some maps, and while it does run on the CPU it scales really well for my use-case.
Regarding the fade out, as I said it's optional and obviously stylized, if you don't like it just don't do that :)
This is such a negative and ridiculous comment.
@@kaizen9451Yeah, everything that asks limitations of Godot is considered negative in Godot cult.
Don't forget to donate to Juan!