FarazzShaikh / THREE-CustomShaderMaterial

🧩 Extend Three.js standard materials with your own shaders!
https://farazzshaikh.github.io/THREE-CustomShaderMaterial/
MIT License
890 stars 56 forks source link

Is it possible to output a normal from a fragment shader? #26

Closed drone1 closed 2 years ago

drone1 commented 2 years ago

Hello and thanks for this great software.

I am extending MeshStandardMaterial and would like to output a normal per pixel from my fragment shader but I see that csm_Normal is vertex-shader-only.

How can I address this? My goal is to build a material that has an animating normal map but leverages all of the lighting and other potential of the standard material.

Please tell me it's possible. Perhaps with patchMap? I do not see docs and I'm on my phone and can't look at the example code easily.

Thank you!

FarazzShaikh commented 2 years ago

Please see #23 as this has already been discussed and solved there

PZ: Thank you for the kindness!

drone1 commented 2 years ago

Aha! Wonderful news. Thank you so much.