DPID Mip Mapping Breaks Normal Maps if Swizzled
Wunder Wulfe
The current script in SDK 3.10.4 (
com.vrchat.base\Editor\VRCSDK\PerceptualPostProcessor.cs
) has issues where it is not respecting the settings defined in the texture importer (including normal map configurations), resulting in broken mip-maps for textures which invert, configure, or otherwise modify the texture channels. Attempting to fix with debugging.
Photo Viewer
View photos in a modal
Log In
Wunder Wulfe
Fixed in
com.vrchat.base\Editor\VRCSDK\Dependencies\VRChat\Resources\PerceptualMipmapping\PerceptualPostProcessor.compute
. I believe that since the texture has no alpha map, this operation writes into the red channel by mistake! Likely also compounded by DXT compression using the alpha channel?Line:
325
float4 pixel = _Input[int2(x, y)];
if (normalMap)
pixel.ba = 1.0f;
Changed
pixel.ba = 1.0f;
to pixel.b = 1.0f;
Wunder Wulfe
Setting
normalMap: false
in the DPID algorithm fixes it; perhaps it is using the wrong channel for the red input?Wunder Wulfe
It also generates this warning, but I am not sure how to get rid of this. Happens with the original too.
Photo Viewer
View photos in a modal