so i’m a little lost on the GLSL camera transform space, i’ve written an OSL camera shader with Octane that seems to be fine, but getting a similar port over to GLSL for use in TD is driving me nuts…

OSL

//////////

shader OslCamera(

matrix objectTransform = matrix(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),

```
float objectSize = 3.6,
output point pos = P,
output vector dir = I,
output float tMax = 1.0/0.0)
```

{

point cubePos = 0;

// left

if( u <= 0.5 && v <= 0.5)

{

cubePos = point(-0.5, -0.5 + 2 * v, -0.5 + 2 * u);

}

// right

else if(u >= 0.5 && v < 0.5)

{

cubePos = point(-0.5 + (u-0.5)*2, -0.5 + 2 * v, 0.5);

}

// top

else if (u > 0.5 && v >= 0.5)

{

cubePos = point(-0.5 + (u-0.5)*2, 0.5, 0.5 - (v-0.5)*2);

}

else

{

tMax = 0;

}

matrix objScale = matrix(objectSize);

matrix finalTrans = objectTransform * objScale;

point worldPos = transform(finalTrans, cubePos);

dir = worldPos - P;

}

///////////////////////////////////////

what it’s doing here, is simply taking a cube, and flattening out it’s visible three sides to equal quads on render… having a hard time porting that over to GLSL so that my camera renders the flat quads. Not much documentation on using the GLSL stuff with the camera that i can find…

thanks!