《如何在《地平线:西部禁域》中降低纹理密度BCn压缩技巧.pdf》由会员分享,可在线阅读,更多相关《如何在《地平线:西部禁域》中降低纹理密度BCn压缩技巧.pdf(40页珍藏版)》请在三个皮匠报告上搜索。
1、How to Decimate your texturesBCn compression tricks in Horizon Forbidden Westhugh.malanguerrilla- Nubis picture ApproximateIdealPicture of long distance shadows16bpp input =4bpp BC1 outputRequirementsBC1 overviewGPU samplingRGB to scalarEncoderResultsGPU sampling of endpoint colorsr2 g4 b25-6-5 endp
2、oint colorExpanded to 8-8-8GPU sampling of interpolated colors on AMDif(interpolation_mode=FourInterpolatedColors)outColors0=color_0;/color_0 and color_1 are RGB888outColors1=color_1;outColors2=(color_0*43)+(color_1*21)+IVec3(32,32,32)/64;outColors3=(color_0*21)+(color_1*43)+IVec3(32,32,32)/64;else/
3、ThreeInterpolatedColorsAndTransparentBlack RGB to scalar requirementsfloat sampled_value=dot(EncodedBC1Texture.Sample(uv).rgb,unpack_constant.xyz);RGB to scalar dotproduct constantfloat sampled_value=dot(EncodedBC1Texture.Sample(uv).rgb,float3(0.96414679,0.03518212,0.00067109)/0.002%max error);Encod
4、er-4x4 input valuesInputsEncoder-possible endpoint colors and unpacked valuesInputsEndpointsEncoder-Low endpoint colorInputsEndpointsEncoder-Possible high endpointInputsEndpointsEncoder-Possible high endpoint and interpolated colorsInputsEndpointsEncoder-Encoded value for each inputInputsEndpoints4b
5、pp BC116bppReduced cloud rendering time by 30%Reduced cloud rendering time by 30%Replace with an image showing green hq heightfield and yellow BC1 heightfield.4bpp BC116bppReduced texture size from 3.1MB to 0.78MBReduced texture size from 3.1MB to 0.78MBhttps:/ level of precision is unlikely to ever
6、 matter to anyone.”Fabian“ryg”GiesenQuestions?“GPU BCn decoding”,Fabien Giesen(2021)https:/ DXT Decompression”,Ignacio Castao(2009)https:/ definition(2008)https:/registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_compression_dxt1.txtReferencesBONUS SLIDES/*16 bit scalar to BC1 encoder.The main e