PDA

View Full Version : Master Zap's CD Rom shader


moid
05-13-2007, 03:58 PM
http://i51.photobucket.com/albums/f366/MasterZap/dispersion-fake.jpg

Master Zap has just posted this tantalising image on his blogspot http://mentalraytips.blogspot.com/
for creating the multicoloured reflections that CD Roms have. I think I understand (in theory) how to do this. However the image seems to suggest that his effect can create stretched anisotropic reflections, and if so I'd love to know how! Anyone have any guesses?

When I say anisotropic reflections I don't just mean anisotropic specular highlights, I mean anisotropic reflections as in stretched reflections like those seen in the surface of a lake where the water is moving and far away objects are taller in their reflections?

Thanks in advance for any ideas:D

MasterZap
05-14-2007, 01:03 AM
In A&D all glossy reflections exhibit this "vertical stretch" (rather, "perpendicular stretch") effect.

This effect is often misunderstood as "anisotropy" but that's not it. For example, witness this page by otherwise incredibly knowledged Neil Blevins (http://www.neilblevins.com/cg_education/aniso_ref/aniso_ref.htm) wherein he largely misrepresents anisotropy.... yes his examples of the physics behind anisotropy is correct, but several of his images (car headlights, lake, etc) has nothing to do with anisotropy (although some do, like the CD, the pot, the christmas ornament thingy, etc.)

Here's what's going on; In a glossy surface, the normal vector is varying. The reflection direction you "see" depend on the normal vector.

Now take the lake example, because we all saw it and know it, how the sun becomes a "vertical streak" in the lake. Why?

Well, imagine the lake as completely flat (mirror). You would see a perfect mirror image of the sun.

Now imagine moving the normal vector direction slightly away from you or towards you. This will have a HUGE impact on the direction of the reflection, which will be going much higher (or lower).

Now instead imagine wiggline the normal vector from side to side. This will have almost no effect on the reflection direction!

So a uneven surface which is reflective, will automatically yeild this "vertical stretch" effect.

Many "glossy reflection" shaders (most based on the Ward glossy model) incorrectly perturb the reflection direction, which gives a uniform spread of the glossy reflection in the surface, i.e. your glossy reflection will be spread out as much "side to side" as "up and down".

In contrast, the A&D material models glossy reflections in a completely different way (call it the Andersson reflectio model if you will ;) ), as true microdisplacements in the surface itself, and hence accurately creates this "vertical stretch" effect.

Anisotropy really doesn't enter into that particular effect. But perhaps it can become visually exaggerated by it.

As a matter of fact, anisotropy actually creates the more "diagonal stretch" effect you see in this image, because the reflections are stretched more perpendicular to the direction (the direction of the theoretical "micro scratches" of anisotropy) than they do parallell to them.

Since we already had a "vertical stretch", and now we add a "perpendicular to scratches" stretch, it sums up to a "diagonal stretch" look.

/Z

moid
05-14-2007, 04:52 PM
Thanks very much Zap! I'm now even more impressed by the A&D shader than i was before! Not only did you point out the source of my 'knowledge' about anisotropy you've also explained how to get water reflections the way I've wanted them for years!

For your next challenge, can you figure out how to get self illuminated objects in Max to not emit light when FG is turned on? Another nice person at Mental Images told me it was not possible because Autodesk have not implemented the FG on/off switch at the object level, but if you know of a sneaky way round this via the A&D shader (or any other) that would be very useful.

MasterZap
05-15-2007, 12:27 AM
Thanks very much Zap! I'm now even more impressed by the A&D shader than i was before! Not only did you point out the source of my 'knowledge' about anisotropy you've also explained how to get water reflections the way I've wanted them for years!


Thanks, and you're welcome ;)

For your next challenge, can you figure out how to get self illuminated objects in Max to not emit light when FG is turned on? Another nice person at Mental Images told me it was not possible because Autodesk have not implemented the FG on/off switch at the object level, but if you know of a sneaky way round this via the A&D shader (or any other) that would be very useful.

For today? You can do this with a ray switching node, i.e. have your material behave differently to FG rays vs. other rays.

/Z

moid
05-17-2007, 04:41 PM
Thanks once again Zap, and call me stupid, but the ray switcher is what I asked for in Max 9, and it doesn't sem to be enabled, either at the material or more likely object level. Please correct me though because I would love to be wrong here, at present I have to comp in self illuminatd objects if i don't want them to emit FG lighting.

Spacelord
06-19-2007, 12:04 AM
check out maxplugins.de.
Theres a raytype shader there, I haven't tried it but it use to work in XSI.

cheers