Distance to Cam Gradient (not ray length)

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  10 October 2006
Distance to Cam Gradient (not ray length)

Hi all. I need to shade an object based on distance from the camera. black for nearest, white for farthest.

Limitations:
1. I can't use the normal routes because my objects are inside transparent refractive objects. So no using the default depth pass.
2. I can't use ray length, because the transparent refractive objects ruin that setup (as they alter the rays).

So ideally, I suppose I would need an expression or something to measure the distance between that object's location and the camera and pipe that into a gradient.

Does that make sense? Oh, and I need it today. Haha. I love how that goes.
__________________
-Jez
Double Negative visual effects
 
  10 October 2006
I'm not sure how you could get it to work with just a gradient... gradients generally need a texture projection, making them 2D in nature.

In the BA Volume shader pack (http://www.binaryalchemy.de/) there is a handy shader called BA_volumescalar_primitive that is designed to create a cube or sphere with falloff within a volume... you "could" apply a global material to all of you geometry using this shader set to sphere with it's origin at the camera location and adjust the falloff accordingly. I have not tried it however... if memory serves, the shader has a radius limitation, and I'm not sure if it's just a spdl setting, or if it's a true limitation of the shader. If you already have this pack, try it out. I'm nit sure you should buy it, just for this as there is probably another way.

Perhaps a point light at the camera's position with a linear falloff could get you started.
__________________
JDex
(Sans Gerfuffle)

On a VFX Hiatus
 
  10 October 2006
Of course the solution in the XSIbase thread looks promising.

http://www.xsibase.com/forum/index....art=1#msg175089
__________________
JDex
(Sans Gerfuffle)

On a VFX Hiatus
 
  10 October 2006
Thanks JDex.

As to the suggestions on XSI Base:
I thought that might be it at first, but I still can't seem to get results out of it.

My suspicions:
1. My objects are point-baked using point oven for animation. So they have no SRT information.
2. Would the fact that these are REF LOCKed have anything to do with it?

(btw, this is true with or without the refractions I mentioned earlier).

As to your point light suggestion:
It seems like it just might work. The problem I'm having with that is the rolloff of light on the object's surface. Any out-there ideas that could handle that?
__________________
-Jez
Double Negative visual effects
 
  10 October 2006
In my desparation I tried volume fog, only to leave me feeling quite daft. The volume fog treats the transparent objects properly. So using solidly shaded objects with volume fog seems to be working properly after all.

Thanks again JDex.
__________________
-Jez
Double Negative visual effects
 
  10 October 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:54 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.