3D Graphics for Dummies - Chris Ryan - CppCon 2021

  Рет қаралды 14,035

CppCon

CppCon

Күн бұрын

Пікірлер: 18
@skilz8098
@skilz8098 2 жыл бұрын
I'm 100% self taught in 3D Graphics Programming using APIs such as DirectX 10 and 11, OpenGL and now Vulkan using the C and C++ languages. It's not just the Linear Algebra that is important, Trigonometry is also vital. Especially when you are constantly using Vectors in conjunction with your Matrices where you have to rely on the relationship between the Cosine and the Dot Product. Some good stuff!
@kamilziemian995
@kamilziemian995 2 жыл бұрын
Do you use quaternions in your work? I just read books "Lie groups and algebras" (not related to 3D graphics) and I now make my way through some theorems on quaternions, so I'm curious about using them in this field.
@n3vin192
@n3vin192 11 ай бұрын
yes @@kamilziemian995
@KalkiCharcha-hd5un
@KalkiCharcha-hd5un 2 ай бұрын
I would love to learn same way
@skilz8098
@skilz8098 2 жыл бұрын
The section where he demonstrates the rotating cubes with various images, there are common techniques to mitigate this overlapping without the use of needed a "physics engines" or collision detection. The process here is call culling and clipping. We are still performing comparisons here based on the positional data as this will save a lot of computations during rasterization of what color to draw each pixel within the screen buffer. The difference between culling and clipping versus an actual physics engine or collision detection system is that here time is irrelevant as we are not considering where one object within world space is relative to another object within that same world space from one frame in time to the next. Here we only care about the current frame that we are in so time or change in time between frames is irrelevant with clipping and culling. He already introduced this earlier in the video when he was talking about the View Frustum with the near and far planes as well as the field of view. The clipping and culling here is usually done when setting up your view frustum. Anything outside of them is clipped or culled. Also there is a thing that is called back face culling which will only draw one face of a given triangle as this is determined by the winding order of that triangle's vertices and the convention of the Handedness of the Coordinate System you are using. This will also save a lot of computations and drawing time. If you have a cube, you'll only want to draw the outside faces of the 12 triangles that make up that cube. You don't want it to draw the inside faces of those 12 triangles. This will double the amount of work that needs to be done. Now, there are some cases where you might want to draw both sides of the triangle and this is when a transparent object is closer to the camera or in front of another object and you are looking into an object. So when you have a solid object you want back face culling turned on, when you are looking into an object through a transparent window is when you would want back face culling turned off. Culling and clipping are similar yet different. Clipping will test a position of a point and will see if it is within or outside of a given boundary where culling refers to the orientation of the points that make up the face and the directions of its normal vectors. Yup nothing but vector and matrix math!
@sethk.6108
@sethk.6108 2 жыл бұрын
Thank you for the great talk, Chris!
@mohammedsalih8283
@mohammedsalih8283 2 жыл бұрын
Very informative, thank you very much Chris!
@skilz8098
@skilz8098 2 жыл бұрын
Using an Indexing Scheme can also save a lot of computations within 3D Graphics. Other than just a vertex buffer which contains every single point within a polygon (triangle) or mesh, it is fairly intuitive and simple enough to setup an index buffer that will reference the same exact point that is used multiple times. This doesn't only save on computations but it also saves on memory bandwidth. You can do online searches as there is plenty of information, videos and even tutorials or guides on indexing schemes within arrays of memory.
@sotirissalloumis6129
@sotirissalloumis6129 2 жыл бұрын
Thanks for sharing, a very pedagogical presentation.
@dinoscheidt
@dinoscheidt 2 жыл бұрын
Such a lovely and calm talk. Really loved it. Should send it to all the people buzzwording „metaverse“ left and right… just to ground them a bit in what is actually required to replicate a teapot… let alone the whole world 👀😩
@thebasicmaterialsproject1892
@thebasicmaterialsproject1892 2 жыл бұрын
man im getting flashbacks to 93
@AngeloMastroberardino
@AngeloMastroberardino 2 жыл бұрын
This is a great topic. Thanks for the presentation. These are all post-multiplied matrix multiplications. Shouldn't we normally pre-multiply (in reverse order)? v(1) = M(clip)*M(proj)*M(view)*M(world)*v(0) Or maybe it's the same thing as doing this. V(1) = v'(0)*M'(world)*M'(view)*M'(proj)*M'(clip), where v' is the transposed vector and M' is the inverse matrix...
@EgonGeerardyn
@EgonGeerardyn 2 жыл бұрын
Post-multiplication or pre-multiplication is just a matter of convention indeed. Personally, I'm also more familiar with the pre-multiplication convention (where vectors/points are in the "column" convention, i.e. a 4-vector is considered a 4x1 matrix); but the post-multiplication convention is isomorphic (i.e. equivalent) with it. With the notation that lower case are vectors/points, and upper case are matrices, in the convention for column vectors: y = A * B * x with the knowledge that the transpose of a product is the product of the transposed factors in reverse order ( (A*B)' = B'A' where ' denotes the transpose, not the inverse), see en.wikipedia.org/wiki/Transpose for the details it is easy to see that: y' = (A * B * x)' = x' * B' * A' where y' and x' are exactly the row vector counterparts (i.e. transposed) of column matrices y and x. The matrices B and A are getting transposed (not inverted!) between both conventions. And this is exactly the form of the expressions on the slides: in row vector convention :-) Side-note for the transpose vs inverse: for some of matrices (i.e. orthogonal ones, such as pure rotations), the inverse of the matrix is the same as the transpose; but this is not generally the case. So it does matter to be quite precise on the difference :-)
@skilz8098
@skilz8098 2 жыл бұрын
One of the more rememberable conventions that I find useful is to remember the acronym (MVP) when it comes to the Graphics Pipeline within your Shaders. Where MVP stand for Model, View, Projection. You'll end up taking your models which consists of their mesh (vertices) and other properties such as material (color), texture data, and surface normals, tangents and bitangents, etc... and you'll transpose them into View, Camera or Eye space depending on the Perspective as in 1st person, 3rd person, etc". Then you'll transpose that with your Projection Matrix which could be either in 2D or 3D from a regular projection to an orthographic projection. Then once you have your MVP Matrix the final stage is Rasterization where it will transpose that one more time into Screen or Pixel Space. This also doesn't account for when you update your matrices to apply transformations of your objects where the order of transformations does matter. Then again this is just a single convention and this can also change and can also rely on two other factors being the Winding Order of your vertices as well as which handedness your scene graph is using. Are you using a Right Handed or a Left handed convention? This can have an impact on how you implement your MVP and the ordering of the transpositions of your matrices.
@octaviogarciaaguirre1691
@octaviogarciaaguirre1691 2 жыл бұрын
Great talk 35:20 barycentric coordinates may save yourself a headache (the "Edge approach" section from the wikipedia article its pretty clear)
@kamilziemian995
@kamilziemian995 2 жыл бұрын
1:05 Conning level - master.
@aloluk
@aloluk 2 жыл бұрын
The questions he is getting are insane. Are people not realising this is a software renderer!
@younghsiang2509
@younghsiang2509 2 жыл бұрын
Sounds like a software renderer.
C++20: The Small Pearls - Rainer Grimm - CppCon 2021
1:00:36
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 83 МЛН
The Math behind (most) 3D games - Perspective Projection
13:20
Brendan Galea
Рет қаралды 417 М.
I Made a Graphics Engine
6:42
Zyger
Рет қаралды 260 М.
Branchless Programming in C++ - Fedor Pikus - CppCon 2021
1:03:57
Python is 71x Slower, Uses 75x More Energy, Than C
23:29
Bryan Lunduke
Рет қаралды 31 М.
TCP/IP for Programmers
3:03:31
Eli the Computer Guy
Рет қаралды 224 М.