Forums > Jitter

creating a realtime cubemap with 6 cameras

August 27, 2013 | 5:46 am

Hi

I am trying to create a render chain to generate a texture for a cubemap, and so far I am pretty successfull, except one issue that bugs me. if an object moves from one camera to the next, the shading of the objects change, an effect I cannot make sense of.

check out the patch:

– Pasted Max Patch, click to expand. –

follow the numbers and play with the positions of the cameras or rotate the whole scene around the cameras. any ideas why this is? I thought the shadows and highlights are calculated based on the camera position and since all six cameras are in the same spot, the shading of the objects should be the same as well?

any ideas?


August 28, 2013 | 8:35 am

I pressed on, the cubemap is now working, but I still have the same lighting problems. It looks as if max is setting the lights for each camera separatly:

– Pasted Max Patch, click to expand. –

you need to add the shader attached inside the same patcher folder. save and reload the patcher and press the stored preset (1).

This is what this patcher does:

1. It captures a scene with 6 cameras, each looking to one of the six axis(x, y, z, -x. -y, -z) and

2. passes the content to a jit.gl.node object which is capturing the result as a texture.

3. this texture then is sent to a jit.gl.gridshape object in the shape of a sphere.

4. there is also the shader attached to this object, which is reprojecting the texture onto the spheres surface, but from the point of view of the camera (and the cubebox cameras).

So the scene you see looks as if you move around a set of models in a three dimensional space, but really the camera just moves inside an empty sphere (there is another box there to test the precision of this approach) with a dynamically generated and mapped texture.

any help is highly appreciated.

Attachments:
  1. sar.box_.jxs_.zip

Viewing 2 posts - 1 through 2 (of 2 total)