Camera Projection Bug

I’ve been working with camera projections for a while in other renderers and have recently been doing a bit in Vray. I noticed pretty quickly some strangeness.

Example:

Make a scene with some colored cubes and spheres
Setup a camera with a proper filmback for the image size you will be rendering
say a 35 mm lens on a camera with 0.98 x 0.55125 Horizontal and Vertical Aperture rendering a 1280x720 image.
Render the Image.
Make a surface shader or lambert or vray shader and make the color a projection from the same render camera.
Project that same image on to the same geo from the same camera and try to render it.
Doesn’t line up. Not even close.
Switch to Maya Software, works.
Switch to Mental Ray, works.

I finally got it to work by changing the projection type to “Use Camera Resolution” and Fit Horizontally.

So it works. But I don’t know why it works, and that makes me a bit nervous. Why is it different? During one session I changed it back to the default settings to demonstrate that it doesn’t work, and it worked with the “wrong” settings. Then reopening the scene later and it no longer worked.

Any help or explanations would be most welcome.

thanks,
Chris

I think these are the only settings that work correctly. It looks like we have not implemented the other modes and the result from them is undefined. I’ve made a note to look into it, but I think the issue was that we could never figure out exactly what was the logic behind the different settings…

Best regards,
Vlado

It would be great to get the film back projection type working so that projection resolutions can be independent, and not tied to the render resolution. It’s essential for a comprehensive mattepainting workflow. I believe the logic behind Maya’s implementation of the fit type is to proportionally scale bitmaps to fit the projection camera’s gate, using the Horizontal or Vertical settings on the projection node to determine the dominant dimension--i.e. a 2x1 bitmap projected through a 1.5x1 gate will have partial (.25 left, .25 right) clipping in Vertical mode, and partial unassigned area on the top and bottom in Horizontal mode.

Any idea when/whether this feature will get implemented in VRay?

Thanks,
Mike

It is maybe not too complicated; how urgently do you need it?

Best regards,
Vlado

I’ll be showing a demo of projections with VRay in Maya on July 9, so it would be great if it’s possible to have it working by then.

Thanks,
Mike

Yes I also need this for a current project, is it already in the nightlies?
edit: Nope not yet…

Has there been a fix rolled out for this yet? Haven’t seen anything show up in the release notes.

We are still working on it. Unfortunately we can not provide you with a time range for its implementation.
Thank you for your patience.

The support for the different camera projection fit modes is implemented in the latest nightly build.

This is great news! Thanks for the update.

--Mike

The fix appears to work well for Maya file nodes, but not so much for ramps. Ramps projected through a Maya projection node are set to the resolution gate regardless of the fit type. Possible to extend the fit type fix to ramps as well?

--Mike

Hi mbreymann,

Can you post an example of what you’re trying to set up and respectively what result you’re after? That would be helpful to us.

Thank you in advance.

I think we render the Ramp exactly as Maya software and mental ray. Bitmaps have actual dimensions so the concept of “fitting” makes sense, but the Ramp is just a procedural texture, so I’m not really sure what you expect from it.

Best regards,
Vlado

Here’s an animated gif showing the difference between a projected file node, and a ramp projected through the same projection node:

Here’s the settings for this example:

The Fit Type on the projection node is: Match Film Gate
The Fit Fill is: Fill
The bitmap ratio is: 1.33333 (1600px/1200px)
The render resolution ratio is: 1.33333 (640px/480px)
The camera film back ratio is: 1.5

The ramp is simply a white color value, not tiling, and the color balance is set to 0,0,0 to ensure a default black color outside its range.

I would expect the ramp to follow the same logic as the file node when projected through the same projection node, but this is not the case.

Would it be possible to attach that scene ?

Sure, here it is:

ramp_projection_error.zip

The file texture is connected by default, but the ramp as described above is in the scene as well and can replace the connection to the projection node to see the discrepancy.

--Mike

Hello Mike,

Thank you very much for the scene.
Yes there is some difference between Vray vs Software render when Procedural Map is used with Fit Type set to Match Film Gate - but if Match Camera Resolution Type is used such difference is not observed.
Would it be possible to use Match Camera Resolution instead of Match Film Gate type ?

Well, the problem with using Match Camera Resolution is that you can not decouple the render resolution aspect ratio from the projection camera aspect ratio. This was logged as a bug earlier (see this thread history) and fixed for bitmaps, but apparently not ramps and other procedural textures.

The main idea here is that we want to be able to project an image AND procedural textures with one aspect ratio as derived from the projection camera, but be able to render with a different aspect ratio from another camera.

Any idea how easy it will be to get this fixed?

Hello Mike,

We’re working on the issue with camera projection and procedural textures. What’s the version of V-Ray that you use?

Procedural texture support is implemented in latest nightly.