Texture Atlas Support


#1

Hi, Im new here not even tried this framework which looked good on first sight.

The manual was good at describing 2 things i needed. Render to Texture (Offscreen Rendering) and Creation of Texture Arrays.

But i cannot figure out how to Render to Texure “Array”'s element?


#2

You can specify the array index to render to when creating the render texture through RENDER_TEXTURE_DESC.

			RENDER_TEXTURE_DESC rtDesc;
			rtDesc.colorSurfaces[0].texture = myArrayTexture;
			rtDesc.colorSurfaces[0].face = 0; // Index in the texture array
			rtDesc.colorSurfaces[0].numFaces = 1; // Number of elements in the texture array

You can also bind all texture array faces at once by setting numFaces to more than 1. You can then use a geometry shader and fill out SV_RenderTargetArrayIndex to determine to which index should elements be rendered to. I don’t suggest this approach as it’s not multiplatform - macOS doesn’t support geometry shaders, even on the latest versions.


#3

Thanks I had this in guess but it was not obvious in document, thanks again.