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 C3D_LightEnvBumpNormalZ() #63

Merged
merged 1 commit into from
Aug 12, 2023
Merged

Add C3D_LightEnvBumpNormalZ() #63

merged 1 commit into from
Aug 12, 2023

Conversation

oreo639
Copy link
Contributor

@oreo639 oreo639 commented Aug 11, 2023

This function can be used to enable/disable recalculating the normal Z component. By default, the normal.z (blue channel) of the bump map is ignored and it is calculated based on the normal.xy components.

I verified this behavior by taking the normal_mapping example and replacing the blue channel of the normal map with black. By default, it will look exactly the same however with this setting enabled, the model will be mostly in shadow.

Looking it up, it seems like that behavior (ignoring the z component) can be desirable in some circumstances and this feature does exist in Unity and Unreal under the name "Normal Reconstruct Z" and "DeriveNormalZ".

Still it would be useful to be able to turn that off and use the Z component listed in the normal map.

@oreo639 oreo639 changed the title Add C3D_LightEnvBumpUseNormalZ() Add C3D_LightEnvBumpNormalZ() Aug 12, 2023
@oreo639 oreo639 force-pushed the normalz branch 2 times, most recently from c36a8a1 to e517ec6 Compare August 12, 2023 04:24
Used to configure whether the Z component of the normal map is used or if
the Z component is reconstructed based on the XY components of the normal map.
@fincs fincs merged commit 66a0594 into devkitPro:master Aug 12, 2023
@oreo639 oreo639 deleted the normalz branch August 12, 2023 14:54
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.

2 participants