Replies: 1 comment 3 replies
-
|
Great! AO does seems "lighter", but not necessarily in a bad way. It's a change but I don't think it will "break" anyone's scene. The cut plane matches its property color much better for all colors I tested it with. So it should be easier to select a different color if needed. On the implementation, I think it's the best way to do it. There is relatively few "cut points" and they are easy to understand. You could make it easier to debug, but more verbose by using a method that would allow for no-match detection, like : Not sure if the additional lines are worth the trouble, this will probably never happen. Most probable failure would be some reordering of includes or operations inside the fragment and we won't be able to catch this automatically. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Based on previous discussion with @sdumetz on making Three.js updates easier/more sustainable I've made my 3rd attempt at refactoring the shader customizations here: https://github.com/Smithsonian/dpo-voyager/tree/dev-simplify-shader
The custom shader code was reduced, mainly by removing the AO customization and switching most of the cut plane features to rely on the native local clip plane functionality. The remaining custom code is now injected into the standard shaders on load.
I think this should be relatively sustainable as most of the code is injected at the beginning/end, but is still open to incompatibilities. It could be further reduced by moving Xray and Normal features to their own materials, but it's unclear if its worth it for the overhead (though small in this case) of shader switching.
Changes I'm aware of:
Any feedback/thoughts on the implementation appreciated.
Beta Was this translation helpful? Give feedback.
All reactions