Jump to content
  • Advertisement
Sign in to follow this  

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

Recommended Posts

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



	float4x4 FinalTransforms[35];

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

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!