Skip to main content
updated answer to actual feasible result
Source Link
ErnieDingo
  • 1.2k
  • 8
  • 15

In your instancing, you can pass more than Matrices, extendI would sort the instancing to include a flag 1/-1 to state noinstances mirror/mirrorno mirror. I've done this myself for skinning and colouring of instanced objects Make the first draw call, so this shouldupdate the rasterizer with the cull mode you want then render the mirror'd instances. Its overhead on CPU, but it shouldnt be a simpler version of thatmuch.

I would advise thatIf you might wantneed to sort them in order or mirror/no mirror before feeding themmultiply the mirrored by some inversion matrix, then I would pass this in as there might be impacts to constantly swappinga constant buffer and get the rasterizer state between culling modesGPU to multiply this in VS.

In your instancing, you can pass more than Matrices, extend the instancing to include a flag 1/-1 to state no mirror/mirror. I've done this myself for skinning and colouring of instanced objects, so this should be a simpler version of that.

I would advise that you might want to sort them in order or mirror/no mirror before feeding them in as there might be impacts to constantly swapping the rasterizer state between culling modes.

I would sort the instances mirror/no mirror. Make the first draw call, update the rasterizer with the cull mode you want then render the mirror'd instances. Its overhead on CPU, but it shouldnt be much.

If you need to multiply the mirrored by some inversion matrix, then I would pass this in a constant buffer and get the GPU to multiply this in VS.

Source Link
ErnieDingo
  • 1.2k
  • 8
  • 15

In your instancing, you can pass more than Matrices, extend the instancing to include a flag 1/-1 to state no mirror/mirror. I've done this myself for skinning and colouring of instanced objects, so this should be a simpler version of that.

I would advise that you might want to sort them in order or mirror/no mirror before feeding them in as there might be impacts to constantly swapping the rasterizer state between culling modes.