Could someone provide a quick summary of how one does camera projections in Karma? (projecting a texture onto a mesh from a camera).
Was looking for camera projection node for this, but either I'm underthinking it, or overthinking, or just looking in the wrong place.
Camera Projections in Karma
8574 18 6- Tim Crowson
- Member
- 250 posts
- Joined: 10月 2014
- Offline
- Tim Crowson
- Member
- 250 posts
- Joined: 10月 2014
- Offline
- jsmack
- Member
- 8043 posts
- Joined: 9月 2011
- Offline
I don't think there's anything built in for that. What are you trying to use the camera projection for? For shader level projections, it's up to the renderer, and I think usd currently has no mechanism for shaders to reference cameras other than the render cam.
For projecting onto vertices/points, there's sops. There's not an easy way to access a usd camera from sops though. It might be better to use python to get the matrices for the camera and store them as primvars on the geometry. Karma can access matrix primvars to do the projection in shader using homogenous coordinates.
For projecting onto vertices/points, there's sops. There's not an easy way to access a usd camera from sops though. It might be better to use python to get the matrices for the camera and store them as primvars on the geometry. Karma can access matrix primvars to do the projection in shader using homogenous coordinates.
- Tim Crowson
- Member
- 250 posts
- Joined: 10月 2014
- Offline
- jsmack
- Member
- 8043 posts
- Joined: 9月 2011
- Offline
Tim Crowson
Camera projection is a pretty fundamental tool for us (and I'm sure for many in VFX). In this case I'm just asking about Karma.
There's already no way to do arbitrary projections in mantra, so it's not different in that regard. There's a convenient solution in VEX for building a perspective matrix given camera view parameters. It's not that hard to implement in either renderer. It's just annoying to have to grab all the channels from the camera in /obj or from all the properties in usd.
Tim Crowson
Redshift already has a working solution for this.
A solution in Solaris? As far as I know USD coordsys is still in the proposal stage.
https://graphics.pixar.com/usd/dev/wp_coordsys.html [graphics.pixar.com]
- Tim Crowson
- Member
- 250 posts
- Joined: 10月 2014
- Offline
- mark
- スタッフ
- 2641 posts
- Joined: 7月 2005
- Offline
- Tim Crowson
- Member
- 250 posts
- Joined: 10月 2014
- Offline
- jsmack
- Member
- 8043 posts
- Joined: 9月 2011
- Offline
Tim Crowson
What I'm bumping on is how to query the USD camera in the shading graph... is this possible?
Does the toNDC node accept a USD camera directly?
There is no, 'a camera', there is only 'the camera'--the one being rendered from. toNDC/fromNDC use the rendering camera for calculations, they don't accept an arbitrary camera.
- blakshep
- Member
- 77 posts
- Joined: 10月 2016
- Offline
Hello there,
not sure about karma but here is how you can achieve it in renderman under solaris.
https://renderman.pixar.com/answers/questions/21851/how-to-make-camera-projections-in-solaris.html [renderman.pixar.com]
not sure about karma but here is how you can achieve it in renderman under solaris.
https://renderman.pixar.com/answers/questions/21851/how-to-make-camera-projections-in-solaris.html [renderman.pixar.com]
- marcosimonrbl
- Member
- 23 posts
- Joined: 9月 2021
- Offline
jsmackTim Crowson
What I'm bumping on is how to query the USD camera in the shading graph... is this possible?
Does the toNDC node accept a USD camera directly?
There is no, 'a camera', there is only 'the camera'--the one being rendered from. toNDC/fromNDC use the rendering camera for calculations, they don't accept an arbitrary camera.
That node cannot be used with materialX though, can it?
@Tim:
We created a tool that projects NDC coordinates on the points of meshes as array primvar and one can use in the shader to get what you're asking - not perfect if render has displacement (I imagine), but close enough for our purposes.
- Mark Wallman
- Member
- 700 posts
- Joined: 8月 2013
- Offline
- jsmack
- Member
- 8043 posts
- Joined: 9月 2011
- Offline
- Mark Wallman
- Member
- 700 posts
- Joined: 8月 2013
- Offline
- marcosimonrbl
- Member
- 23 posts
- Joined: 9月 2021
- Offline
- Mark Wallman
- Member
- 700 posts
- Joined: 8月 2013
- Offline
- terry_williams
- Member
- 53 posts
- Joined: 9月 2018
- Offline
- Tomek P
- Member
- 11 posts
- Joined: 1月 2015
- Offline
Take a look at this:
https://www.sidefx.com/docs/houdini/nodes/lop/coordsys.html [www.sidefx.com]
There's an example scene at the bottom. I have to admit, it took me a while to understand what's going on.
https://www.sidefx.com/docs/houdini/nodes/lop/coordsys.html [www.sidefx.com]
There's an example scene at the bottom. I have to admit, it took me a while to understand what's going on.
- VFX_DOOD
- Member
- 1 posts
- Joined: 9月 2023
- Offline
-
- Quick Links