Forum

Accessing instances after GeomFX(dx11)

Hey guys!

I’m trying to build a deferred renderer - well it’s already built. But I have a problem with instancing. I can do instancing when inputting the geometry to the GBuffer, but what if I want to 1) Deform the geometry with a GS(deform each instance) -> 2) translate those instances around

I can’t seem to find a solution to this, as I don’t think that the instancing IDs get transferred down from the GS. Is this true and if it isn’t, does anyone have a solution or example for it?

afaik the SV(System Value) for the instance ID does indeed only work in the first shader. But you can of course build a buffer to contain it. In Instance Noodles it’s probably done a little naively but certainly allows for the sort of chaining you are describing (IID pin). If you pack it in to your streamouty you can access the geometry as a ByteAddressBuffer to pull out any particular section of the vertex data you want. There’s some examples in noodle’s girlpower and help files, but you might come up with a smarter way to do it. I think “Distortions2D (DX11.GeomFX) help” has the case of instances, buffered transform and also rebuilding the IID when the vertex count changes.

I’d imagine you could streamline all this with some plugin magic.

use custom semantics in the vertex to indicate subset ID so layout is “POSITION.xyz;NORMAL.xyz;SUBSETID.x etc…” you will need to use InputElement Join Advanced for this inside vvvv set to R32_Float or R32_Uint depending on your definition in shader

@microdee ah nice! I actually remember you mentioning could use a custom value (mine are blocking the color slot atm), but had missed that advanced version for the inputelements.

Thanks for the help guys! I must say it’s the best feeling ever when you’re struggling with something in dx11 and then suddenly it works :D (especially if you’re mostly kicking in the dark like me)