Texture Mapping & Polygon Rasterizing Tutorial (2/2) [C++20]

  Рет қаралды 49,552

Bisqwit

Bisqwit

4 жыл бұрын

Textured polygons are the foundation of nearly all 3D games in existence. Used before even 3D-capable GPUs were a thing, they were rendered using nothing but software. How was that achieved? Let’s explore an easy and intuitive method. We create an extensible 3D polygon rasterizer using nothing but standard C++20 (and libSDL for 2D graphics).
Become a member: kzbin.infojoin
My links:
Twitter: / realbisqwit
Liberapay: liberapay.com/Bisqwit
Steady: steadyhq.com/en/bisqwit
Patreon: / bisqwit (Other options at bisqwit.iki.fi/donate.html)
Twitch: / realbisqwit
Homepage: iki.fi/bisqwit/
You can contribute subtitles: kzbin.info_vide...
Downloads:
bisqwit.iki.fi/jkp/polytut/
Music list (s = SPC-OPL conversion):
- Super Mario RPG ­- Sunken Ship (s)
- Tales of Phantasia - Final Act (s)
- Final Fantasy V - World 1+2 (s)
- Famicom Tantei Club 2 - Interviews (s)
- Energy Breaker - Heroes’ Adventure (s)
- Final Fantasy Mystic Quest - Shrine (s)

