@WA@Calgon
(x) Porthole
https://bit.ly/4grZlTq
This is a Very Nice Scene. Yes it's a bit heavy on the GPU rendering..
I couldn't resist...
I made a 3D SBS version, and sent you a Link to test out..
( I won't release my 3D Mod, but if you like it, feel free to tweak it and share your results..)
It looks great but stutters due to the double whammy of trying to run a difficult shader and then whatever else goes on in the PC getting that to the headset. I'll have a look see if I can find a better way to streamline the code.
What I've been doing on other shaders is doing the stereogram work at Shadertoy so that there is only one shader being run. This porthole scene has two copies already for the foreground and background and then all doubled up again for the left and right eyes, it was not my best conversion originally with 2 copies of the code and now there's 4
😕Here's an example one I did on shadertoy so that you can see what's going on....
https://www.shadertoy.com/view/4fScRD
The key changes to the original code are to chop the screen into halves so that each half calculates the whole scene from a slightly different ocular viewpoint
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
// Define the interocular distance (adjust this value as needed)
float interocularDistance = 0.01; // Positive value for demonstration
// Compute normalized coordinates for the current pixel
vec2 uv = fragCoord.xy / iResolution.xy;
// Determine if the pixel belongs to the left or right eye
bool isLeftEye = fragCoord.x < (iResolution.x / 2.0);
// Adjust the UV coordinates for left or right eye
if (isLeftEye) {
// Left half of the screen
uv.x = (fragCoord.x / (iResolution.x / 2.0)); // Map from [0, 1]
} else {
// Right half of the screen
uv.x = (fragCoord.x - (iResolution.x / 2.0)) / (iResolution.x / 2.0); // Map from [0, 1]
}
// Adjust UV coordinates to range from -1 to 1
uv = uv * 2.0 - 1.0;
uv.y *= iResolution.y / iResolution.x; // Adjust y for aspect ratio
// Define the camera origin with interocular distance applied
vec3 eyeOffset = isLeftEye ? vec3(-interocularDistance, 0.0, 0.0) : vec3(interocularDistance, 0.0, 0.0);
vec3 ro=vec3(sin(iTime*.2+sin(iTime*.2)*.2),sin(iTime*.2+sin(iTime*.1)*.1),5.)+ eyeOffset;
All of the conversions I have done so far are raytraced shaders. If I can find the ray origin (ro) in this case in the original shader then I can hack it about as above and produce a sterogram.... and then converting that to iStripper is just a click of a button or two.