You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
671 B
Markdown
25 lines
671 B
Markdown
## Reflect
|
|
Calculate the reflection direction for an incident vector
|
|
|
|
### Các phiên bản
|
|
```glsl
|
|
float reflect(float I, float N)
|
|
vec2 reflect(vec2 I, vec2 N)
|
|
vec3 reflect(vec3 I, vec3 N)
|
|
vec4 reflect(vec4 I, vec4 N)
|
|
```
|
|
|
|
### Các tham số
|
|
```I``` specifies the incident vector.
|
|
|
|
```N``` specifies the normal vector.or.
|
|
|
|
### Mô tả
|
|
For a given incident vector ```I``` and surface normal ```N``` reflect returns the reflection direction calculated as ```I - 2.0 * dot(N, I) * N```.
|
|
|
|
```N``` should be normalized in order to achieve the desired result.
|
|
|
|
### Tham khảo thêm
|
|
|
|
[dot()](/glossary/?lan=vi&search=dot), [refract()](/glossary/?lan=vi&search=refract)
|