SBS shader woes

There’s older threads on the subject, but I don’t really want to necro or anything, so…

In my constant adventures for VR-like experiences in gaming, I’ve managed to get my hands on quite a good headset, and tested out FPse’s VR mode. Apparently, what worked best was just two non-distorted 4:3 images next to each other, strangely enough. Probably because my headset’s got a relatively high field of view.

My attempts at manipulating the settings of the repo’s SBS shader (on Windows, not on my phone, in hope of getting a phone setup working later) haven’t worked out very well. Tiny little adjustments to either the Cg shader or the GLSL ‘simple’ shader produce wildly varying results, to the point where slight adjustments in position can send the screens flying off into a random corner of the screen…if not off entirely. I’m kind of at a loss as to how any of these functions work, and checking the Cg shader source wasn’t any help because it isn’t heavily commented.

Why would these settings have such different, anomalous results from .01 adjustments? And is there a way to create an SBS shader which is literally only two of the same undistorted image side by side? (Possibly after other shaders have processed the image beforehand, so I can use CRT shaders alongside it.) Having minimal coding experience, I have no idea how difficult that’d be. (And if I want to try Virtual Boy stuff, I still have to adjust the shaders anyway…)

most of the complexity of that shader has to do with trying to get the curvature right for the lens aberration compensation. If you don’t need/want that, just making 2 plain ol’ images next to each other should be pretty easy to do.

FAKEDIT: Try this one:

#pragma parameter zoom "Zoom" 0.45 0.1 3.0 0.01
#pragma parameter both_x "Both X" 0.25 -5.0 5.0 0.01
#pragma parameter both_y "Both Y" 0.0 -5.0 5.0 0.01
#pragma parameter separation "Separation" -0.05 -5.0 5.0 0.01
#ifdef PARAMETER_UNIFORM
uniform float zoom;
uniform float both_x;
uniform float both_y;
uniform float separation;
#else
#define zoom 0.45
#define both_x 0.25
#define both_y 0.0
#define separation -0.05
#endif

/* COMPATIBILITY 
   - HLSL compilers
   - Cg   compilers
*/

void main_vertex
(
	float4 position	: POSITION,
	float4 color	: COLOR,
	float2 texCoord : TEXCOORD0,

    uniform float4x4 modelViewProj,

	out float4 oPosition : POSITION,
	out float4 oColor    : COLOR,
	out float2 otexCoord : TEXCOORD
)
{
	oPosition = mul(modelViewProj, position);
	oColor = color;
	otexCoord = texCoord;
}

struct output 
{
  float4 color    : COLOR;
};

struct input
{
  float2 video_size;
  float2 texture_size;
  float2 output_size;
  float  frame_count;
  float  frame_direction;
  float frame_rotation;
};


output main_fragment(float2 texCoord : TEXCOORD0, uniform sampler2D decal : TEXUNIT0, uniform input IN) 
{
float2 coord = ((texCoord - float2(0.25,0.25)) / zoom + float2(both_x,both_y)) + float2(0.25);
   output OUT;
   OUT.color = tex2D(decal, coord - float2(separation, 0.0)) + tex2D(decal, coord + float2(-0.5+separation, 0.0));
   return OUT;
}