three.js icon indicating copy to clipboard operation
three.js copied to clipboard

Anisotropic (and rotated anisotropic) reflections that work with IBL / PMREM

Open bhouston opened this issue 8 years ago • 4 comments

Description of the problem

We should probably implement in the core of ThreeJS anisotropic reflections and anisotropy rotation. I've implemented this in Clara.io but only for direct lights, not the PMREM filtered IBL indirect lights.

It would be cool to have anisotropy that works with IBL PMREM results -- although I understand that this may require pre-calculated anisotropic PMREM which we currently do not have, or PMREM filtering is only isotropic.

My implementation produces results that looks like this:

cooking pot ggx anisotropic metallic

https://clara.io/view/a8b929e6-c703-47ff-a85d-44bc44e5a132

Three.js version
  • [x] Dev
  • [x] r78
  • [ ] ...
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] Linux
  • [ ] Android
  • [ ] IOS

bhouston avatar Jun 29 '16 01:06 bhouston

The solution to this is "bend normals."

bhouston avatar Jul 04 '19 16:07 bhouston

Myself and https://github.com/Threekit are pleased to put a bounty of $250 USD on an accepted PR of a full implementation of bent normals for anisotropy with environment maps. A really good reference implementation and explanation is in the Filament code base: https://github.com/google/filament/blob/df6a100fcba66d9c99328a49d41fe3adecc0165d/shaders/src/common_lighting.fs#L89

bhouston avatar Jul 04 '22 12:07 bhouston

Hey, I was looking at this problem and I have some questions on how it is supposed to be implemented. Is this supposed to be an option on a material to add an anisotropic map or is it supposed to be a new material like "anisotropic material"?

danyjf avatar Aug 01 '22 10:08 danyjf

Ideally, it is added to MeshPhysicalMaterial similar to clear coat, sheen or transmission.

Mugen87 avatar Aug 01 '22 10:08 Mugen87

This is implemented since r153 :tada:!

Mugen87 avatar Jul 09 '23 20:07 Mugen87