PDA

View Full Version : depth shader


jesped
06-18-2003, 06:27 PM
Anyone knows any shader or procedure to change a material based on the W depth or Z depth from face normals?

Dave Black
06-18-2003, 06:47 PM
Yes there is. It's called the "falloff" map. Within this map, you can set it so that it changes from one map to the next based on the Z depth from the camera. Drop down the "Falloff Type" menu, and you should see "Distance Blend". It will only work in a camera viewport. This parameter can be adjusted using the camera's enviroment ranges.

You can use this map as the blend map in a Blend Material to blend 2 different materials by distance. Works great for landscapes.

You can also render the z-depth of an entire render through the render-elements section of the render dialog.

Hope that helps.

-3DZ

:D

Dave Black
06-18-2003, 06:50 PM
WOW! You ARE Jesus Pedrosa Vidal!! Man, what an honor!
So glad to have you here at CGTalk!

You've been such an inspiration to me over the years.

Wow.

-3DZ

:D

visualboo
06-18-2003, 09:09 PM
hehe...


3DZ... DOWN BOY!!! DOWN!!!

visualboo
06-18-2003, 09:14 PM
oh I forgot :D

I think he was talking about the face normals not distance from camera.

Wish I could help but it's time to leave work and I'm brain dead. Oh did I mention how sucky the w3d exporter for max can suck? It sucks.

Dave Black
06-18-2003, 09:54 PM
Bite me visualboo :p

Guess I read it wrong. Oh well. And, I have no idea.

-3DZ

:D

jesped
06-18-2003, 10:07 PM
Thanks for reply.

Yes, I meant a distance from face normals from another reference object, or even better a distance from the pivot point or something.

The idea is to apply different matterials based on object "layers". Imagine a chocolate egg where the surface layer is black chocolate while the inside is white. I know that thing can be done in other ways, but the ability to set different materials based on the depth of the object will be very useful for other effects.

I'm thinking... it will be mainly something like the absorption param in advanced refractions.

visualboo
06-18-2003, 11:43 PM
haha... sorry 3dz. I'm just burnt for today.

Reality3D
06-19-2003, 01:21 AM
Hi Jesus:

You can use fallof to make something similar you want. Just use distance Blend with fallof direction checked as Objet. Then create a dummy at the point you want and change the distance fallofs. If you want more than two depthfallof levels, anidate more fallof maps. The trick to hold the depth of the object constant when it moves or rotates is to create a group that will have the move and the scale keys. Check the .max example
----
Creo que más o menos se entiende 8)

Reality3D
06-19-2003, 02:18 AM
And if you want precission within the distance fallof and the base object, you can use the Object bounding box as dummy pos

Alex Morris
06-19-2003, 11:16 AM
You could also use the blur material side fade which I think does a similar thing based on face normals

NotSoFro
06-19-2003, 12:25 PM
Ummm....

I am not sure If i know entirely what you mean but one suggestion might be to try the wax shader in Brazil. There are actually a number of materials that allow subsurface scattering. Maybe you could look into that.

Hope I am on the right track

CGTalk Moderation
01-15-2006, 10:00 AM
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.