Blender Position Pass.

Hi!
I was wonder if is possible to get position pass from blender (float point image, each pixels represent XYZ coordinate) .You maybe ask for what that can be usefull?
2.5D Relighting in Nuke.
http://www.digitaltutors.com/09/training.php?cid=203&pid=381
http://fxguide.com/fxguidetv.html (episode 71)
Cheers!

very good…

http://pasteall.org/blend/4464

Use a material override, as in the above file. Blender seems to clamp the normal RGBA combined pass to zero, preventing negative colours, which is a pain, but it looks like you can work around it feeding the global coords into a material node, then using color pass.

Broken- It work’s ! Must test it deeply ,but it work’s. Thank You very much!:smiley:

Ok now sadly news.
There is a problem. I always get an area with no RGB values (pure black 0,0,0) That gives artifact’s.
Any idea how to fix it?

There’s a patch for this kind of pass somewhere, probably still in the wiki or in the tracker. It was developed by Keir Miele for the libmv project. Indeed, would be a good thing to have without hacks.
I’d recommend shifting the values - estimate the bounding box of your scene(how far below zero it goes), then make the material override so that the values start from a point in space where allready is no geometry…

pildanovak- Thank’s. I think there is no solution, this must be implemented. Just see how position pass look, and compare it with broken solution.
In Blender we miss data (only x value without y and so on)
In below link position pass from Digital Tutors training, rendered in Maya.
Blender solution somehow work’s, but we miss a really handy feature of this pass, mainly rotoscoping. Hope this can be fixed somehow. And about Keir Miele, I don’t find anything. This was a patch for 2.49 or 2.5X?

P-Pass Maya- http://www.speedyshare.com/files/25700823/position_pass.exr

Sory for confusing.
Pildanovak- I don’t understand at the first time what You mention whit “shifting values”, but I probably make it like You write. Anyway now it work’s like a swish clock!
The only confusing thing is to swap axies in Nuke, but this just 3 click’s.
So THX for You Help, below link to Blend and Nuke file. :smiley:

http://www.speedyshare.com/files/25706249/2_5D_Relight_Nuke_Blender.zip

Kindly repost the .zip file. Thanks Rangiz!

By the way, thank you for asking the community, I was wondering if there was a script or patch for Blender to do this.

Have a look > Pablo Vazquez http://www.youtube.com/watch?v=B7k7leHvHXY&feature=player_detailpage#t=31s I learned that he’s using vector pass.

Hi!
Sorry for no answer.
Below link to blend and nuke file. We must test it deeply, because it isn’t perfect in my opinion.

http://www.sendspace.com/file/swh4ph

is it related to http://www.francois-tarlier.com/blog/2-5d-relighting-in-compositing-with-blender-using-spherical-harmonics/ ?

No, it isn’t. I only want to save PositionPass from Blender.

The links to the sample files are dead again. Does anyone have the sample file or can describe the technique in detail for getting a position pass from Blender?

The solution of mine is as follows:
What I will get from this is an image where RED channel represents X position in blender units, GREEN is Y position on blender units and BLUE is Z position in blender units.
I set material to override all of the materials and make it node material. Set up of nodes is as follows:


Unfortunately all negative values are by default clipped, so I added 100 (I think that this is enough) to all channels.

Then in compositing we have to subtract previously added value, so the setup would be as follows:


The resulting image will be “position pass” where R is X position, G is Y position and B is Z position

yeah but iirc it is in camera space like that. in most of the case you’ll want it in world space (or object)

a long time ago I did port some part of this nuke script in blender.
at least the spherical harmonics part which is the main part of it
http://vimeo.com/11279314

anyway +1 for a world point and normal pass

It looks like it works for world position. Here is the position pass with an array of cubes. Now, how do I save the negative values in an image file? I tried saving in just about every image format possible in Blender. The only one that would produce the negative numbers was cineon, but it would only go as low as -.005.

I would like to import the position pass into Fusion for testing the new volume mask tools.

Attachments


Save it to EXR. And yes - it works in world space. If you take data from “global” output of geometry node - you are camera independent. If you take “local” you are in object space, other outputs work accordingly.

EXR was the first format I tried, but it cut off the values at 0. I’m not sure if I’m missing something with the EXR options. I looked over the EXR options but didn’t see anything that would help. I will have to try again later today with EXR.

I had a chance to save the position pass as an EXR today and loaded the saved image file into blender and checked the color values and it has the correct negative numbers. I then loaded the EXR I saved yesterday and the values were clipped at 0, so I apparently screwed some setting up yesterday.

I loaded the Beauty pass and position pass into Fusion and the volume masked worked great. Thanks for the help BartekSkorupa.

I’m going to try to put together an actual scene now with some animation to test it a little more. I guess the only concern now is that the position pass can’t be anti-aliased, since the softened edges will have incorrect position values, but that might not make much difference. I guess we will have to wait for real position pass support in Blender to take care of the anti-alias issue.

I played a little with the position pass and figured out a way to “rotate” the world in position pass.
Perhaps it is possible to do it easier using less nodes, but I was just refreshing my trigonometry knowledge and doing my best to convert it to “node language”.

Please treat this as a bit of fun :slight_smile:

— edit — 2011-09-10

Check out another more elegant solution:

http://www.francois-tarlier.com/blog/rotating-normals-from-a-normal-pass/

Here you have different rotation order and +/- differences, but works really fine. The original purpose of this was to “rotate” normals, but it also works with position pass.

Attachments

RotatePositionPass.blend (750 KB)