PDA

View Full Version : transparency w/ spec



sadkkf
11-03-2011, 04:44 PM
Hi--

I'm finally rendering a product I got from a customer and am just trying a simple anim to start. I've got a gradient on the transparency controlled by a Null (Y distance to object).

Works great, does pretty much what I expect, but I noticed when the object is supposed to be fully transparent, I still see the specular highlights. When I turn the spec off, it's fully transparent.

What gives?

littlewaves
11-03-2011, 04:54 PM
are you trying to get the object to dissapear gradually?

Or... is the object a transparent object (like glass)

If it's the former then maybe use object dissolve (object properties under render tab I think) rather than transparency.

If it's the latter then surely you want the spec? Like a glass with a light shone on it?

sadkkf
11-03-2011, 05:07 PM
I'm trying to make the object fade in vertically. It's a tall object so the customer asked to make the bottom appear first and the top last, like a reveal.

It's not a transparent object.

sadkkf
11-03-2011, 05:12 PM
Attached is a sample. It's just a basic gem primitive with the spec set at 80% and transparency set to 100%.

Sensei
11-03-2011, 05:33 PM
Specular Diffuse and Reflection Diffuse are alway added at the end of calculating final color. So transparency completely doesn't affect them, only Diffuse Shading.

So you should plug gradient to specularity too. f.e. 0 Transparency = 100% specularity, 25% transparency = 75% specularity, 75% transparency = 25% specularity etc.
specularity = 1.0-transparency

sadkkf
11-03-2011, 05:50 PM
Sensei--Thanks for the idea and for the clarification.

I'm amazed LW would display highlights on a 100% transparent object. Actually, there are a number of things that really don't make sense to me about LW, but that's for a completely different thread. :)

I'm not sure I can adjust the spec with the transparency. What I'd like is to have 100% spec on the parts of the object that are not transparent and if I understand you correctly, the spec won't be 100% until the entire object is visible, right?

Sensei
11-03-2011, 05:59 PM
It's making perfect sense- imagine glass, it's permanently transparent, without any color, but still have nice specularity and reflections. If they would be taken into account while calculating transparency, it wouldn be absolute no way to add them later.

http://www.theoriginof.com/images/glass/glass.jpg

You should make it in Node Editor. Use any math or gradient you want, instead of 1.0-transparency..

Mr Rid
11-04-2011, 01:56 AM
S...

I'm amazed LW would display highlights on a 100% transparent object.

Spec and transparency are just independent values, as any channel. Just clone/connect your transparency grad into the spec.

Realistically, spec should not be a separate value from reflection. But lights dont reflect, so its just a practical cheat.

raw-m
11-04-2011, 02:34 AM
What would be the node setup for transparency, spec and diffuse to keep the overall "result" to 100%? Normally I would just invert the transparency channel into the diffuse but aren't thing thrown out of whack by plugging the transparency into the spec as well?

biliousfrog
11-04-2011, 03:20 AM
Another thing you could do is use the gradient as a clip map rather than transparency, that will completely remove the object rather than adjust the transparency...it will also speed things up as transparency is raytraced, clip maps aren't.

For transparent objects such as glass and liquids - use transparency
To dissolve or cut out an object - use dissolve or a clip map

It's not always the case but works 99% of the time.

XswampyX
11-04-2011, 06:46 AM
What would be the node setup for transparency, spec and diffuse to keep the overall "result" to 100%? Normally I would just invert the transparency channel into the diffuse but aren't thing thrown out of whack by plugging the transparency into the spec as well?

Something like this?

http://i465.photobucket.com/albums/rr16/xXswampyXx/FadedDiamond.gif

http://i465.photobucket.com/albums/rr16/xXswampyXx/FadedDiamond-SRF.jpg

raw-m
11-04-2011, 08:13 AM
Many thanks for sharing XswampyX. I'll enjoy picking this one apart over the weekend (I think)!

The second Item Info node is coming up as "none" - what should that be? I'm guessing the Gem. If you could take a couple of moments to give a brief explanation it would be much appreciated.

XswampyX
11-04-2011, 09:22 AM
Yep the second ItemInfo node is the Gem. If you wanted the actual surface to fade in/out you could use the SpotInfo node here.
The two ItemInfo nodes link into the distance node to give the distance (obviously!) - but you might get out a scalar that could be greater than one. (ie 200%)
So I used the gradient node to bring this vale between 0 and 1 (0% to 100%). You also get the added bonus of being able to set when it swaps over.
This value is then piped into all the Multiply nodes that drop the value (multiply by 0.5 = divide by 2) back to zero.
The last bit, refraction. I just use a mixer and two refraction nodes. one set to diamond and the other set to air. Just blend between the two. I wanted to use the refraction nodes because it has a dispersion value in it.

Have fun!

sadkkf
11-04-2011, 12:09 PM
It's making perfect sense- imagine glass, it's permanently transparent, without any color, but still have nice specularity and reflections. If they would be taken into account while calculating transparency, it wouldn be absolute no way to add them later.

Yeah, I get it. I started thinking about this after I posted it and realized that's how glass is made. :) Man, I need a vacation.

sadkkf
11-04-2011, 12:14 PM
Also, thanks to everyone else for the input. I'm stuck working on a website for another client today and back to the 3D (fun stuff) tomorrow.

Some really good ideas here...cloning the transparency gradient to the spec and and clip maps. Nice. Thanks again.

I'm also not too well versed in nodes just yet so any other alternatives are great.