Hey, just wondering if I'm missing something probably incredibly basic...
In C4D the camera mapping option allows you to specify WHICH camera is used to map a picture to an object. Further down the line this allows me to specify another camera to render or bake said texture out on the UV or animate a different camera without altering the projection coordinates.
I THINK I saw something a while ago on this when the camera mapping option was added to the texture node, but I cannot find it. Am I just missing something? Thanks in advance guys!
Specify which camera is used for Camera Mapping?
- linograndiotoy
- Posts: 1355
- Joined: Thu Feb 01, 2018 7:10 pm
We still need to implement the possibility of specifing a camera for the mapping. In Octane for Blender 2.8 we'll be able to use the Camera info node, and that should help.artbydile wrote:Hey, just wondering if I'm missing something probably incredibly basic...
In C4D the camera mapping option allows you to specify WHICH camera is used to map a picture to an object. Further down the line this allows me to specify another camera to render or bake said texture out on the UV or animate a different camera without altering the projection coordinates.
I THINK I saw something a while ago on this when the camera mapping option was added to the texture node, but I cannot find it. Am I just missing something? Thanks in advance guys!
The best way to get camera mapping right now is to use an OSL shader. You can "copy" the scripts from here:
viewtopic.php?f=21&t=65575
This one can be used in an OSL projection node, it works great:
shader CameraMap_geo(
output point uvw = 0)
{
vector p = transform("camera", P);
float fov;
int res[2];
getattribute("camera:fov", fov);
getattribute("camera:resolution", res);
uvw[0] = 0.5 - 0.5 * p[0] / p[2] / tan(fov / 2) ;
uvw[1] = 0.5 - 0.5 * p[1] / p[2] / tan(fov / 2) * res[0] / res[1];
}
I hope this helps.