C++ OpenGL Tutorial - 12 - Going 3D (Coordinate Systems)

preview_player
Показать описание
In this video, we incorporate more mathematics to finally create 3D shapes and introduce ourselves to the concept of a camera.

Listened to the Shadow of the Colossus OST by Kow Otani.
Рекомендации по теме
Комментарии
Автор

Hi, I have a question relating to performance.
Let's say I have a game with a lot of objects on screen. Each has its own model matrix, but the view and projection mats are global (there's just 1 camera and window). Instead of passing all three of these into the vertex shader and multiplying them for every vertex of every object, wouldn't it be more efficient to do something like this:

1. Multiply View * Projection matrices together once per frame to get a ViewProj mat.
2. Once per object, multiply the combined ViewProj * Model matrix to get a final Transform mat.
3. Just pass that into the vert shader uniform, so it's only having to do one matrix multiply per vertex instead of 3.

Would something like this work, would it cause problems down the road, and would it save any significant amount of performance?

JohnJohn
Автор

awesome tutorials Michael, thanks so much!

samhighfield
Автор

9:30
I think putting "shader. activate" and "shader.setMat4" outside the while loop does nothing. At least in case of code like on this video because unless you have these functions in while loop they will do nothing, and vice versa, if you dont have them in while loop - you will see no result.

dd-
Автор

Hey bro, really learned a lot keep on

parthlodhia
visit shbcf.ru