Specify which camera is used for Camera Mapping?

Blender (Export script developed by yoyoz; Integrated Plugin developed by JimStar)
Post Reply
artbydile
Licensed Customer
Posts: 9
Joined: Sun May 15, 2016 9:14 pm

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!
6x 2080TI ASUS TURBO + 2x 1080TI + 1x 1080
ThreadRipper 2970WX 3.6Ghz - 64GB RAM
linograndiotoy
OctaneRender Team
Posts: 1355
Joined: Thu Feb 01, 2018 7:10 pm

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!
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.

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.
CameraMapping.JPG
artbydile
Licensed Customer
Posts: 9
Joined: Sun May 15, 2016 9:14 pm

Thank you lino! Will try this out asap!
6x 2080TI ASUS TURBO + 2x 1080TI + 1x 1080
ThreadRipper 2970WX 3.6Ghz - 64GB RAM
Post Reply

Return to “Blender”