So I was digging around in the DE tracers today to familiarize myself with what's under the hood, but also with the goal of putting in a quick fix-it for stereo renders. What I came up with was simple, did work, should have worked, but crashes Frag the moment you do something real with it. Here's what I added in...
uniform bool RightEye; checkbox[false]
uniform bool LeftEye; checkbox[false]
void main(void) {
gl_Position = gl_Vertex;
coord = (gl_ProjectionMatrix*gl_Vertex).xy;
coord.x*= pixelSize.y/pixelSize.x;
viewCoord = gl_Vertex.xy;
viewCoord2= (gl_ProjectionMatrix*gl_Vertex).xy;
from = Eye;
Dir = normalize(Target-Eye);
UpOrtho = normalize( Up-dot(Dir,Up)*Dir );
Right = normalize( cross(Dir,UpOrtho));
if (RightEye) {from-=Right*0.1;} //simple shift left and right, made simply simpler to root out error.
if (LeftEye) {from+=Right*0.1;}
coord*=FOV;
init();
}
Too simple. Never had a problem mixing variable types like that and is definitely not verboten, as if any such thing would be under C++
It works fine of course, shift right and left relative to viewer, with the top side up, but the second I do something, anything really, crashola. I'm thinking that change might screw something up further down the line maybe? Are there some variables I've got to shift along with "from" to avoid some math error? Oh, I've tried it with ver 1.0.0, 1.0.1, and 1.0.5, called by DE-RaytracerKn-1.0.0 and DE-Kn10.