
[ad_1]
With common raymarching algorithm we are able to fade the mirrored pixel primarily based on the variety of iterations used when looping.
I can’t use an iteration quantity when doing each hierarchical z (HiZ) and raymarching loop for refinement as the 2 loops didn’t work the identical. Using a worldwide iteration worth produces incoherent fading.
To receive a fading side that works for each I’m utilizing this : SSRcolor = float4(Color,1-abs(SSray.z-D)*500);
Where colour is the colour of the scene (multilayer), SSray.z is the depth when the ray hits one thing in a single layer, D is the preliminary depth from the place the ray began. 500 accounts for the depth distinction in comparison with 1. 500 offers good outcomes for my wants however it may be extra for extra fading or much less for much less fading.
An issue I’ve when utilizing an iteration or depth-based fading is that the fading ratio is POV dependent as proven in image. For iterations I suppose you’re doing extra loop rounds when nearer and for Depth-based fading the nearer you’re the greater SSray.z-D should be.
Is it doable to make the fading POV impartial? Taking the fixed 500 as a place to begin can we design a components for it taking into consideration the space to POV or one thing like that.
[ad_2]