Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add improved normal2height node #755

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Qendolin
Copy link

@Qendolin Qendolin commented Feb 12, 2025

Add my normal2height node to the base library.
The default node works fine for very simple geometric shapes, but for real normal maps it produces very strong streaking artifacts.
This improved node is based on Materialize's height from normal generator.

Probably the sampling sequence and performance can still be improved. But it's not bad. Also I haven't done any spell checking.
I'll keep this as a draft until initial feedback.

Normals Simple Improved Reference
normal_to_height_compare_normal_map_convert_2_map normal_to_height_compare__3_old normal_to_height_compare__5_new N/A
normal_to_height_compare_normal_map_convert_2_roof_normal normal_to_height_compare__4_roof_old normal_to_height_compare__5_roof_new normal_to_height_compare__7_roof_ref
normal_to_height_compare_normal_map_convert_2_window_normal normal_to_height_compare__3_window_old normal_to_height_compare__5_window_new normal_to_height_compare__7_window_ref

@Qendolin
Copy link
Author

I'm not really sure if it makes sense to keep the existing, simple node

@Qendolin Qendolin marked this pull request as ready for review February 13, 2025 19:04
@Qendolin
Copy link
Author

I should note that the strength and base height parameters don't work exactly like in the existing node. It's just a simple value * strength + base

@Qendolin
Copy link
Author

One issue I've found is that high sample counts (4k or more) often result in crashes with textures above 512 resolution. However this is more of an issue with MM than this node in particular. If Iterate Buffers exposed the iteration number, I could use them to spread the calculation across multiple invocations and the crash could likely be avoided.

@Qendolin
Copy link
Author

I have a version in the works that uses an iterate buffer. That makes it more stable. And I've improved the quality further.
Future Work (not in this PR): See how awesome bump does it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant