Page 1 of 2

Get Perspective Projection From Camera?

Posted: Tue May 31, 2016 8:40 pm
by leehenshall
Is it possible to gain more control over the perspective projection node?

Here's the problem....I'm trying to integrate a CG car into some backplate photography. I am trying to project my back plate back into my scene to use as a floor texture to help with the reflection integration. This is common practice with tools such as V-Ray.

I can see that the perspective projection node broadly does what i need it to but it's nearly impossible to find my camera position and rotation values to setup the projection correctly. It would be useful if you could some how "get projection from camera" or "match current perspective".

It could also be really handy if you could expand on the shadow catcher functionality. Instead of just Catching shadows the shadow catcher could also catch reflection and diffuse data from the background which would effectively create the same visual result as manually projecting the backplate back into the scene. There is a very similar feature in I-Ray currently.

If there are any work arounds for this or I have missed something please let me know.

Re: Get Perspective Projection From Camera?

Posted: Tue May 31, 2016 8:57 pm
by leehenshall
Just found this:

http://inlifethrill.com/tutorials/octan ... rendering/

Video 3 seems to show how you can do this in Octane for C4D. Am I missing something? How is this possible in stand alone?

Re: Get Perspective Projection From Camera?

Posted: Tue May 31, 2016 9:09 pm
by calus
Hi leehenshall, again ;)

After your last message about the same subject in Maya I tried to do in Maya a proper node setup for backplate (without using the non-sens image plane) and also tried to find the projection matrix of the camera with maya node,
but no luck.

Still I did a setup using the "camera map" option in image texture (also there is hardware shader overide in viewport) and the backplate shader is not modified by the light...
If you get your camera from Maya you can use the same shader and export an orbx for standalone to get the transformed projection.

maya project attached
camap.zip
(196.16 KiB) Downloaded 187 times

Re: Get Perspective Projection From Camera?

Posted: Tue May 31, 2016 9:11 pm
by calus
in standalone that would need a LUA script, but first we need the formula for camera projection matrix * :D

* if in the "persperctive projection" node we had a transform node and put in translation and rotation put the camera translation and rotation, in scaleX = - W and scaleY= -H (wigth and height of the render), we have the good projection but still I don't know how to calculate ScaleZ wich divide the image size to match with view.
and about camera rotation, in standalone we have to find it from the aim and up vector .....

Re: Get Perspective Projection From Camera?

Posted: Tue May 31, 2016 9:30 pm
by leehenshall
Thanks for the reply again Calus :)

I'm trying to avoid Maya Octane plugin for the moment because its just too slow to work with. Maybe they will make it much much better soon but at the moment every time i change something i need to refresh my IPR and when you refresh large CAD data sets it hangs Maya for 1-2 mins before it can refresh the render....I guess this is because it needs to re-compile the scene every time something changes. This is not ideal when compared to other plugins such as I-Ray or V-Ray which seem to have better live IPR functionality. It's sad to say because like many i love Octane but it seems to fall short of the mark when it comes to plugin integration.

Octane Standalone however is solid and fast and i love the node based workflow. It feels like working with nuke or Katana.

I had a look at the Maya Plugin Image texture node and you are correct there is a camera mapped option. I had no idea that it existed!

It would be great if I could find a node reference library that told me what all of these parameters do. I haven't been able to find detailed documentation yet.

It would be good to find a way of doing this in standalone. I have no idea what a LUA script is or what camera projection matrix means so you might need to educate me :)

Re: Get Perspective Projection From Camera?

Posted: Tue May 31, 2016 9:42 pm
by calus
-

Re: Get Perspective Projection From Camera?

Posted: Tue May 31, 2016 9:49 pm
by calus
There is a tool for standalone doing just what you need ! :)

look here, the script seems amazing:
camera map 1.30.lua
viewtopic.php?f=73&t=38160&p=171276&hil ... on#p170419

download and put it in you script folder (define this folder in standalone pref) then the script will appear in the standalone SCRIPT menu.


*Aff the script doesn't work because the resolution node has changed in octane3,
Just ask Roeland in the topic if he can update the script for V3 , he usually do it very quickly...

Re: Get Perspective Projection From Camera?

Posted: Tue May 31, 2016 10:08 pm
by leehenshall
Great find Calus! Works like a charm in v2. I can't get it working using Octane 3.0 but I have requested an update.

Re: Get Perspective Projection From Camera?

Posted: Tue May 31, 2016 10:22 pm
by Phantom107

Re: Get Perspective Projection From Camera?

Posted: Wed Jun 01, 2016 3:59 pm
by leehenshall
Phantom:

Is your tool only for extracting camera information from 2D photographs or does it aid in the rendering process atall? It looks like a stand alone tool that can send camera data to Octane. Athough this does look very handy its not exactly what I'm looking for in this thread.

Calus:

In a previous thread you linked me to a useful LUA script. Do you think it is possible to create a script to extract camera position/rotation/focal data from Octane standalone and export it in a format that is readable my most dcc applications?