WebGLRenderer: Add support for packed normal maps.#33055
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
@Mugen87 I think the CI error is unrelated to this change. Let me know if you think that's not the case and I'll investigate. |
|
A rerun solved the CI issue 🎉 . I'm okay with this change but I would like to hear the feedback of @donmccurdy because he was involved in the initial discussion. @donmccurdy Are you okay with supporting packed normal maps like proposed in |
|
Oh wait, I see now he has given a heart to the PR. In this case, I assume he is fine with the change 😅 . |
BTW: You have changed The WebGL backend of |
Previous PRs added support for packed RG normal maps to the WebGPU backend:
#31695
#32308
This PR extends that support to the WebGL backend by adding a
packedNormalMapparameter to the fragment shader. This definesUSE_PACKED_NORMALMAPand adds the necessary shader code tonormal_fragment_maps. The parameter is set when the format of the textures bound to the normal map type is one of the packed format types (RGFormat,RG11_EAC_Format, orRED_GREEN_RGTC2_Format).This also updates an incorrect webgl test, which used packed normal maps and did not shade them correctly due to the missing normal reconstruction code.
This contribution is funded by Ludicon