question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NormalPass, SSAOPass: Enable passes to work with flat shading, back side material settings

See original GitHub issue

Is your feature request related to a problem?

When setting a material to use “flatShading” or “BackSide” / “DoubleSide” SSAOPass does not currently work as expected because NormalPass does not respect those settings in the override material.

Describe the solution you’d like

NormalPass should use the “OverrideMaterialManager” and respect the original material “flatShading” and “side” properties.

Describe alternatives you’ve considered

None

Additional context

Here’s a JSFiddle showing the current NormalPass results with the above material settings. The left cube uses “flatShading” with no normals while the right cube is using “side = BackSide”:

https://jsfiddle.net/z4759qL8/1/

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
vanruesccommented, May 9, 2021

Thanks for the report!

The NormalPass does make use of the OverrideMaterialManager and the side property should already be handled (see #265). The flatShading property is not supported yet. Handling this property will increase the amount of override materials from 9 to 18. This is, of course, awful, but I think this should be the last property that needs to be accounted for. The override material system is also about to become obsolete relatively soonish, now that the MRT PR has been merged.

I’ll publish a fix for flatShading soon.

1reaction
gkjohnsoncommented, May 10, 2021

Three’s current built-in materials are quite rigid and hard to extend. I think we still have to wait for NodeMaterials and declarative shader manipulation features to actually make effective use of MRT in the RenderPass.

Yes I’m excited to see what Node materials bring. I think they’ll be pretty enabling in a lot of ways.

Thanks for the quick fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

NormalPass, SSAOPass: Enable passes to work with flat shading ...
When setting a material to use "flatShading" or "BackSide" / "DoubleSide" SSAOPass does not currently work as expected because NormalPass does not respect...
Read more >
Tutorial: Adding details with the Normal pass - SOA Academy
Add a Hue/Saturation adjustment on top of the Normal Pass. Link them together by clicking ALT+LeftClick between them. We're not going to use...
Read more >
Shading Techniques - How to Shade with a Pencil
Learn basic shading techniques used to create the illusion of form, light, and shadow in drawings.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found