-Now we can examine the changes in the `LightingRenderActivity` class. First, we will create an atribute to hold an instance for the `LightSpecConstants` class which will be created in the constructor. Also, we need a uniform that will hold the inverse projection and view matrices. Previously, we had just one buffer, because it only contained the inverse projection matrix. Since this did not change between frames we just needed one buffer. However, now, it will store also the inverse view matrix. That matrix can change between frame, so to avoid modifying the buffer while rendering, we will have as many buffers as swap chain images. We will need also new buffers, and descriptor sets for the cascade shadow splits data. We will not update that uniform in the constructor, but while recording the commands, therefore the constructor has been changed (no `Scene` instance as a parameter) and the `updateInvProjMatrix` method has been removed. The previous attributes `invProjBuffer` and `invProjMatrixDescriptorSet` have been removed. We need also new uniforms for the data of the cascade splits projection view uniforms and cascade instances). In the `cleanup` method, we just need to free those resources.
0 commit comments