Make stuff look better with DECALS!

  Рет қаралды 23,859

SimonDev

SimonDev

2 жыл бұрын

I'll show you how to use Three.js's decal system to build FPS bullet marks, footsteps, and anything else you want.
GLSL Course: simondev.teachable.com/p/glsl...
Patreon: / simondevyt
Follow me on:
Twitter: / iced_coffee_dev
Instagram: / beer_and_code
Github: github.com/simondevyoutube/
I'll step through using DecalGeometry in JavaScript and three.js to build little squibs and marks on existing geometry. Using decals, you'll be able to place additional details, as well as dynamically generate marks from shots, footsteps, explosions, and whatever else you can think of.
Full source code for the project is available, so if you're interested in fiddling with the code, screwing around with it, or improving it.

Пікірлер: 72
@CrzyMan_Personal
@CrzyMan_Personal 2 жыл бұрын
I've never heard someone pronounce it "deckle". I've always heard it as "dee cal" (cal like in california). Great video as usual
@FluffehTheSheep
@FluffehTheSheep Жыл бұрын
kzbin.info/www/bejne/nH-Zk2ijjdiar8k
@oddity2771
@oddity2771 Жыл бұрын
Literally one of the most interesting channels and smartest guys I have ever heard speaking. But the entire video I could only think about how you would spell "deckle" and you have it in the first comment.... LOL
@oddity2771
@oddity2771 Жыл бұрын
Maybe even "Deckel" lol🤣
@AliceErishech
@AliceErishech Жыл бұрын
Apparently that's how they pronounce it in Canada. It really was distracting though.
@keldencowan
@keldencowan 11 ай бұрын
I thought it was day-cal as in the French "décalquer". Which tbf is not too far off from "deckle".
@oldsegotia2141
@oldsegotia2141 2 жыл бұрын
Bought your course as soon as I saw it. Great stuff altogether. Although I'm familiar with GLSL, your way of explaining things is second to none! Anybody out there who is hesitant because you think it might be too advanced, rest assured, Simon's got you. This is the best course out there on GLSL, believe me, I've completed several.
@simondev758
@simondev758 2 жыл бұрын
Thank you so much, I'm happy to hear that! There's still more to come, the course is very much under construction and I welcome feedback and even ideas for new sections.
@OneEfferalGan
@OneEfferalGan 2 жыл бұрын
Great video as always! I'd really like to hear your take on ECS and maybe architectures in general for game development. Keep up the good work!
@simondev758
@simondev758 2 жыл бұрын
Great idea!
@NeilSkaria
@NeilSkaria 2 жыл бұрын
Bought the GLSL course. Keep up the good work you are a godsend
@simondev758
@simondev758 2 жыл бұрын
Awesome! Thank you!
@fazlizekiqi2324
@fazlizekiqi2324 2 жыл бұрын
Great stuff and cool with the gl course as well. Will enroll as soon as i get some free time.
@swoorp
@swoorp 2 жыл бұрын
Eyy we're getting a shader course! Much awaited callback finally being asynchronously fulfilled, keep it up my man!
@zakyvids6566
@zakyvids6566 2 жыл бұрын
I love these videos it’s very nice to see this please make videos more frequently on threejs dear Simon
@medosfilms
@medosfilms Жыл бұрын
dude this is beautiful
@mulualemtekle6094
@mulualemtekle6094 2 жыл бұрын
awesome as usual
@NorppaCast
@NorppaCast Жыл бұрын
Great video, once again. I have to find the time to take your course. I know I have requested this before, but could you do a video of doing outlines (in Three.js preferably)?
@simondev758
@simondev758 Жыл бұрын
It's on my list!
@fuzzyhenry2048
@fuzzyhenry2048 Жыл бұрын
The mesh decal has a lot of problems for games. Like, can't handle well at the seams of many geometries. Causes lag if the mesh calculating is too much at the same time. You can check the post-processing decal based on the depth buffer which is more common in the game engine.
@jeremycoleman3282
@jeremycoleman3282 2 жыл бұрын
i say deecal not deckle. deckle is fun to say though
@simondev758
@simondev758 2 жыл бұрын
I looked on Wikipedia, think us Canadians say it differently heh
@jeremycoleman3282
@jeremycoleman3282 2 жыл бұрын
wiki says its was created by simon
@stpedro-ht9ng
@stpedro-ht9ng Жыл бұрын
it's so fun i always call them deckls from now on.
@christoferstenberg3920
@christoferstenberg3920 Жыл бұрын
I assumed decals worked by you just putting down a cube, feeding in the texture and the depth buffer and then figuring out the world space location of the pixel, transforming that into object space for the decal. Then checking where that is within the object space of the box and if it's inside sample the texture. I guess that's slightly more expensive ongoing but seems a bit more simple than generating a mesh. Though I'm not a graphics programmer, so not sure what the industry standard is. I guess the advantage of mine is that it works with arbitrarily complex meshes. Though might struggle with transparency as that's sometimes done in a way that doesn't add to the depth buffer...
@zdspider6778
@zdspider6778 Жыл бұрын
0:44 I don't understand, so you duplicate whatever mesh the raycast hits, and clip away extra vertices until you're left with whatever geometry was inside the decal's volume cube? Isn't that... expensive, for large objects with lots of triangles, having to loop through potentially _hundreds of thousands_ of vertices? So you basically end up with a new unique mesh for every decal? I always thought they were done in screen-space. Basically as a deferred pass, after everything was rendered, using the information from the G-Buffer. As for the stretching on the corners, I think it can be solved with a triplanar projection for the texture, instead of using UVs. I saw someone fixing this in UE4. "Dekl."
@simondev758
@simondev758 Жыл бұрын
Screen space decals are a thing, but not typically for a forward renderer. Yes, you clip away unneeded verts, you can also just use the collision mesh if you're willing to live with a not quite as good decal. Looping through a few thousand verts isn't ideal, but it's also something that happens extremely infrequently and probably won't affect your framerate one way or the other. dEEEEEEkal
@pavlebodi3476
@pavlebodi3476 Ай бұрын
You could write a quad tree for the model verts to narrow down iterating on fewer verts or you could precache the model into "mesh clusters"
@vinaciotm
@vinaciotm 2 жыл бұрын
Thank you for your vídeos!! We can use that to blood on walls Can you talk about ui, layer, for to do something like virtual joystick, button, menus, custom axesHelper Or Create objects on scene dynamically, transform controls for each, and store informations, and list objects storaged with a map loop. Like a game engine
@simondev758
@simondev758 Жыл бұрын
So kinda "how to structure a game" ?
@vinaciotm
@vinaciotm Жыл бұрын
​@@simondev758 yeah, but thinking about game engine context. Some videos i wish existed on youtube: "how to create a basic game engine with threeJS" "why/how to use class instead function for gaming" "how to make a virtual joystick in threejs" "threeJS layers/canvas explained"
@maxtech4338
@maxtech4338 Жыл бұрын
@@vinaciotm Yes, UI for three js like button, menu, text,..very much needed which is not clearly covered anywhere.
@coolmanthecool603
@coolmanthecool603 2 ай бұрын
Yeah I love deckles
@parisashahbazi3973
@parisashahbazi3973 4 ай бұрын
Hi .How can we update decal? I mean is there any way to update size,orientation,position?
@GarronArgentina
@GarronArgentina 2 жыл бұрын
Thanks! and chees!
@AllenKll
@AllenKll 2 жыл бұрын
Dekl
@simondev758
@simondev758 2 жыл бұрын
Deeeeekal
@mrbelkabachi
@mrbelkabachi 10 ай бұрын
I'm curious about the approach you use to position the gun material in front of the camera. Currently, in my own FPS game, I've encountered an issue where the gun material overlaps with objects when standing too close to them. To mitigate this problem, I've used a secondary scene. However, I'm interested in exploring alternative methods that may be more effective. Could you please share your insights on the matter?
@pavlebodi3476
@pavlebodi3476 Ай бұрын
Write a collision system where the barrel of the gun cant pass through walls or what most games do is have a raised gun animation when closer to walls
@mrbelkabachi
@mrbelkabachi Ай бұрын
@@pavlebodi3476 Thanks, I used the 2nd option with 2 scenes. I render weapon system after everywting is drawn and it has no problem. This way player can stand closer to the objects.
@worldbest3097
@worldbest3097 Жыл бұрын
/Bought your 2 courses after visit your homepage. Make more game stuff and github bro! and make more advanced classes! thx bro
@energy-tunes
@energy-tunes 8 ай бұрын
So thats why in shooters the spray mark glitches out when you do it near a corner
@idkwhatname9018
@idkwhatname9018 Жыл бұрын
What game engine you using for making games with Javascript
@clamhammer2463
@clamhammer2463 Жыл бұрын
threejs
@handler_music
@handler_music 2 жыл бұрын
man you are so cool. could you make videos about threejs in react three fiber? r3f made threejs more sane
@simondev758
@simondev758 2 жыл бұрын
I might at some point, its been on my TODO list forever.
@Desopolis
@Desopolis 2 жыл бұрын
@@simondev758 I'm stealing your First Person Camera Rig for the React-Three Rapier Library! We've got a weird version of ECS going and right now hashing out particles (which you'll see some familiar stuff in there too)
@simondev758
@simondev758 2 жыл бұрын
@@Desopolis Awesome, let me know when you've got it ready to show, would love to see how it turns out!
@baddudecornpop7328
@baddudecornpop7328 3 ай бұрын
Deh-kuhl? What part of the country do they say it like that in?
@RodyDavis
@RodyDavis 2 жыл бұрын
Bought the shader course ❤️
@simondev758
@simondev758 2 жыл бұрын
Awesome, thanks! Hope you enjoy it!
@sevazakharenko8176
@sevazakharenko8176 Жыл бұрын
Joctor Deckel and Mr Hyde
@zakyvids6566
@zakyvids6566 2 жыл бұрын
👍👍
@vidurawithanage1464
@vidurawithanage1464 2 жыл бұрын
උට්ටෝහ් එකහ්හ් 😂💔
@theostalproject
@theostalproject 2 жыл бұрын
is the course suitable for beginners?
@simondev758
@simondev758 2 жыл бұрын
Yeah it''s targetted at beginners. Eventually we reach more advanced topics, but the idea is to build up gradually, with plenty of repetition in different settings.
@kasali2739
@kasali2739 Жыл бұрын
whould it be possible to add paypal for your course?
@BhushanKamathe_B2K
@BhushanKamathe_B2K 2 жыл бұрын
Do you have any udemy course on this?
@simondev758
@simondev758 Жыл бұрын
Not currently no
@cognisent_
@cognisent_ 2 жыл бұрын
So I guess "decal" and "deckle" ( en.wikipedia.org/wiki/Deckle ) would be homophones?
@s_shake
@s_shake 2 жыл бұрын
@shinobudev
@shinobudev Жыл бұрын
That can't be very efficient for more than a few hundred decals.
@simondev758
@simondev758 Жыл бұрын
Nah, this is meant for a few here and there. If you need way more, you'd start investigating other approaches, but this is what ships with three.js.
@uiunicorn2018
@uiunicorn2018 2 жыл бұрын
FIrst!
@antoniofuller2331
@antoniofuller2331 Жыл бұрын
Hmm,
@deleted_handle
@deleted_handle Жыл бұрын
The way u say decal is so goofy lol
@simondev758
@simondev758 Жыл бұрын
deeeeekal, better?
@cate01a
@cate01a 5 ай бұрын
'deckel' 😭
@simondev758
@simondev758 5 ай бұрын
I'm Canadian eh
@StopItRyan
@StopItRyan 3 ай бұрын
Deckle lol
Spatial Hash Grids & Tales from Game Development
19:08
SimonDev
Рет қаралды 110 М.
I made an EVEN BETTER Minecraft
12:30
SimonDev
Рет қаралды 318 М.
Кәріс тіріма өзі ?  | Synyptas 3 | 8 серия
24:47
kak budto
Рет қаралды 1,7 МЛН
I Need Your Help..
00:33
Stokes Twins
Рет қаралды 91 МЛН
Writing a Particle System (using Three.js)
10:18
SimonDev
Рет қаралды 36 М.
Why Linked Lists vs Arrays isn’t a real choice
9:15
SimonDev
Рет қаралды 305 М.
Introduction to shaders: Learn the basics!
34:50
Barney Codes
Рет қаралды 270 М.
📷 Original Texture Source Photography from Half-Life 1
7:06
How Quake Failed their way to Success
21:51
SimonDev
Рет қаралды 132 М.
I Tried to Make Star Wars Battlefront II in JavaScript
13:32
SimonDev
Рет қаралды 119 М.
Why Decal Machine Is Absolutely INSANE
4:32
Josh Gambrell
Рет қаралды 215 М.
Huawei который почти как iPhone
0:53
Romancev768
Рет қаралды 128 М.
Samsung Android Mobile Battrey
0:39
Gaming zone
Рет қаралды 342 М.
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 8 МЛН