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.
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…
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?
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?
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.
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.
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.
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.