mirror of
https://github.com/LearnOpenGL-CN/LearnOpenGL-CN.git
synced 2025-08-23 04:35:28 +08:00
Merge pull request #93 from fuzhenn/patch-1
fix typo in advanced lightning/05 parallax mapping
This commit is contained in:
@@ -143,7 +143,7 @@ void main()
|
|||||||
vec2 ParallaxMapping(vec2 texCoords, vec3 viewDir)
|
vec2 ParallaxMapping(vec2 texCoords, vec3 viewDir)
|
||||||
{
|
{
|
||||||
float height = texture(depthMap, texCoords).r;
|
float height = texture(depthMap, texCoords).r;
|
||||||
vec3 p = viewDir.xy / viewDir.z * (height * height_scale);
|
vec2 p = viewDir.xy / viewDir.z * (height * height_scale);
|
||||||
return texCoords - p;
|
return texCoords - p;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -302,4 +302,4 @@ return finalTexCoords;
|
|||||||
## 附加资源
|
## 附加资源
|
||||||
|
|
||||||
- [Parallax Occlusion Mapping in GLSL](http://sunandblackcat.com/tipFullView.php?topicid=28):sunandblackcat.com上的视差贴图教程。
|
- [Parallax Occlusion Mapping in GLSL](http://sunandblackcat.com/tipFullView.php?topicid=28):sunandblackcat.com上的视差贴图教程。
|
||||||
- [How Parallax Displacement Mapping Works](https://www.youtube.com/watch?v=xvOT62L-fQI):TheBennyBox的关于视差贴图原理的视频教程。
|
- [How Parallax Displacement Mapping Works](https://www.youtube.com/watch?v=xvOT62L-fQI):TheBennyBox的关于视差贴图原理的视频教程。
|
||||||
|
Reference in New Issue
Block a user