just finding out that instances in instance noodles are not the gpu efficient kind one might have been expecting,
as seems demostrated in this patch
instancing question.zip (66.1 KB)
[edit: this is because MaxElements was left to 0]
is it possible to patch vertex instancing with transform buffers without readback ?
(as in using Superpysical instanced version with Noodles transform buffers ?)
or if someone is able to link the two in code, maybe interested in a collab ?
for using instancing with transform buffers you have to add this to your shader:
Variable Declaration:
StructuredBuffer<float4x4> Transform;
add instance id to your input structure:
struct vsInput
{
....
uint ii : SV_InstanceID;
};
In Vertex Shader read the buffer based on this id:
float4x4 tW = Transform[In.ii];
Apply it to the vertex positions of your geometry:
float4 PosW = mul(In.PosO,tW);
done.
Knowing this you can add what ever buffers you like to your shader, also passing for example colors to pixel shader. Then you need to read the color buffer in the vertex shader and pass it to the pixel shader just like the other attribute data
You should set your max elements pins to the total number of vertices. Otherwise they are doing a small readback via pipeline statistics to set it for you automatically. Please don’t trash talk the pack.
are the maxelements being calculated correctly ?
is the performance difference between the two examples a normal cause of operation complexity, or is there room for more patching efficiency ?