Normalizes the specified floating-point vector according to x / length(x).

ret normalize(x)

Parameters

x

[in] The specified floating-point vector.

Return Value

The normalized x parameter. If the length of the x parameter is 0, the result is indefinite.

Remarks

The normalize HLSL intrinsic function uses the following formula: x / length(x).

在编写漫反射光照的时候,错用 normalize 函数。导致光照颜色显示不正确.

code:

float4 lightdirection =  normal( LightDir );

相关文章:

  • 2021-12-02
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2021-07-26
  • 2022-12-23
猜你喜欢
  • 2021-10-23
  • 2021-06-06
  • 2021-08-01
  • 2022-12-23
  • 2021-07-17
  • 2021-06-03
  • 2021-11-06
相关资源
相似解决方案