History

Merge pull request #4361 from samcake/temp0

evolve the Transform stack away from the legacy GL to the brand new shader way

Brad Hefta-Gaub committed 11 years ago

Commit b1189122 parents 128eb1c cad218464 files · +530 −135Browse files

Showing the changes to interface/src/Application.cpp (1 of 64 files). Show all

Unified · Split

interface/src/Application.cpp+5−1
@@ -2547,7 +2547,9 @@ void Application::updateShadowMap() { · 2546 unmodified lines
25472547 glm::ortho(minima.x, maxima.x, minima.y, maxima.y, -maxima.z, -minima.z) * glm::mat4_cast(inverseRotation));
25482548
25492549 // update the shadow view frustum
2550− _shadowViewFrustum.setPosition(rotation * ((minima + maxima) * 0.5f));
2550+ // glm::vec3 shadowFrustumCenter = glm::vec3((minima.x + maxima.x) * 0.5f, (minima.y + maxima.y) * 0.5f, (minima.z + maxima.z) * 0.5f);
2551+ glm::vec3 shadowFrustumCenter = rotation * ((minima + maxima) * 0.5f);
2552+ _shadowViewFrustum.setPosition(shadowFrustumCenter);
25512553 _shadowViewFrustum.setOrientation(rotation);
25522554 _shadowViewFrustum.setOrthographic(true);
25532555 _shadowViewFrustum.setWidth(maxima.x - minima.x);
@@ -2577,8 +2579,10 @@ void Application::updateShadowMap() { · 23 unmodified lines
25772579 // this is what is used for rendering the Entities and avatars
25782580 Transform viewTransform;
25792581 viewTransform.setRotation(rotation);
2582+ // viewTransform.postTranslate(shadowFrustumCenter);
25802583 setViewTransform(viewTransform);
25812584
2585+
25822586 glEnable(GL_POLYGON_OFFSET_FILL);
25832587 glPolygonOffset(1.1f, 4.0f); // magic numbers courtesy http://www.eecs.berkeley.edu/~ravir/6160/papers/shadowmaps.ppt
25842588

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t