Advertisement

How to just write into one of the element of a matrix array

Started by September 25, 2018 11:49 AM
1 comment, last by ccel 6 years, 2 months ago

When I render the frame hierarchy, I want to, say write to the 5th matrix slot in the shader, how can I do that?

thanks

Jack


	float4x4 FinalTransforms[35];
	


	l_effect->SetMatrixArray("FinalTransforms", &pMeshContainer->pBoneMatrices[0], pMeshContainer->pSkinInfo->GetNumBones());
	

It doesn't look like there's an API to do that on Unity, but you could have a cached version of the matrix array, modify a single element and call SetMatrixArray again.

At the low level, most of the time you don't end up patching constant buffers anyway, you just send the whole thing again.

This topic is closed to new replies.

Advertisement