h3rb / openshadinglanguage

Automatically exported from code.google.com/p/openshadinglanguage
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Need Camera Information #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For texture projections I need get to these infos:

A) Given a Scenegraph path to a camera node:
1) world_to_screen matrix
2) world_to_camera matrix
3) screen_window_min (x and y)
4) screen_window_max (x and y)
B) Given a file path to an EXR file:
1) world_to_screen matrix
2) world_to_camera matrix

Ad A)
screen_window data not strictly needed as the aspect ratio could be calculated. 
Yet this is 
expensive and if we have the info in Katana already it makes sense to just grab 
that...

Ad B)
Akin to 'AiTextureGetMatrices'.
Not sure this feature is used a lot in current projection shader. If adding 
this is very difficult we 
could skip this feature for now...

Original issue reported on code.google.com by rene.lim...@gmail.com on 11 Jan 2010 at 6:31

GoogleCodeExporter commented 9 years ago
11/02/09 18:30:01 changed by abauer 

To add to this:

- Matrices are needed for the current frame of course.

- B) can be used as a workaround for A).
If B) is easier to implement than A) we could for now go this route and do A) 
later.

11/02/09 18:34:27 changed by ckulla 

Option B might already be working since we recently implemented the textureinfo 
call.

11/03/09 10:26:29 changed by abauer 

Any documentation already anywhere on how to use textureinfo in OSL to extract 
the camera world_to_screen and 
world_to_camera matrices?
If so, then I could start playing around with it.
Searching for 'textureinfo' (on SPI main page) does not return anything OSL 
related...
And 'gettextureinfo' seems to support matrices only for shadow maps...
tnx

11/03/09 11:17:38 changed by lg 

(A) is a combination of matrix routines that I'm already working on, and 
getattribute() which we haven't done yet but is 
coming up soon (and will need a little support from the Arnold side, too).

I think (B) is already working and is part of gettextureinfo(). It ought to 
work fine for any texture file that has these matrices 
embedded. I'll fix the docs if it implies that it only works for shadow maps.

Original comment by rene.lim...@gmail.com on 11 Jan 2010 at 6:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by rene.lim...@gmail.com on 23 Feb 2010 at 6:34

GoogleCodeExporter commented 9 years ago
I believe this is all implemented now.

Original comment by larrygr...@gmail.com on 23 Feb 2011 at 11:09