I Created My Own Custom 3D Graphics Engine
HTML-код
- Опубликовано: 12 сен 2024
- To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/... . You’ll also get 20% off an annual premium subscription.
I programmed my own 3D game engine from scratch.
How does a 3D graphics engine work? What is the graphics pipeline? I built a custom 3D graphics engine from nothing using DirectX 11 that is capable of rendering any arbitrary 3D model taken from an OBJ file. I also write several shaders, programs used to turn vertex data into something that can be seen, to give textures and shadows to the rendered triangles in the models. A work around to not being able to render objects in 2D was created. The creted 3D engine is used to create my own 3D shooter.
Play Typing Simulator 3D: inkbox-softwar...
Join the Inkbox Athenaeum Discord: / discord
Typing Simulator 3D official trailer:
Sources:
Rastertek tutorials: www.rastertek....
World Karate Championship: • Playing Every Apple II...
Creating a cube in unreal engine: • How To Make a Textured...
3D Models Sources:
Japanese teapot: sketchfab.com/...
Keyboard: sketchfab.com/...
Cheese wedge: (skfb.ly/6TFqB) by CzernO is licensed under Creative Commons Attribution (creativecommons....
Low Polly Sun Glasses: (sketchfab.com/...) by Luke_Swag_Walker
Low Poly Camera
sketchfab.com/...
Music credits:
A Crime In Progress
by John Bartmann from Free Music Archive
Liscense: CC BY-SA
This video was sponsored by Brilliant
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/Inkbox/ . You’ll also get 20% off an annual premium subscription.
Thanks for great review! Please tell about skeletal animation.
no
This video is great! I have one tip though: The ground can really just be one big square. If you use a wrapping texture and multiply the UV coordinates, the texture will be repeated across the entire square.
scam
Bro is this your only sponser
"I don't wana include a 3d model for every letter, number, and symbol. That would be ridiculous"
Later...
"I'll need to add a 3d model for each letter number and symbol"
"or if you've never learned linear algebra, think back to after you watched this section". That sentence alone was worth watching this video for. Great video!
I don't know a damn thing about programming. I didn't understand a damn thing he said. I did have a great time.
Glad I’m not the only one..had no clue about what he was on about but the knowledge is impressive!!!
I know programming. I didn't understand a damn thing he said. I did have a great time. :D
my 10 year old sister can understand this.
@@juanmacias5922 real
Then you would likely become a great programmer. Get after it homie. It's fun!
I'm really surprised with how you can just jump around doing different types of things involving programming games. Like, coding nes games in 6502 assembly, coding gbc games with 6502 assembly as well I believe, coding an mmo game using angular, and now coding a 3d game from scratch with DirectX!
GBC is incompatible with 6502 assembly. you're thinking of SM83.
He is too smart.
thats what recreational programming is all about tbh
just messing around in whatever you want
I made my own 3D game engine as part of my education. The feeling of making something from nothing is truly unique!
It's a great feeling for sure
So you're telling me that an American Company had a project called the Manhattan Project aimed to destroy the Japanese hold on the gaming market? Hmmm...
Hmmm...
Hmmm...
is that what known as illuminati lol
@@Neelesh144 The la li lu le lo!
My brain is melting trying to understand the math, but it's still really cool!
Just... calculus of points and data make funny shapes on screen yee!
Man, the project is cool and all but your presentation is A++, incredible work dude.
This is so calming but also explaining really hard things easly without cutting anything out or saying something that changes like ho many buffers direct x has!11!1!
8 BIT Minecraft.
Like how a widow looks into the sea. Knowing that her beloved has been taken by it, but still waiting, for his return.
I too look into this channel, hopelessly awaiting 8BM's return. Although I know it's fate, I still await it's return, feeding myself lies with every breath i take.
2 weeks....
Still waiting after 10 months and still no 8bm. I wonder if Inbox decided the game was done
@@j-w-8 he said 8BM was just on hiatus in another comment.
Wow, that game was really realistic
I gotta be honest, that 3d UI thing you did seems cursed.
it is indeed incredibly cursed and stupid lol
the more you dig into the workings of a computer, the more horrific things you find.
@@lazerpie101 nah not really tho the grease sits atop
wait till you find out about the full screen quad and its even more cursed cousin the full screen tri
@@RADkate that doesn't sound that bad as long as it's just one polygon. Still weird though
Well, rendering hundreds of cubes bellow you as one giant floor is kind of a bad idea
What you could do instead is make a single quad which's UV coords go higher than 1, and make sure its texture is set to repeating
Good idea, I'm sure I could write a shader for that
@@InkboxSoftware you don't need any shader for that, you just need to configure the sampler differently...
@@aspectreishauntingeurope wouldn't you need to edit the code in the shader to do that then?
@@soryabuscompany no, samplers are created on the cpu.
@@soryabuscompany Nah, theres some "Hints" or w/e its called that you could have repeating texture, clamp texture or just a single texture.
I've always been curious and interested about how all of this works on a lower-level software speaking. It is kinda interesting that software engineers do not have to worry about things like this anymore and can just use frameworks but for some reason it doesn't sit right with me.
Underneath, they are clearly very complicated tools, but it's the same as you or I 'building' a computer... you don't need to know anything about electronics. It's like putting together Lego tricks. Writers and artists don't need to understand how paper, ink and paint are made, they just use them. Bricklayers building houses don't have to understand the chemistry of bricks or the physics of adhesion. Car drivers don't need to understand rubber compounds, the physics of steering or the chemistry of petroleum or diesel in order to drive a car. 😉
@@another3997 That does make sense, should be left to computer engineers to worry about 😅
@@another3997
Consumer is the end user. That how things are. There are so much complex stuff we aren't supposed to worry! For all of this comes out of human cooperation and good labor. Components for tools, tools to assemble creations or products to please a need. And now tools combine. We combine vehicles with radio and speakers, now we add computers and cameras, illumination and even sturdier crafted glass materials. To make things better and to evolve.
@@another3997 Abstracting away all the complicated engine work has allowed so many individuals to create their dream game they never would have otherwise but devs nowadays tend to take it for granted combined with how powerful computers are so long gone are the days of clever optimizations and now we have the standard 500gb aaa game
@@lukeskywalker2 They can and likely want to make it smaller, but they don't have the time or money for that.
Why? Because the stupid shareholders demand more, more, more profits.
Yo to help with the floor rendering, add a UV multiplier into your base shader and you can gain back a lot of the performance from just using a single plane like you did previously, and scaling the floor UV texture.
This is an absolutely amazing breakdown of the graphics pipeline
9:30 No. A CPU does do SIMD. They have registers of sizes up to 512 bits now (with MTX extensions coming that'll have 1024 or 2048 in the future), and instructions that operate on them as though they were packs of 64/32/16/8 bit registers, in a way it is similar to what GPUs do, but on a far fewer number of, but far larger and more pipelined, and completely out of order, predictive, highly optimized cores. Instead, GPUs use SIMT, Single Instruction Multiple Threads. A GPU is made up of (in nvidia's terms, every vendor calls them something else) many GPC's (General Processing Cluster) that contain many SMs (Streaming multiproccesors) that contain Thread Blocks made up of two Thread Warps, which are basically a pack of 32 execution units that can do memory, floating point or integer related instructions, but no decisions, those are made by the SM controller, and all do waves of the same instruction (or they need to stall if not all of the threads are meant to take the same execution path).
Just started the video, I’ll predict that it’s sponsored by Brilliant
🤯🤯🤯
Thank you for consistently proving us with subtitles even though I may not understand everything you talk about. :)
Instead of a different texture for each colour, you could have used vertex colours.
Instead of using a bunch of cubes for the floor, just make one large cube and set the UV map to > 1 so the texture will repeat
I definitely need to keep revisiting this video, you are doing great work just creating educational videos like these! Very informative.
2:49 "and several DirectX boxes later..."
Opportunity to throw a picture of the Dreamcast in that lineage, missed. I don't know why people always forget it was the first DirectX box.
Please never quit youtube
This is absolutely stunning!
6:28 oops typo. Should be “fragments”
Since you programmed in gameboy and now 3d maybe it's time for 3d software renderer on gba? 😅
Great video!
Oh my god that outro music brought back memories....
That's a really good choice for an outro track
Pure genius!
0:09 I have never plugged a monitor into any Raspberry Pi I've owned, if it would make it cheaper (no HDMI licencing fees) I'd like them without any graphical capabilities
Better to have it and not need it, than need it and not have it
@@cool-person1161 Well, I own 17, the 16 that are in a cluster don't need any display out, I may as well keep display out on the 17th (I may actually use it one day, if making a game I can check on the worst case scenario hardware-wise)
i ❤ tty over usb
Arduino?
@@SSukram_ I need something more powerful than that and cheaper
Great video! This is so fun! You've done great! Would be cool to see more of this!
I absolutely love your mic, it reminds me of a video from 2015, please keep it 😭🙏
crazy that 3D rendering is just... how it works.
why use the proprietary directX, especially for hobbyist purposes, when there is OpenGL / Vulkan?
Had to start somewhere, and if you have Windows, you have DirectX
@@InkboxSoftware just as you have opengl ;-)
why don't you install Gentoo?
@@InkboxSoftware but vulkan works anywhere (techinaclly directx does too but thats only because the directx to vulkan layer works anywhere)
I think it's because directX is the most popular set of APIs for rendering.
I feel like he foreshadowed this by asking us to not ask whether the OLED watch could play Doom before. Unlikely, but still. 🤔
I’m surprised you didn’t use vulkan
I can't wait for Inkbox to discover SDF for 2d Text rendering^^
right now i am working on writing my own like, not game engine, but kinda the graphics side of a game engine, mainly for very fancy uis for my use case. i have not gotten to the stage of it being able to draw anything, except drawing pain into my mind. i am certain that it will need significant revisions for it to be useful for someone that isnt me lmao
i really hate to say this type of stuff, but where 8bit Minecraft update
i don't want to put pressure i just really like this concept and i admire the effort you put into it and id hate to see it all go to waste
2 more weeks
@@InkboxSoftware yippie 👍
I also want to add that I don't really mind the time it takes. In the sense that If gave devs take time for their mental health it will end up into better and more fun results. so take your time, no pressure
you made 90's bowling alley animations into a game
Well done! ❤ Next steps: animation and shadows.
Many people pointed out the floor, so I'll say this instead:
Instead of sending an image for each color for the enemies, you can send a single, grayscale image and tint it by multiplying by a color based on their health.
Sending data to the GPU is usually the biggest bottleneck, so this should speed things up a bit.
0:09 what are you doing 🗣️🗣️
7 minutes in and my mind is blown. Depth buffer is the smartest thing I've heard in a while.
Wow that sponsor transition was smooth
WOOOOOOO NEW INKBOX VIDEO FUCK YEAHH LETS GOOOOOOOO
Serene ! this is a serene and cubical 3-D Game Engine
고요하고 입체적인 3-D 게임 엔진입니다
Unreal is nothing against this! Call of Duty needs to be done with that realistic game engine.
Very cool video! Now do a triangle rasterizer yourself and do a complete software renderer ;)
(Also you don't need to create many objects for the ground, you can just repeat the texture on a single ground plane, by providing sufficiently large UV values and setting the texture clamping value)
(Also you don't need to have non-static geometry for text, you could just as well use uniforms in your shader to get texture coordinates for your letters)
To quote Ryan George: Wow wow wow... wow
21:50 Wasn't that exactly what you tried to avoid by putting written characters on a texture instead of 3D-modeling them?
i feel so smart watching these 🔥🔥
super mario land's ending song as an outro? 10/10
Video starts at 4:50
How so
The intro is clearly axed on giving viewers a basic knowledge that most don't have for the rest of the vid,is this some sort of new trend where people do their best to discard intros and context in the videos because of their ever shortening attention span
Thank you lil bro 🙏
At this time, it is impossible to have watched the entire video, because it was released 3 minutes ago.
watched it at 9x speed nerrrrd
Wrooooooooooong!@@xronium
An LLM could!
nuh uh just watch it at 2x speed
youtube counts a view after a mere 30s.
You'll probably never see this but thank you this was a very fun watch, I've always wanted to do this process myself but I'm extraordinarily lazy and probably never will.
For the HUD elements can't you just ignore the projection and modelview matrices? Doesn't that put it directly in front of the screen? sorry if thats idiotic
Yes. Not sure why he thought he had to “undo” the movement. Your hud coordinates are just screen space coordinates. Or if you want to be fancy and screen size invariant your hud coordinates are from 0-1 as a percentage of screen size then you only need to multiply by 2 and subtract 1 to put it into NDC in the vertex shader.
I just realized that you have been able to make a lot of games with different programming languages, and I remembered today that when it comes to programming you need to focus more on being a great problem solver rather than remembering syntax, and I believe that will help you be able to learn any programming language. I learn't about this from Fireship's video, how to learn to code - 8 hard truths.
Do you ever have any difficulties with making new games with different programming languages? And if not, do you think there's a reason?
All high level languages are basically the same, so it really comes down to what platform do you want to write a program for. Windows, c#, c++. Web, javascript. Linux, c, c++. Just want it to work and don't care how: python. But of course the most fun: assembly.
these games are getting really realistic!
This was awesome!
Gltf is 3d wraped in json it should be quite easy to unpack and use in your code
What's the chiptune music at the start of the video called?
I did not understand much but you're underrated
Why Windows, Inkbox? I would never go back, despite the nostalgia
Protecting the cheese from aliens?
Wallace & Gromit FPS shooter
Hi! Would you please provide the source code of Typing Simulator 3D? Is it available on Discord?
What API did you use for this project?
DirectX 11
@@InkboxSoftware nice
Clearly a fan of Duke Nukem. I'd love to see this engine fully fleshed out and open sourced, if only to add to the competition for game engines. Although, I do wonder why DirectX instead of OpenGL or Vulkan, since those are far more cross platform.
What is the program at 3:47 that lets a user create a windowed application?
I never done any DirectX stuff but I don't think you need any matrix (orthographic or perspective) to render 2D stuff. You can just use a different shader with only 2 values for position, and hardcode z coord in there. At least that's what I do in OpenGL/Vulkan
Inkbox please make this a tutorial step by step so that we can make our own 3d directx engine PLEASE!
7:57 It is actually called a fragment shader but whatever.
I learned so much in this short time wow
I tried learning graphics programming once, but I wasn't able to absorb much other than the bare minimun to render a single triangle.
When I think of all the math background seemingly required to do all the stuff you do, specially with my next to LITERAL ZERO math knowledge, to the point where I can't even multiply or divide, it makes me feel very hopeless on that front.
To be fair, I was learning OpenGL, not DirectX, but I doubt that would have made any difference, the pipeline seems to be pretty much the same.
cheddar video dude!
oh god, DX11. How many factories do you need to use to get stuff working? :D ...so much boilerplate
"So much boilerplate"
Vulkan: "Hold my VkInstance, VkPhysicalDevice, VkQueueFamilyProperties, VkDevice, VkQueue's, VkSurface, ..."
Nice, but how do I make transparancy?
Hell yeah! I'm making my own game engine with wgpu, I love custom-made engines!
Cant imagine how long this took you
I love this channel
oh cool
I never knew Windows counted every element as its own window with its own hwnd. _Strange..._
this guy made a 3d engine FROM SCRATCH
0:02 HOLY CRAP IS THAT AN UNDERTALE REFERENCE (joke)
When I do projects like this I just load in a image and render it seprately over the image (overlay)
can you add ray tracing? or just better lighting?
El Doby 🔥
3:42 whats this app called?
Visual Studio
5:23 Deivc
lol
3:45 What program is that?
0:02 that looks like roboty from bfdu
16:32 where are you getting these win95/98 styled icons?
They are windows 98 icons
that uv unwrap 😩
The way unity handles UI is to rendering it on a plane and stick it too the camera and use orthogonal view on it, rather than another ortho gfx pipeline... it renders faster UI being the worst fps hog to begin with. it also transfers CPU to GPU for some calculations.. also UI libs just need a renderer.. and you can get away with only windows buttons and text fields and editboxes with nothing else
20:39 i feel like i've seen this font in a certain viral video
Nice video, just one issue
When am I getting more 8 bit minecraft
2 more weeks
@@InkboxSoftwaresetting an alarm now
Bill Gates in DOOM with a leather trenchcoat and shotgun is CRAZYYYY
When I saw the thumbnail it was 2 views 34 seconds ago, never been that early for a long time
now get together with Louis Zhong and make Rat Taxi game