This is my attempt to port AOIT into Urho3D for having as many beams/particles as possible.
It only works in DX11 and forward rendering.
The branch is at:
UAV part is ripped from
with some modification to be able to declare shader buffer(UAV) in renderpath xml.
HLSL part is literally 99% copy-paste from the sample in AOIT.
I added two modified original samples 98_AOITLightTest and 99_HugeObjectCountAOIT.
Both can switch renderpath in runtime to check difference.
98_AOITLightTest is modified 07_Billboards to check lighting.
Have to say it is not doing well if there are many transparent objects overlapped.
Compare to built-in renderpath:
The FPS is not doing well either because cannot use instancing(~50% FPS of Froward renderpath).
99_HugeObjectCountAOIT is modified 20_HugeObjectCount, which just set transparent material to all boxes.
In scenerio of group on and animation on, the FPS on my laptop:
Maybe it is worth to merge this to my project to see if it will have FPS gain .
Intel sample has only 1 pass which does all shading/lighting in it, but I am not capable to modify Urho3D to that way.
I construct visibility function in
aoitpass, then reuse it in
litaoitpass, this means if an object only has
litaoitpass in its technique will produce unexpected result because it does not participate visibility construction. (All transparent objects needs to have
But reusing visibility function also produce inaccurate result because some info is already dropped in aoit pass, which always merges furthest pixel into last node. I compensate by a noob way which does not do much.
litaoitpass, I don’t know why do I have to declare all UAV as ROV.
And check if the depth is used.
The geometry and world proj view matrix should be all the same in alpha and litalpha pass, isn’t it??
So shader should get the same depth in lit pass, but…
Without the two things, lit rendering will look like having race condition problem, but unlit alone is OK.
I really have no idea… but just put them together to make it work.