Skip to content

Solari: Fix normal maps and support two-channel maps#24880

Open
JMS55 wants to merge 1 commit into
bevyengine:mainfrom
JMS55:solari7-fixes-normal-maps
Open

Solari: Fix normal maps and support two-channel maps#24880
JMS55 wants to merge 1 commit into
bevyengine:mainfrom
JMS55:solari7-fixes-normal-maps

Conversation

@JMS55

@JMS55 JMS55 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

I was missing the * 2.0 - 1.0 before. See:

if (standard_material_flags & pbr_types::STANDARD_MATERIAL_FLAGS_TWO_COMPONENT_NORMAL_MAP) != 0u {
// Only use the xy components and derive z for 2-component normal maps.
Nt = vec3<f32>(Nt.rg * 2.0 - 1.0, 0.0);
Nt.z = sqrt(1.0 - Nt.x * Nt.x - Nt.y * Nt.y);
} else {
Nt = Nt * 2.0 - 1.0;
}

Also now we reconstruct Z so that two-channel normal maps (e.g. from the texture compressor plugin) are supported.

@JMS55 JMS55 added this to the 0.19.1 milestone Jul 5, 2026
@JMS55 JMS55 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 5, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jul 5, 2026
@JMS55 JMS55 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

2 participants