While ago I implemented Single Pass Stereo Rendering (viewtopic.php?t=93686) its mainly vertex shader stuffs but I also have to do this adjustment to the pixel shader:
(actually that 0.064 is now a 0.095 don't remember why, but that's not relevant)xrgo wrote: Sun Oct 29, 2017 6:35 pm So far working great, reflection looked weird/flat so I did this in the pixel shader:so the viewDir of the right side of the viewport get adjusted as much as I offseted the right instance (0.064)Code: Select all
@property( single_pass_stereo ) vec3 viewDir = normalize( -(inPs.pos - vec3( float( gl_FragCoord.x > @value( half_screen_width ) )*0.064, 0, 0 ) ) ); @end @property( !single_pass_stereo ) vec3 viewDir = normalize( -inPs.pos ); @end
[/code]
Things like this has to be done since with single pass stereo you are basically rendering using one camera, so stuffs for the right eye that depends on the camera parameters/position/etc has to be adjusted.
I am rendering both eyes to a single texture so thats why I am doing:
Code: Select all
gl_FragCoord.x > @value( half_screen_width ) )Now the problem... using single pass stereo breaks forward clustered, lights disappear as I move the camera/head and sometimes I can distinguish the cells
I partially fixed the problem by doing this (line ~88 of Forward3D_piece_ps.glsl):
Code: Select all
uint sampleOffset = sliceSkip + uint(floor( FWDPLUS_APPLY_OFFSET_X(gl_FragCoord.x) * passBuf.fwdScreenToGrid.x @property( single_pass_stereo ) *2 @end ));tbh I don't understand too much the algorithm so I just tried different values for FWDPLUS_APPLY_OFFSET_X, like adding/substracting 0.5, multiplying by many values, and some other stuffs etc with no success
please help!
Many many thanks in advance!

