It’s pretty easy (actually got that already in my personal lib) ;)
Doing Queue is not ideal tho, since you need to rewrite the whole volume every frame, RingBuffer is much more efficient (requires a little bit more work on sampling side after, but still major performance gain)
I have that as a plugin with embedded shader, but could actually be patched.
TFX won’t work since it only operates on 2d texture, but Renderer (DX11 Volume) with clear pin set to false should work.
2 ways to do it:
VS (full screen quad) -> GS (use SV_RenderTargetArrayIndex as gs output to specify which slice to write to) -> PS (sample as a passtrough). This is the one I use, it’s easy and fast
CS -> Dispatch enough threads so you can fill a single slice, and use scattered write to only write to the slice (i’d say it’s prolly a bit slower, but less code)
If you really need queue you can do a second CS pass (on another volume) to reorder all that lot, didn’t tried but should be easy ;)
I’ll post a sample once done with beta30 update (will be nice new girlpower addition ;)
ok, i did not completely understand your answer, but bravely started coding something.
as a first step, i rebuilt the FullscreenQuad thingy for DX11. I tried to make it as similar as possible to the dx9 one. (Only differences i found are depth buffering which behaves bit different. and i didn’t implement all those useless blend modes).
Perhaps, you can point out that part a bit more: GS (use SV_RenderTargetArrayIndex as gs output to specify which slice to write to)
As i understood it, you use a geometry shader to place the 2d-texture to a given slice in a 3d texture?
Second thing you mentioned is that ringbuffer vs. queue argument, which i can comprehend but have to state, that a queue is much more easy to use imo. but, one thing at a time :)
ok, it’s kinda not looking right now
what vux told, you should try with a compute shader since it’s less complicated on my taste, like sampling in to a buffer then access to array
i’ve seen somewhere you can do red/write buffers on ps also btw
the explanation is as usual:
Render-target array index. Applied to geometry shader output and indicates the render target array slice that the primitive will be drawn to by the pixel shader. SV_RenderTargetArrayIndex is only valid if the render target is an array resource. This semantic applies only to primitives, if a primitive has more than one vertex the value from the leading vertex will be used.
This value also indicates which array slice of a depthstencilview is used for read/write purposes.
Can be written from the geometry shader and read by the pixel shader.
uint InstanceID : SV_INSTANCEID;
uint RTIndex : SV_RENDERTARGETARRAYINDEX;
// send us to the right render target
output.RTIndex = input(0).InstanceID;
this part you prob missing, but that not gonna work copy paste
and prob need something more then that