mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge pull request #5938 from samcake/calvin
Fixing the lighting view matrix for stereo again
This commit is contained in:
commit
04115052b3
1 changed files with 4 additions and 7 deletions
|
@ -442,7 +442,7 @@ void DeferredLightingEffect::render(RenderArgs* args) {
|
||||||
|
|
||||||
deferredTransforms[i].projection = projMats[i];
|
deferredTransforms[i].projection = projMats[i];
|
||||||
|
|
||||||
auto sideViewMat = eyeViews[i] * monoViewMat;
|
auto sideViewMat = monoViewMat * glm::inverse(eyeViews[i]);
|
||||||
viewTransforms[i].evalFromRawMatrix(sideViewMat);
|
viewTransforms[i].evalFromRawMatrix(sideViewMat);
|
||||||
deferredTransforms[i].viewInverse = sideViewMat;
|
deferredTransforms[i].viewInverse = sideViewMat;
|
||||||
|
|
||||||
|
@ -574,10 +574,8 @@ void DeferredLightingEffect::render(RenderArgs* args) {
|
||||||
|
|
||||||
for (auto lightID : _pointLights) {
|
for (auto lightID : _pointLights) {
|
||||||
auto& light = _allocatedLights[lightID];
|
auto& light = _allocatedLights[lightID];
|
||||||
// IN DEBUG: light->setShowContour(true);
|
// IN DEBUG: light->setShowContour(true);
|
||||||
if (_pointLightLocations->lightBufferUnit >= 0) {
|
batch.setUniformBuffer(_pointLightLocations->lightBufferUnit, light->getSchemaBuffer());
|
||||||
batch.setUniformBuffer(_pointLightLocations->lightBufferUnit, light->getSchemaBuffer());
|
|
||||||
}
|
|
||||||
|
|
||||||
float expandedRadius = light->getMaximumRadius() * (1.0f + SCALE_EXPANSION);
|
float expandedRadius = light->getMaximumRadius() * (1.0f + SCALE_EXPANSION);
|
||||||
// TODO: We shouldn;t have to do that test and use a different volume geometry for when inside the vlight volume,
|
// TODO: We shouldn;t have to do that test and use a different volume geometry for when inside the vlight volume,
|
||||||
|
@ -612,8 +610,7 @@ void DeferredLightingEffect::render(RenderArgs* args) {
|
||||||
|
|
||||||
for (auto lightID : _spotLights) {
|
for (auto lightID : _spotLights) {
|
||||||
auto light = _allocatedLights[lightID];
|
auto light = _allocatedLights[lightID];
|
||||||
// IN DEBUG: light->setShowContour(true);
|
// IN DEBUG: light->setShowContour(true);
|
||||||
|
|
||||||
batch.setUniformBuffer(_spotLightLocations->lightBufferUnit, light->getSchemaBuffer());
|
batch.setUniformBuffer(_spotLightLocations->lightBufferUnit, light->getSchemaBuffer());
|
||||||
|
|
||||||
auto eyeLightPos = eyePoint - light->getPosition();
|
auto eyeLightPos = eyePoint - light->getPosition();
|
||||||
|
|
Loading…
Reference in a new issue