Skip to content

Commit 76750f8

Browse files
ImmueggpainImmueggpain
authored andcommitted
phrasing
1 parent 3ee7162 commit 76750f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapter6/chapter6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ As you can see the code is exactly the same, we are using the uniform to correct
462462

463463
Another important thing to think about is, why don’t we pass the translation, rotation and scale matrices instead of combining them into a world matrix ? The reason is that we should try to limit the matrices we use in our shaders. Also keep in mind that the matrix multiplication that we do in our shader is done once per each vertex. The projection matrix does not change between render calls and the world matrix does not change per `GameItem` instance. If we passed the translation, rotation and scale matrices independently we will be doing many more matrices multiplication. Think about a model with tons of vertices and that’s a lot of extra operations.
464464

465-
But you may now think, that if the world matrix does not change per `GameItem` instance, why we don’t do the matrix multiplication in our Java class. We would be by multiplying the projection matrix and the world matrix just once per GameItem and we would send it as single uniform. In this case we would be saving many more operations. The answer is that this is a valid point right now but when we add more features to our game engine we will need to operate with world coordinates in the shaders so it’s better to handlen in and independet way those two matrices.
465+
But you may now think, that if the world matrix does not change per `GameItem` instance, why we don’t do the matrix multiplication in our Java class. We would be by multiplying the projection matrix and the world matrix just once per GameItem and we would send it as single uniform. In this case we would be saving many more operations. The answer is that this is a valid point right now but when we add more features to our game engine we will need to operate with world coordinates in the shaders anyway, so it’s better to handlen in and independet way those two matrices.
466466

467467
Finally we only need to change the `DummyGame` class to create a instance of `GameItem` with its associated `Mesh` and add some logic to translate, rotate and scale our quad. Since it’s only a test example and does not add too much you can find it in the source code that accompanies this book.
468468

0 commit comments

Comments
 (0)