microsoft / DirectXTK12

The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++
https://walbourn.github.io/directx-tool-kit-for-directx-12/
MIT License
1.48k stars 394 forks source link

Support for compressed vertex normals #13

Closed walbourn closed 7 years ago

walbourn commented 7 years ago

If you use the latest SDKMESH exporter to output -compressednormaltype r11g11b10 or ubyten4 compressed normals/tangents/binormals, they don't render correctly with the BasicEffect shaders. They require the vertex shader do a scale and bias (*2 - 1). This requires the following additional permutations of the existing shaders:

VSBasicVertexLighting
VSBasicVertexLightingVc
VSBasicVertexLightingTx
VSBasicVertexLightingTxVc
VSBasicPixelLighting
VSBasicPixelLightingVc
VSBasicPixelLightingTx
VSBasicPixelLightingTxVc

VSEnvMap
VSEnvMapFresnel
VSEnvMapPixelLighting

VSNormalPixelLightingTx
VSNormalPixelLightingTxVc

VSSkinnedVertexLightingOneBone
VSSkinnedVertexLightingTwoBones
VSSkinnedVertexLightingFourBones
VSSkinnedPixelLightingOneBone
VSSkinnedPixelLightingTwoBones
VSSkinnedPixelLightingFourBones
walbourn commented 7 years ago

Fixed for October 2016 release