Texture transformation matrix has last two row set to “not used” Hi All, my constant buffer structure for per pass looks like this struct PerPass{ XMFLOAT4X4 projectionMat; XMFLOAT4X4 viewMat; XMFLOAT4X4 textureMat; Lights maxLights[MAX_LIGHTS] float3 cameraPosition; }; I am aware of packing rules so first three variables should be fine since they are all multiple of 4D vectors. My “Light” structure is also a multiple of 4D vector. cameraPosition is last variable so its will be fine too. I have tried moving textureMat up and down but it always give me last two rows as “not used” when I do graphics debug in Visual Studio. I am initialising it with an identity matrix but it doesn’t come up completely. Setting textureTransform(0,0) = 7; and textureTransform(1,1) = 9 scale the texture along x and y direction. These two changes reflects in first two rows correctly. I wanted to move the coordinates so I am supposed to utilise last row for translation. textureTransform(3,0) and textureTransform(3,1). This row is mentioned “not used”. Maybe I will move textureTransform to different constant buffer but what is going on here? What is my mistake? https://ift.tt/eA8V8J
Hi All, my constant buffer structure for per pass looks like this struct PerPass{ XMFLOAT4X4 projectionMat; XMFLOAT4X4 viewMat; XMFLOAT4X4 textureMat; Lights maxLights[MAX_LIGHTS] float3 cameraPosition; }; I am aware of packing rules so first three variables should be fine since they are all multiple of 4D vectors. My “Light” structure is also a multiple of 4D vector. cameraPosition is last variable so its will be fine too. I have tried moving textureMat up and down but it always give me last two rows as “not used” when I do graphics debug in Visual Studio. I am initialising it with an identity matrix but it doesn’t come up completely. Setting textureTransform(0,0) = 7; and textureTransform(1,1) = 9 scale the texture along x and y direction. These two changes reflects in first two rows correctly. I wanted to move the coordinates so I am supposed to utilise last row for translation. textureTransform(3,0) and textureTransform(3,1). This row is mentioned “not used”. Maybe I will move textureTransform to different constant buffer but what is going on here? What is my mistake?
from GameDev.net http://bit.ly/2Y5YHSN
from GameDev.net http://bit.ly/2Y5YHSN
ليست هناك تعليقات