PDA

View Full Version : Anisotropic - wet floor



Tobian
01-14-2009, 06:14 PM
One tricky thing I have not yet managed to get right is perspective based anisotropy

I went into my idea in this thread on Spinquad, but it's got us stumped, so I thought I'd ask here, to see if anyone has any ideas how to solve it! :D

http://www.spinquad.com/forums/showthread.php?p=241611#post241611

Normally anisotropy is caused by micro 'grain' in surfaces, which runs along U, causing light stretch on V (or vice versa).

However, if you look outside on a wet day, you will see lights stretch vertically on the wet road. I more or less figured out this was caused by an effect of perspective on 'micro-noise'. As the normal is being shifted away from you (isn't it awful when you think of the real world like CG hehe) the 'noise' is compresed vertically, relative to your position. This causes a form of anisotropy which then stretches the specular in the opposite direction to the grain (vertically).

I managed to fake this effect by aligning the anisotropic node to the camera, so that Y became the U vector and I increased the stretch for it, smearing the reflection vertically, instead of the usual surface aligned UV.

This has it's problems, as it will only smear vertically, I want the smear to work based off the normal of the surface, but I have no idea how to rotate the node facing, using surface normal data around the Z axis!!! (so that it's respecting the normal AND camera alignment)

Maybe I'm going about this the wrong way, any and all ideas appreciated, and I might also spawn this off into a 'feature request' thread, if it's impossible! :)

I've seen it done in other CG, so it is possible, I just don't know if it's doable using anisotropy in LW!

Mr Rid
01-14-2009, 07:48 PM
Can you post a photo of the effect you are talking about? I under stand anisotropy but am not sure if you may be overthinking it. When I look at wet street reference, I dont see complex lighting effects going on that regular spec/reflection and bump wouldn't achieve. You might also try playing with anisotropic spec in the the BRDF shader.

plain ole LW spec
68225

reference
68222
68223
68224

Weepul
01-14-2009, 07:55 PM
You're overthinking it. "Anisotropic reflections" refer to properties of the surface, under any view, and a regular isotropic blur should mimic this effect.

That said, LW's plain reflection blur doesn't. I think it instead uses a faster/less noisy pattern, but that does leave you up a creek for achieving that kind of effect. (BTW, specular highlights already do the anisotropic streaking thing.)

Two possible solutions:
1. Using a fine bump instead will create this effect.
2. I had pomfried make a Gaussian Reflections node for his node pack using a pattern that looks more natural - and shows this effect. Do a search on the forum for pomfried's node pack...

---

All that also said, now I'm really intrigued if your idea can be used to get LW to do this out of the box. When I'm home I might play with this idea. :D

Tobian
01-15-2009, 02:52 AM
Ahh ok I didn't realise regular old LW spec did this as well :) I stand corrected! :)

I'll have a look at the Gaussian spec, I have it installed. I shall check it out, thanks Weepul!

yeah I was over-thinking it a little, or rathert thinking 'how' since yes, it was the reflection as much as the spec I wanted to make work! :) and yes, that's just the thing I meant Mr. Rid :)

Tobian
01-15-2009, 03:56 AM
Ok results, WIN! :)

Used a Cook-torrence shader, but it also works fine on regular specular, and Gaussian reflections node.... !

Sweet! :)
Also rendered a lot faster, as I didn't need as many AA samples to smooth out the grain! :)

I'd disregarded the node, as it took a lot longer in complex scenes, BUT the blur depth and correct specular stretching could mean I try it again! :D

Jim M
01-15-2009, 04:03 AM
Cool, glad you got it sorted !

Weepul
01-15-2009, 05:01 AM
All that also said, now I'm really intrigued if your idea can be used to get LW to do this out of the box. When I'm home I might play with this idea. :D

Following up: not without being a major pain/maybe impossible. 8~

Tobian
01-15-2009, 05:04 AM
Haha, oh dear, well i am pleased I a) figured out that setup anyway and b) got it working with the gausian node... that really is a cool setup... may have to play when i am back on 2 cores :D

3dWannabe
03-02-2010, 01:30 PM
Haha, oh dear, well i am pleased I a) figured out that setup anyway and b) got it working with the gausian node... that really is a cool setup... may have to play when i am back on 2 cores :D

Could you post your final node setup (a zip of the scene)? I've just started working with nodes, so this is a bit new to me. Thanks!

Tobian
03-02-2010, 01:51 PM
Well there's 2 ways you can do this now. You can either use Gaussian reflections http://www.db-w.com/component/option,com_remository/Itemid,84/func,select/id,13/ part of the pomms nodes pack...

Or use Denis' new reflections node shader http://pagesperso-orange.fr/dpont/plugins/nodes/Additionnal_Nodes_2.html which is a bit experimental still, but does the best results so far!

We go into more in depth discussions of the phenomenon and reasoning in this thread http://www.newtek.com/forums/showthread.php?t=104365&page=6 with some examples and such.

3dWannabe
03-02-2010, 02:22 PM
Tobian - you didn't happen to rework that test scene for the best results? Sometimes all the image's of the node setups will leave out one little thing, which would be obvious to a node expert, but not to me.

I used your original scene's floor on an animation I'm running with a dancing fairy, and so far the results look excellent, but the 10 second scene is estimated to take 8 hours to run on a dual quad core xeon - so I'm definitely looking for ways to speed it up.

I set the classic camera anti-aliasing to medium high, I think. And that really kicks up the render time. Will I have to do that with the new setup?

BTW - thanks so much for posting such detailed info. I'd be totally lost if I just relied on the manuals!

Tobian
03-02-2010, 02:38 PM
Yeah ignore the setup I did in that post, on SQ, as it's a stupid way of doing it :D The correct way is to do the correctly sampled normal displacement reflection blur, which both Pomm's nodes and Denis' do. Sadly, as for speed there's not much you can do, other than don't make the samples too high, and use the advanced cameras, as these are far more built for speed for anything with heavy raytracing, than the classic cam.