1
0
mirror of https://github.com/LearnOpenGL-CN/LearnOpenGL-CN.git synced 2025-08-23 04:35:28 +08:00

Merge pull request #57 from JiangMuWen/new-theme

tiny code mistake
This commit is contained in:
Meow J
2017-02-04 22:14:30 +08:00
committed by GitHub

View File

@@ -108,7 +108,7 @@ RenderScene();
GLfloat aspect = (GLfloat)SHADOW_WIDTH/(GLfloat)SHADOW_HEIGHT; GLfloat aspect = (GLfloat)SHADOW_WIDTH/(GLfloat)SHADOW_HEIGHT;
GLfloat near = 1.0f; GLfloat near = 1.0f;
GLfloat far = 25.0f; GLfloat far = 25.0f;
glm::mat4 shadowProj = glm::perspective(90.0f, aspect, near, far); glm::mat4 shadowProj = glm::perspective(glm::radians(90.0f), aspect, near, far);
``` ```
非常重要的一点是这里glm::perspective的视野参数设置为90度。90度我们才能保证视野足够大到可以合适地填满立方体贴图的一个面立方体贴图的所有面都能与其他面在边缘对齐。 非常重要的一点是这里glm::perspective的视野参数设置为90度。90度我们才能保证视野足够大到可以合适地填满立方体贴图的一个面立方体贴图的所有面都能与其他面在边缘对齐。
@@ -202,7 +202,7 @@ void main()
lightDistance = lightDistance / far_plane; lightDistance = lightDistance / far_plane;
// Write this as modified depth // Write this as modified depth
gl_FragDepth = gl_FragCoord.z; gl_FragDepth = lightDistance;
} }
``` ```
@@ -476,4 +476,4 @@ PCF算法的结果如果没有变得更好也是非常不错的这是柔
- [Shadow Mapping for point light sources in OpenGL](http://www.sunandblackcat.com/tipFullView.php?l=eng&topicid=36)sunandblackcat的万向阴影映射教程。 - [Shadow Mapping for point light sources in OpenGL](http://www.sunandblackcat.com/tipFullView.php?l=eng&topicid=36)sunandblackcat的万向阴影映射教程。
- [Multipass Shadow Mapping With Point Lights](http://ogldev.atspace.co.uk/www/tutorial43/tutorial43.html)ogldev的万向阴影映射教程。 - [Multipass Shadow Mapping With Point Lights](http://ogldev.atspace.co.uk/www/tutorial43/tutorial43.html)ogldev的万向阴影映射教程。
- [Omni-directional Shadows](http://www.cg.tuwien.ac.at/~husky/RTR/OmnidirShadows-whyCaps.pdf)Peter Houska的关于万向阴影映射的一组很好的ppt。 - [Omni-directional Shadows](http://www.cg.tuwien.ac.at/~husky/RTR/OmnidirShadows-whyCaps.pdf)Peter Houska的关于万向阴影映射的一组很好的ppt。