DXGI FOMAT中的SNORM和 UNORM格式

  1. SNORM:表示归一化处理的有符号整数,这个格式的数据在资源(resource)中解释为有符号整数,在shader中则被解释为(-1.0...1.0)之间的浮点数,如DXGI_FORMAT_R8G8B8A8_SNORM
Signed normalized integer; which is interpreted in a resource as a signed integer, and is interpreted in a shader as a signed normalized floating-point value in the range [-1, 1]. For an 2's complement number, the maximum value is 1.0f (a 5-bit value 01111 maps to 1.0f), and the minimum value is -1.0f (a 5-bit value 10000 maps to -1.0f). In addition, the second-minimum number maps to -1.0f (a 5-bit value 10001 maps to -1.0f). The resulting integer representations are evenly spaced floating-point values in the range (-1.0f...0.0f), and also a complementary set of representations for numbers in the range (0.0f...1.0f).
  1. UNORM:表示归一化处理的无符号整数,此种格式数据在资源中被解释为无符号整数,在shader中解释为(0.0...1.0)之间的浮点数,如DXGI_FORMAT_R8G8B8A8_UNORM。以2位无符号整数为例,00,01,10,11(即0,1,2,3),分别对应的浮点数为0.0,1/3,2/3,1.0。
    Unsigned normalized integer; which is interpreted in a resource as an unsigned integer, and is interpreted in a shader as an unsigned normalized floating-point value in the range [0, 1]. All 0's maps to 0.0f, and all 1's maps to 1.0f. A sequence of evenly spaced floating-point values from 0.0f to 1.0f are represented. For instance, a 2-bit UNORM represents 0.0f, 1/3, 2/3, and 1.0f.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值