0

I am currently working on a new Renderer using DX11.
To batch multiple meshes I would like to use geometry instancing with Texture2dArrays to prevent texture atlases.
This would be the pseudo code for rendering:

foreach effect in effects
    foreach batch in batches
        SetTexture2DArray()
        SetInstanceBuffer() //Transform & Material (cbuffer)
        SetVertexBuffer() 
        SetIndexBuffer()
        DrawIndexed()

Each mesh consists of 3 Textures and geometry. Meshes with the same input layout would be get combined in one batch.
One batch can hold up to ~300 meshes to get an TexturArray of 900 Textures per batch.
Is it possiple to to use diffrent combine textures of diffrent sizes into on TextureArray?
If not I could only combine meshes with the same input layout and texures sizes.

Do you think this is a good system generally?

1 Answer 1

1

About texture arrays, each slice needs to be same size.

About merging models less draw calls is generally better, but having one single buffer holding different subsets with varying amount of primitives each can lead to some overdraw, and frustrum culling will be harder to apply in that use case if it's needed (depending on the amount of geometry you might just send it anyway, modern cards can eat up geometry rather easily). If all your geometry is visible at all time then merging is a definite good option.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.