PDA

View Full Version : How? Transparent object but not see itself.



Dodgy
01-09-2009, 04:09 PM
Hiya,

I want to make something transparent, so it isn't seen by the camera, but I want to get the colour channel of the object and save it using Dpont's store/get buffer nodes. Basically the Casper Ghost effect, but allowing me to break it out into passes so I can control it more in post.
It can't use the 'Unseen by camera' toggle, because then it isn't rendered to the buffer. Turning dissolve up doesn't work either, it doesn't get rendered.
I've tried making it transparent, which works, but the colour channel renders all the way through, so you see any polys facing the camera. I want it to look as if it's been rendered solid, but be transparent. I thought there might be a way to stop any rays hitting the surface AFTER the surface has been hit once, so as the ray travels, it only shows the first part of the 'ghost' surface that it hit, but I don't know what node outputs I need to use to get this result. Does anyone have any idea how this might be achieved?

I managed to get the result I wanted by making the object 'unseen by rays', setting its transparency too 100%, IOR to 1.0001 (so it doesn't distort anything behind it) and using raytrace refraction, but I'm guessing there would be a render hit with a lot of polys.

Is there a better way?

Thanks!
Mike

Sensei
01-15-2009, 02:52 AM
Hiya,

I want to make something transparent, so it isn't seen by the camera, but I want to get the colour channel of the object and save it using Dpont's store/get buffer nodes. Basically the Casper Ghost effect, but allowing me to break it out into passes so I can control it more in post.
It can't use the 'Unseen by camera' toggle, because then it isn't rendered to the buffer. Turning dissolve up doesn't work either, it doesn't get rendered.
I've tried making it transparent, which works, but the colour channel renders all the way through, so you see any polys facing the camera. I want it to look as if it's been rendered solid, but be transparent. I thought there might be a way to stop any rays hitting the surface AFTER the surface has been hit once, so as the ray travels, it only shows the first part of the 'ghost' surface that it hit, but I don't know what node outputs I need to use to get this result. Does anyone have any idea how this might be achieved?

I managed to get the result I wanted by making the object 'unseen by rays', setting its transparency too 100%, IOR to 1.0001 (so it doesn't distort anything behind it) and using raytrace refraction, but I'm guessing there would be a render hit with a lot of polys.

Is there a better way?

Thanks!
Mike

For me this description is not clear.. How can something being at the same time fully transparent and generate any output to buffers?

This is the main shading math:
Output color = Diffuse Shading * ( 1.0 - Transparency ) + Specular Shading + Reflection Shading * Reflection + Refraction Shading * Transparency;
Maybe this will give you some idea..

If you want to skip object, you can calculate new ray origin, with same ray direction as spot info.. This new origin should be at the same line as ray source (camera) along ray direction..
It should be something like new ray origin = ray source + ray direction * ( ray length + skip length )
Normally skip length in C/C++ would be calculated from bounding box world min-max positions, ray source and ray direction.. But for Node Editor you might better use some constant, would be much easier and faster than perfect value..

Second idea, is to pass through all rays if you detect they are from spot info itemid that was already hit.. pass through is just using ray trace with the same direction, with origin at world spot position..

Do you not write C/C++ to make such node?