Пікірлер: 231
@Bisqwit
@Bisqwit 4 жыл бұрын
Here is a patch that fixes the staircase error in the right edge of the texture: - bisqwit.iki.fi/jkp/polytut/patch-fix-rounding-error.txt Here are some links to material you can study. Perspective projection: - en.wikipedia.org/wiki/3D_projection Vector math: - en.wikipedia.org/wiki/Vector_%28mathematics%29 Matrix math: - en.wikipedia.org/wiki/Transformation_matrix - en.wikipedia.org/wiki/Affine_transformation#Image_transformation - en.wikipedia.org/wiki/Matrix_%28mathematics%29 Quaternions: - en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Using_quaternion_as_rotations - en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Quaternion-derived_rotation_matrix - en.wikipedia.org/wiki/Quaternion#Hamilton_product Plane: - en.wikipedia.org/wiki/Plane_%28geometry%29 Polygon clipping: - en.wikipedia.org/wiki/Vatti_clipping_algorithm - en.wikipedia.org/wiki/Greiner%E2%80%93Hormann_clipping_algorithm - en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_clipping_algorithm - en.wikipedia.org/wiki/Weiler%E2%80%93Atherton_clipping_algorithm
@CykPykMyk
@CykPykMyk 4 жыл бұрын
if i were a woman i'd marry you
@binouche2281
@binouche2281 4 жыл бұрын
Hello, you described the used library as SDL in the description, but it's SDL2... Not really anything important, just wanted to mention it... Apart from that, this video was even better than your usual. EDIT: Just to say, I already knew texture mapping, but I decided to look at your video anyways, and it sure is a good thing. Using ordered dithering on the textures is pure genius!
@FODKOM
@FODKOM 4 жыл бұрын
Bisqwit, hope you are staying well. Your knowledge is sacred in the wired world. Can't believe you are releasing this for free, as information flows. You are the keeper of the golden knowledge basket. Shalom indeed. God bless.
@clintonevans2226
@clintonevans2226 4 жыл бұрын
Hi, Bizqwit. As a 40+ year old that started to learn programming a few years ago, I enjoy just watching and listening (even if I do not understand much). Hopefully this will become my "old man" hobby like trains or gardening. You really are able to show the beauty of rendering and gfx engine coding coupled with the passion of self motivated learning. I just wanted to say thanks and I hope both of us can find the time in future to do more coding :)
@c0xb0x
@c0xb0x 4 жыл бұрын
The problem is that fluid intelligence and memory decline precipitously after about age 23 so don't wait too long!
@adagas-caouchristian7875
@adagas-caouchristian7875 4 жыл бұрын
​@@c0xb0x Maybe so, but motivation and passion come and stay at any age - If both are kept lit, I think that they far outweigh the consequences of our brains' aging. I do hope that even after decades you will continue to enjoy your hobbies as much as ever!
@SirusStarTV
@SirusStarTV 3 жыл бұрын
@@adagas-caouchristian7875 i lost passion in everything i was doing before 16 years :( but it's what i want to do in my life, for some reason my brain thinks it's boring 😤
@lolluspingus
@lolluspingus 3 жыл бұрын
There are a couple "old people" (40s and 50s) in my school learning programming as first-timers, and they're doing better than many of the 20s and 30s. Keep it up, don't let anybody imply it's too late!
@malbacato91
@malbacato91 4 жыл бұрын
10:13 "array called ARRRH" threw me out of guard :lol: EDIT: your pronunciation of חג שמח is surprisingly accurate
@marksmod
@marksmod 4 жыл бұрын
10:10
@LangleyNA
@LangleyNA 4 жыл бұрын
LOL _"Of course there are some dithering artifacts now, but if you watch this video in _*_160p,_*_ you totally cannot even notice them."_
@DarianCabot
@DarianCabot 4 жыл бұрын
26:29 "...and nothing does not not fail to work" 🤯
@MeepMu
@MeepMu 4 жыл бұрын
18:02 someone has been watching chubbyemu :)
@kanonenfutter8433
@kanonenfutter8433 4 жыл бұрын
"Especially when ones mind is prone to depression." Atleast you manage to get things done in your freetime.
@LittleRainGames
@LittleRainGames 4 жыл бұрын
Try taking some magic mushrooms. May give you a new perspective.
@harleyspeedthrust4013
@harleyspeedthrust4013 4 жыл бұрын
I just watched Part 1 and was wondering when this would come out, I went to the youtube homepage and saw that this was just posted! I love these videos! 7:54 - I had this problem too, I wrote a polygon software renderer a few years ago so watching you work through the same problems I had is interesting and awesome
@binouche2281
@binouche2281 4 жыл бұрын
Each time my notification bell rings, I cross my fingers in the hope it's one of your videos... And what I got here was way more than satisfaction.
@supersquare
@supersquare 4 жыл бұрын
Thank you so much for these incredible videos!! I can't wait to see more C++ graphics videos. Hope you are well :)
@patocontreras8336
@patocontreras8336 4 жыл бұрын
I really like your content, please never stop doing this!
@treyquattro
@treyquattro 3 жыл бұрын
ooh, Immediately Invoked Lambda Expression. Your C++ expertise is A++
@GabrielPiveta
@GabrielPiveta 4 жыл бұрын
I love your videos. But as a C programmer I get really confused with this code 😂
@gustavlouw3362
@gustavlouw3362 4 жыл бұрын
26:50. I feel you bisqwit. As wonderful as computers are to use and program, they also separate us and promote individualism. It's easy to slip into depression when the world just wants to be alone and watch KZbin and Netflix (especially in the winter, and even COVID quarantine). The best we can do is to love our craft, and then to give and show others kindness in our daily lives (much like you and your generous tutorials). Warmer days ahead, and stay safe amongst COVID.
@LogicEu
@LogicEu Жыл бұрын
Fantastic resource for learning computer graphics and rendering algorithms, thank you Bisqwit!
@kr1sso
@kr1sso 4 жыл бұрын
Hang in there - you're awesome and so is your content. Really appreciate this, so keep on going! Thank you!
@iwisnumazigh8271
@iwisnumazigh8271 4 жыл бұрын
Keep making videos like this. I really like your channel. Thanks for these free informations.
@liuzq7
@liuzq7 4 жыл бұрын
You are just amazing. And I feel like I am touching the future, yet with the acient editor and UI.
@Bisqwit
@Bisqwit 4 жыл бұрын
Oh by the way, this was the vector mathematics library that I wrote 5 years ago when I was working on this project. You can really see a difference between this and in what I showed in the video. This would have been _horrible_ to parade on the screen. pastebin.com/rQRKMKYr math.hh pastebin.com/7nH7y8Rm math_simd.hh
@williamragstad
@williamragstad 4 жыл бұрын
You are so amazing and I really look up to you, I wish I was as good as you at programming :O
@GeraldThom
@GeraldThom 4 жыл бұрын
Absolutely amazing stuff man, mesmerising :) I wish I had your insight and access to this channel back in the 90s when I worked on my own 3d engine on the Amiga 1200 of all things. I had a texture mapper and fast flat shader (using some 68020) working with bitplanes (first on ST) and had a sparse 'moon' I could run around and jump in with a few 3d objects. But perspective correction and particularly frustum clipping gave me a really hard time and seeing you break it down so eloquently is a joy to behold. Was worth all my effort in the end though as I used the demo in a showreel which got me started in the games industry. Keep up the good work Bisqwit, you are inspiring and a legend and should be very proud of this.
@1red114
@1red114 4 жыл бұрын
good as always
@Nikkes02
@Nikkes02 4 жыл бұрын
Your videos are very enjoyable. Thank you :)
@accountNo0
@accountNo0 4 жыл бұрын
Another excellent video thank you so much!
@sneakyfatcat
@sneakyfatcat 4 жыл бұрын
neat! great video + explanation
@BLUYES422
@BLUYES422 4 жыл бұрын
i suffer from depression and lack of inspiration aswell! i hope you're doing well and im glad to see the wheels turning again!
@finrost4908
@finrost4908 4 жыл бұрын
Wowwwww this is amazinggggg😀
@BrilCon
@BrilCon Жыл бұрын
Very cool! I want to make 3D engine in Scratch and I am very thank to you for explaining clipping!
@space302
@space302 Жыл бұрын
Fantastic video. I always wondered how perspective correction was applied to textures.
@antoniogarest7516
@antoniogarest7516 4 жыл бұрын
Great videos! 😁👌
@wenelol
@wenelol 4 жыл бұрын
God, Bisqwit would be a perfect teacher.
@esbensloth
@esbensloth 4 жыл бұрын
After discovering Bisqwits my pull-request started to take twice as long to get approved. 🐱‍👤
@unevenprankster
@unevenprankster 4 жыл бұрын
Thanks for the shout out Bisq! I appreciated playing with these algorithms but felt I could not understand well what they did with the verbose and odd syntax more modern C++ has taken on for me. As a result I have gone to C as I find it more suited for my purposes in gamedev, but it is only what I feel benefits me in specific, not everyone will agree with my choice. Nevertheless your videos have inspired me in the first place to search out for the technicalities of games and software and I am glad you have taught me lots of things. Onto the next topic!
@pendergastj
@pendergastj 4 жыл бұрын
How about just _not_ using those features instead? You aren't forced to cram new features everywhere. Why make the switch to an outdated obsolete language that frankly is _terrible_ for making games in?
@KishoreG2396
@KishoreG2396 4 жыл бұрын
@@pendergastj I second this. While C can arguably have its purposes, for (general purpose) game development it is far from ideal. Also I have no idea why OP switched to C from C++ when C++ supports everything from C and more.
@peter.bacinsky
@peter.bacinsky 3 жыл бұрын
This was brutal
@ThatGuyDownInThe
@ThatGuyDownInThe 4 жыл бұрын
You're an actual God.
@t33th4n
@t33th4n Жыл бұрын
Oh god, I was literally looking for the Bayern dithering for years now, didn't know the name back then. But not because of the speed, but the looks! Seen it in some 90's games, and very much liked it.
@garaion
@garaion 4 жыл бұрын
Question, did you have time to research webassembly and if so any interesting insights on the in-browser possibilities? Happy holidays keep safe this season.
@XeonProductions
@XeonProductions 4 жыл бұрын
I heard a sizzling noise that was my brain frying when you started going over all the mathematical concepts.
@scriptercoding
@scriptercoding Жыл бұрын
Very nice Bisqwit, I'm a fan from Brazil! ;D
@santitabnavascues8673
@santitabnavascues8673 3 жыл бұрын
Awesome :) a challenge could be to create a distorted sprites renderer, just like the saturn had in hardware, distorting sprites corners shouldn't give away the diagonal appearing in distorting quads when using two triangles on them. The restriction on distorted sprites is that the opposites edges of a quad render the same amount of texels, in other words, the mapping coordinates of a quad are always a quad. Keep the awesomeness 👌
@axelsanner5360
@axelsanner5360 4 жыл бұрын
Thank you
@StephanusTavilrond
@StephanusTavilrond 4 жыл бұрын
You used Unreal-style dithering for texture coordinates
@miszczklasykuw3025
@miszczklasykuw3025 4 жыл бұрын
bisqwit... returns : D
@WarpRulez
@WarpRulez 4 жыл бұрын
Perspective-correct texture mapping is not something that's very often nor clearly explained, neither in videos nor at any websites and tutorials. (The _concept_ of "perspective-correct texture mapping" is often explained, but not the actual way of doing it, the actual math needed.) This even though it's one of the most fundamental things one needs to know if one wants to implement a scanline renderer of any sort (or at least one that supports texturing).
@KuraIthys
@KuraIthys 4 жыл бұрын
That's likely because it's taken for granted. We haven't had hardware 3d implementations that don't implement it since about 1996... And the reasons for doing affine vs perspective correct texture mapping in software are almost entirely performance related. (depending on your underlying computer architecture, Affine texture mapping can be anything from 3 to 20 times faster than perspective correct mapping.) - thus this became less relevant over time, and I guess people gave less thought to bothering to explain the difference or how it works... I prefer older books for this subject, because they tend to explain both what it's about, why it's implemented and show variations of both affine and perspective correct mapping algorithms. Having said that, the current wikipedia article describes the mathematical basis well enough (if you understand mathematics of course) en.wikipedia.org/wiki/Texture_mapping Technically this tells you all you need to know, but may not be the easiest thing to interpret. Still, it can indeed be frustrating dealing with your average modern tutorial on the subject...
@sznio
@sznio 4 жыл бұрын
I like that nod towards chubbyemu at 18:00
@boscorner
@boscorner 2 жыл бұрын
Personally as a huge ps1 graphics fan, I love the look of affine texture mapping!!
@KuraIthys
@KuraIthys 4 жыл бұрын
Ouch... Quaternions are one of those things... As purely mathematical objects they are pretty hard to follow. There's a whole class of higher dimensional versions of them that have no known practical purpose. But for some reason the 4 value one turns out to have uses in 3d graphics... Though if it helps, the best explanation I ever came across for what a quaternion is doing, as it applies to 3d transformations is that the quaternion defines a plane in 3d space, and then a rotation around that plane. In other words, it defines an arbitrary angle of rotation around an arbitrarily defined 2d plane in 3d space. It of course also has the useful property (much like matrices) that if you combine two quaternions together (I forget the actual mathematics of it), you get a quaternion that combines the result of applying both quaternions individually. (Also you can interpolate between two Quaternions and the result will be a smooth transition between the two.) I've forgotten a fair bit of the details, but it was actually pretty interesting learning what a quaternion technically defines. In a way you could argue it's a geometric transformation in 4 dimensions rather than 3. But nonetheless the practical effect is that it defines not only an angle of rotation, but also the plane on which this rotation takes place...
@vappyenjoyer24
@vappyenjoyer24 2 жыл бұрын
19:35 bisqwit goes into the 6th dimension
@saultube44
@saultube44 4 жыл бұрын
Thanks for the lesson, Master Programmer
@KuraIthys
@KuraIthys 4 жыл бұрын
Depends on your high school I guess. When I was doing exams at the end of high school we had 3 maths classes with their own exams. They go by the rather unimaginative names of Maths A, B and C. You cannot do all 3. You either do Maths A, or you do Maths B... Maths C is optional, but you have to be doing Maths B to do Maths C In any event, both Vectors, matrices and even quaternions show up in the Maths C exam... Roughly speaking the 3 types of mathematics correspond to career paths. Maths A is basically for if you were going to be an accountant or bookkeeper or the like, or were intending to study something like Economics. Maths B is the most general, but also leans towards science and engineering uses. Maths C is 'advanced' mathematics, and again leans towards science and engineering (And of course anyone intending to study mathematics explicitly as a subject.) Anyway, you just reminded me of my exams. Thanks. ;p Also, it's interesting to hear you explain something as relatively unimportant as your coding style. Makes sense that you'd want to show as much of a program as reasonably possible onscreen at once. Nothing more annoying than 'coding style' pedants though... XD Or the people that argue about definitions, insisting theirs is the only valid point of view. Got into an extremely tedious argument with someone once about what, precisely, 'pass by reference' means. I pointed out there is widespread usage of this term throughout many sources of this being any kind of indirect way of passing a data structure (like, say, using a pointer), they insisted that the many sources I could easily show them were all 'wrong', and that it exclusively meant the C++ 'reference' type, and nothing else. In the end what's annoying about that is that it's so... unimportant. It's the worst kind of pedantry. With things like that what matters is that people understand one another, not whether any given definition is 'correct' or not... But, such seems to be the nature of programmers. Which I guess makes sense given how small errors in code can create huge problems. It's still incredibly annoying to endlessly have to deal with the most pedantic people in existence though.
@HadryanSalles
@HadryanSalles 4 жыл бұрын
ok... I just really like your honesty about quaternions... hahaha
@jsd1982
@jsd1982 4 жыл бұрын
Great video! Does a Z-buffer store inverse-Z values? I think working in the inverse-Z space helps avoid Z-fighting issues for triangles far off in the distance.
@Bisqwit
@Bisqwit 4 жыл бұрын
The Z-buffer stores real Z values in my code. However, you could just as easily make it store inverted values instead and just flip the comparison. Interesting idea regarding Z-fighting. Would need to test it to verify if that’s the case.
@fffUUUUUU
@fffUUUUUU 4 жыл бұрын
Isn't this called a W-buffer?
@elmonni2103
@elmonni2103 4 жыл бұрын
SHALOM!!!
@mincrmatt12
@mincrmatt12 4 жыл бұрын
Wasn't that ending sequence test hidden in some other video? I could have sworn I've seen something similar -- perhaps on the DOS OpenGL thingy? I always wondered if it would get made into a full video; I guess now it has!
@Bisqwit
@Bisqwit 4 жыл бұрын
I have teased on it a few times along the years, but I don’t think I have ever shown that particular clip.
@huyvole9724
@huyvole9724 4 жыл бұрын
Nice code style
@platin2148
@platin2148 4 жыл бұрын
For a in depth Quaternion insights Visualizing Quaternions is a book full of stuff.
@JoneKone
@JoneKone 4 жыл бұрын
Arrays go arrrrrr
@culpritdesign
@culpritdesign 3 жыл бұрын
Who else is watching at 160p to not notice the dithering? :-P
@petacreepers23
@petacreepers23 4 жыл бұрын
Specially when ones mind is prone to depression... Lots of programmers relate to that, me included :/ PD. Loved the last song
@jamesbalajan3850
@jamesbalajan3850 4 жыл бұрын
Its a shame that this series is coming to an end already. I look forward to your next project Bisqwit.
@Bisqwit
@Bisqwit 4 жыл бұрын
The series is not actually coming to end yet! I have only just gotten started. There is a lot that I want to do and I am already working on it. But I made these first two parts into a two-part series, because together they form a coherent topic. Thanks for commenting!
@jamesbalajan3850
@jamesbalajan3850 4 жыл бұрын
@@Bisqwit Can't wait to see you work on some more 3D graphics then. Its a great interest of mine and you tackle the topic in an interesting and enjoyable to watch way.
@kecoje
@kecoje 4 жыл бұрын
Can you make a video on what if graphics ere rendered asynchronously?
@miszczklasykuw3025
@miszczklasykuw3025 4 жыл бұрын
will you try make ur own library like libSDL in future (to handle 2D)?
@Bisqwit
@Bisqwit 4 жыл бұрын
No. There would be _so_ _many_ cases to handle, like different APIs, different OSes, to no end. No thanks.
@marksmod
@marksmod 4 жыл бұрын
damn, I need to up my game. Quaternions ftw
@alkhaidurihudayaarsi7462
@alkhaidurihudayaarsi7462 4 жыл бұрын
This is the real code lyoko
@darkdevil905
@darkdevil905 4 жыл бұрын
A true Viking Programmer
@imrank340
@imrank340 8 ай бұрын
I like that "I never neen there" (University)
@Bisqwit
@Bisqwit 8 ай бұрын
Yeah, that was true when I made the video!
@KishoreG2396
@KishoreG2396 4 жыл бұрын
Where can I learn C++20? There are not many books for this standard released yet.
@Bisqwit
@Bisqwit 4 жыл бұрын
You asked the same (similar) question two weeks ago. I replied: en.cppreference.com/ - Reference manual on all things C++ (look for things that say C++20; Wiki, so it’s updated once in a while) en.wikipedia.org/wiki/C++20 - Summary; search for things that pique your interest or click the reference links gcc.gnu.org/projects/cxx-status.html - TODO/status list for GCC, including links to the proposals that describe the feature (quite technical) gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2020 - TODO list for the standard library component of GCC, including links to the proposals that describe the feature (quite technical) These are my four main go-to resources on new things C++. Also for keeping up to date with C++ news, there are several subreddits, such as reddit.com/r/cpp
@L1Q
@L1Q 4 жыл бұрын
こんにちは Bisqwitさん ;D
@treyquattro
@treyquattro 3 жыл бұрын
hey Bisqwit, 1+2+4+8+16+32+64 == 127 Fun video. Thanks for the intro to SDL - it's new to me! I'm impressed that you grabbed hold of C++20 so rapidly. I'm still on C++17...
@Bisqwit
@Bisqwit 2 жыл бұрын
Experimenting is the way to learn…
@treyquattro
@treyquattro 2 жыл бұрын
@@Bisqwit absolutely. I have no excuse...
@Bisqwit
@Bisqwit 2 жыл бұрын
@@treyquattro Your comment was put in "held for review", and I deleted it. Do not reply to the spam bots. It does not do any good. There is no person reading the feedback, it’s a 100% automated hit-and-run campaign. And I will eventually delete the spam; it’s just tons of work. I have deleted like 800 of those so far, and it has to be done one by one. Each of them involves like 4 clicks. KZbin is not really well equipped to deal with this.
@treyquattro
@treyquattro 2 жыл бұрын
@@Bisqwit Thanks. I'm just venting, mostly at UselessTube for their inability to do anything about this infestation (it's usually bitcoin pump & dumpers). I usually report the offenders, but of of course the people at KZbin are just sitting on their asses doing nothing but getting rich. I'm glad someone on is on the case. I don't envy you. Godspeed, Bisqwit. (I presume the process can be automated, or at least streamlined. I noticed they're getting smarter about trying to avoid NLP. I actually thought that was pretty smart of the spammers, and most likely a reason why YT is ineffectual)
@platin2148
@platin2148 4 жыл бұрын
Do they really want one to use range based for loops for filling arrays i thought it makes sense to use std::fill_n? But maybe it’s equal in performance.
@Bisqwit
@Bisqwit 4 жыл бұрын
It makes absolutely no difference. “Fill memory region with given value” is one of the simplest patterns identified by a compiler and no matter how you write it, it will essentially generate same code for it.
@wick3dwick
@wick3dwick 4 жыл бұрын
Great video as always. Explained the topic very well, but i have some questions regarding your c++ style more than anything. You make great use of Lambda functions, but i cant really figure out why. For example, with the Perspective(Un)Project and MakeFrustum lambdas, wouldn't it be more typical to make them regular functions, and if they dont need to be a function, why is it a lambda, and not just a regular block of code? Hope someone can give an answer to this. I am new to C++, and looking to improve :-)
@Bisqwit
@Bisqwit 4 жыл бұрын
Scoping is the reason. To keep related things closeby. Lambda is a solution that allows you to keep related code very close to where it is being used, rather than shotgunning everything everywhere. The series is not over yet though. In every episode I have refactored the code once or twice, and it will keep happening.
@interlace84
@interlace84 4 жыл бұрын
I feel so bad for ever smiley at the end of every line..
@c0xb0x
@c0xb0x 4 жыл бұрын
);
@charafbelaid2659
@charafbelaid2659 4 жыл бұрын
which linux distri you use ????
@lrobertiii
@lrobertiii 4 жыл бұрын
Thank you for the video! Do you have any videos on Vulkan API?
@Bisqwit
@Bisqwit 4 жыл бұрын
No. I cannot imagine any possible way to make Vulkan interesting, considering that its “hello world” example is like 200 lines of boiler plate code.
@fffUUUUUU
@fffUUUUUU 4 жыл бұрын
@@Bisqwit there are a lot of open source libs which hide all the boiler plate code giving you the clean space to do pure Vulkan stuff.
@Bisqwit
@Bisqwit 4 жыл бұрын
By then it’s not so much a tutorial on using Vulkan than it’s a tutorial on using that particular open source library. I did use SFML in my 75000 subs demo (in addition to OpenGL) because it was not a tutorial, but in videos that are intended for teaching, I try to keep dependencies as close to zero as possible.
@fffUUUUUU
@fffUUUUUU 4 жыл бұрын
@@Bisqwit are we still talking about the boilerplate code? Because what you mean is a graphics engine. When coding for opengl do you use GLUT or similar tool lib?
@Bisqwit
@Bisqwit 4 жыл бұрын
When I am making videos, I try to keep dependencies as close to zero as possible.
@XanCraft21
@XanCraft21 3 жыл бұрын
Are you able to make the full code available from a link to a website where i can copy and paste the full finished code? I am planning to convert this into a code for use in the arduino software if that is ok with you. Thank you.
@Bisqwit
@Bisqwit 3 жыл бұрын
The download link is in the video description.
@XanCraft21
@XanCraft21 3 жыл бұрын
@@Bisqwit Thank you very much!
@cosmicrdt
@cosmicrdt 4 жыл бұрын
I know you're trying to keep all the code readable on the screen but through the process of condensing and refactoring you're actually making it harder to understand. This is pretty heavy stuff I wouldn't mind if it were spread out longer for the sake of making it easier to understand. Keep up the great work though I still enjoy all of it.
@Bisqwit
@Bisqwit 4 жыл бұрын
My mathematics library for this project initially looked like this. pastebin.com/rQRKMKYr This would have been _so_ tedious to go through on screen. The current version is much less painful.
@gz6963
@gz6963 Жыл бұрын
6:30 Hey @Bisqwit, I had been looking up quaternions and I did not understand it well at all, but I recently found a Wikipedia article on "Rodrigues's rotation formula", which can be used to rotate a 3D vector by an angle about another 3D vector. It only uses cosine, dot products and cross products, not even any matrices. Somehow I found this much more understandable than the usual business of converting vectors to quaternions, performing the rotation, and converting back to vectors. Seeing as how the formula isn't widely taught I thought I should draw attention to it as an alternative to quaternions when doing 3D math: en.wikipedia.org/wiki/Rodrigues'_rotation_formula
@fl4shi238
@fl4shi238 4 жыл бұрын
Small correction: Anti-aliasing and linear texture filtering are not synonyms. Anti-aliasing tries to make polygon edges fuzzy, while texture filtering makes texel edges fuzzy.
@Bisqwit
@Bisqwit 4 жыл бұрын
Addressed on the annotation on screen. This distinction is artificial in nature due to distinct implementation mechanisms. In terms of outcomes to achieve, both are antialiasing. Aliasing (whether it is graphics, sound, or any measurement) is when a sample has to pigeonhole into _one_ target (such as _one_ texel of _one_ polygon). Anti-aliasing is whenever artifacts arising from this phenomenon (such as jagged appearance or non-effect of skipped-over samples) are mitigated.
@fl4shi238
@fl4shi238 4 жыл бұрын
@@Bisqwit Sorry, I had annotations disabled :( You're right, both are measures against aliasing. However in computer graphics jargon word "anti-aliasing" seems to reserved for smoothing polygon (or other rasterized shape) edges.
@Bisqwit
@Bisqwit 4 жыл бұрын
The annotation I referred to is burnt in on the video. KZbin’s “annotations” were permanently deleted little more than a year ago.
@fl4shi238
@fl4shi238 4 жыл бұрын
@@Bisqwit Oh, there! I guess I was too concentrated reading the code to notice that in first time.
@Kawa-oneechan
@Kawa-oneechan 4 жыл бұрын
Ladies and gentlemen, we have a Playstation-tier texture mapper XD
@Mautar55
@Mautar55 4 жыл бұрын
Hey Bisquit, did you tried Rust?
@justaprogrammer3764
@justaprogrammer3764 4 жыл бұрын
he just said hes never been to uni...let that absorb into your head.
@TiagoTiagoT
@TiagoTiagoT 2 жыл бұрын
Why did people go with tris, instead of quads, with the texture coordinates and stuff simply interpolated based on tweening between 4 corners?
@NonTwinBrothers
@NonTwinBrothers 11 ай бұрын
As I've heard, that's what the Sega Saturn did
@yerrikororong8047
@yerrikororong8047 4 жыл бұрын
My regular mind is burning
@Bisqwit
@Bisqwit 4 жыл бұрын
Time to switch to your special mind then!
@tulusarissugianto
@tulusarissugianto 4 жыл бұрын
Hello internet, Im from Indonesia !
@Ribulose15diphosphat
@Ribulose15diphosphat 2 жыл бұрын
27:21 You are entering the first level on Descent trough the exit, right ?
@Bisqwit
@Bisqwit 2 жыл бұрын
Yup, that’s right.
@112BALAGE112
@112BALAGE112 4 жыл бұрын
I don't quite understand this "inverted z coordinate" thing. Shouldn't homogeneous coordinates be used instead?
@Bisqwit
@Bisqwit 4 жыл бұрын
Inverted means 1 divided by the value.
@platin2148
@platin2148 4 жыл бұрын
How did you make the bloom? Gauß maybe?
@Bisqwit
@Bisqwit 4 жыл бұрын
In my video editing software, I added the same video twice to the same spot in the timeline. One with a blur filter applied on it, and without. The one without is rendered atop the blurred one.
@platin2148
@platin2148 4 жыл бұрын
Bisqwit Ohh i thought it’s done in the renderer ;)
@Bisqwit
@Bisqwit 4 жыл бұрын
No, there was an annotation on the screen explaining that the stars, the bisqwit logo and the bloom were added in postprocess.
4 жыл бұрын
Do you have github profile. I want to learn by reading code. Video is fast 😭
@Bisqwit
@Bisqwit 4 жыл бұрын
This is mine, but not nearly all my projects are there. github.com/bisqwit/
@chiptuneanimation4492
@chiptuneanimation4492 4 жыл бұрын
This question keeps lingering in my mind, since a lot of people contradict each other, so please, Bisqwit or someone else answer me: in what cases should one use c and in what cases should one use c++? And what are the pros and cons of each language?
@Bisqwit
@Bisqwit 4 жыл бұрын
Many people would disagree with me, but for me, it’s “use C only if C++ is not available”. There was a point in my life when C++ was to me “C with shortcuts that make life easier”. That was about 25 years ago. Then I discovered modern C++, which had been just standardized, and that’s when the situation changed. Since then, C has been to me “C++ with handicaps”. And those handicaps have grown bigger and bigger by the year. To others, I would say “use C++, unless 1) C++ is not available, 2) you are very familiar with C and don’t know how to make use of C++”. There may be a few other reasons, such as “3) you are writing a library that you want to publish, and you only want to distribute it in binary form and you have settled on a very stable API that is unlikely to change in the coming decades” and “4) your C++ is atrocious”. ;-)
@chiptuneanimation4492
@chiptuneanimation4492 4 жыл бұрын
Thanks for your answer. As a follow-up question I want to ask you: What about using C for system programming. Is it justified in such a case? And even when using c++ in the case of system programming, would the performance difference be significant? And concerning multimedia libraries: why use SDL over SFML and vice versa?
@Bisqwit
@Bisqwit 4 жыл бұрын
My previous answer also covered situations like system programming. As for comparing SDL against SFML, the overall thing is that SFML is a vector graphics library while SDL is a pixel graphics library. While it is possible to cross the domains either way, that’s how they are designed. I tend to do mostly pixel graphics.
@Jkauppa
@Jkauppa 3 жыл бұрын
your starting assumptions, if forced, will make you are prisoner of them
@p_aja_udah
@p_aja_udah 4 жыл бұрын
I ask for help, so that you provide an Indonesian translator, because of your KZbin videos, it is very useful for us beginners, thanks in advance, and thanks back to you if you see my comments.
@Bisqwit
@Bisqwit 4 жыл бұрын
My videos have community translations enabled. Anyone can submit translations for video title, video description, and captions. _I_ don’t speak Indonesian, but many of my recent subscribers do, including, I suspect, you. Click the link in the video description for details.
@acos21
@acos21 4 жыл бұрын
Very off topic question (very!). Since i value your knowledge and insights from work. religion to programming im wondering about...your diet! Any rules or guidelines on what you eat? What do you drink usually during the day?
@Bisqwit
@Bisqwit 4 жыл бұрын
I loosely follow the kosher diet, which means I don’t eat pork or shrimp among a few other things, but other than that, I’m quite flexible. Mostly I drink water. I always have a water bottle that I fill with tap water. We have very clean tap water here in Finland. At work I also drink coffee throughout the day, but at home (even while working remotely) not so much. I don’t even have a coffee machine. Sometimes I have red wine.
@acos21
@acos21 4 жыл бұрын
​@@Bisqwit Do you eat sugar/candies often?
@Bisqwit
@Bisqwit 4 жыл бұрын
No. I am gaining weight much more easily nowadays than I did 10 or 20 years ago, so I try to keep those to rare occassions.
@acos21
@acos21 4 жыл бұрын
@@Bisqwit Same here. Thank you for the info. I hope you will have time for more videos on the Extra and Bible channel soon. Although i not always agree with your non-tech related opinions i, as i said before, certainly value them. And i think this goes for more of your followers than you can imagine.
@elmonni2103
@elmonni2103 4 жыл бұрын
siipaspas proukramming 🤣🤣
@ihavesoomanyplaylists428
@ihavesoomanyplaylists428 2 жыл бұрын
can you give us the white block texture ?
@Bisqwit
@Bisqwit 2 жыл бұрын
What is "the white block texture" that you are referring to?
@ihavesoomanyplaylists428
@ihavesoomanyplaylists428 2 жыл бұрын
@@Bisqwit the white block texture used for the white blocks in the scene its literally used everywhere for the white blocks.
@Bisqwit
@Bisqwit 2 жыл бұрын
But in this video I only used a multicolor texture?
@ihavesoomanyplaylists428
@ihavesoomanyplaylists428 2 жыл бұрын
@@Bisqwit sry it was in next videos
@martysh1226
@martysh1226 4 ай бұрын
4:03 ... it's been 4 years! are you still planning to make that video?
@Bisqwit
@Bisqwit 4 ай бұрын
Thanks for reminding me!
@martysh1226
@martysh1226 4 ай бұрын
@@Bisqwit you're welcome!
@dekrain
@dekrain 4 жыл бұрын
For the mathematics of vectors & stuff part I strongly recommend checking out channel 3Blue1Brown. It has an amazing intrudactory series on linear algebra and also on quaternions.
@lol0907
@lol0907 4 жыл бұрын
Here's the weird question Can you track God with programming?
@Bisqwit
@Bisqwit 4 жыл бұрын
Weird question confirmed.
@huyvole9724
@huyvole9724 4 жыл бұрын
Why can you put temperture, time, ... in Joe?
@Bisqwit
@Bisqwit 4 жыл бұрын
Because why not.
@huyvole9724
@huyvole9724 4 жыл бұрын
@@Bisqwit I had downloaded Joe but it's not default :( my fault is installed on Windows or some configuration I missed?
@Bisqwit
@Bisqwit 4 жыл бұрын
Look at your .joerc and search for the word “hour” for starting points on how to add time to the status line. The rendering of temperature and _seconds_ cannot be done with normal Joe. Joe only renders time at minute precision, not second precision. In my case those parts involve video editing tricks (done by the homebrew terminal emulator).
@invalid5777
@invalid5777 4 жыл бұрын
yo, quick little repeated question, what is your job?
Texture Mapping & Polygon Rasterizing Tutorial (1/2) [C++20]
22:46
CAN YOU HELP ME? (ROAD TO 100 MLN!) #shorts
00:26
PANDA BOI
Рет қаралды 36 МЛН
Cute Barbie Gadget 🥰 #gadgets
01:00
FLIP FLOP Hacks
Рет қаралды 35 МЛН
What are EXE files made of?
11:00
Bisqwit
Рет қаралды 144 М.
Forbidden C++
33:07
javidx9
Рет қаралды 1 МЛН
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 4,9 МЛН
Let's Program Doom - Part 1
25:13
3DSage
Рет қаралды 392 М.
Creating a Doom-style 3D engine in C
18:50
Bisqwit
Рет қаралды 946 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,4 МЛН
3D Programming Fundamentals [Texture Mapping] Tutorial 7
47:24
ChiliTomatoNoodle
Рет қаралды 21 М.
Recreating Noita's Sand Simulation in C and OpenGL | Game Engineering
10:03
The Math of Computer Graphics - TEXTURES and SAMPLERS
16:59
FloatyMonkey
Рет қаралды 20 М.
CAN YOU HELP ME? (ROAD TO 100 MLN!) #shorts
00:26
PANDA BOI
Рет қаралды 36 МЛН