Revision | e305aa1074100dd98bf5255843a60edbd6c9a05f (tree) |
---|---|
Time | 2017-10-11 00:49:33 |
Author | al2950 <anguslauriepile@gmai...> |
Commiter | al2950 |
[Metal] Fixes for Forward+ rendering for metal
@@ -430,8 +430,8 @@ | ||
430 | 430 | //The way ogre represents viewports is top = 0 bottom = 1. As a result if 'texture flipping' is required |
431 | 431 | //all is ok. However if it is not required then viewport offsets are actually represented from the bottom up. |
432 | 432 | //As a result we need convert our veiwport height offsets to work bottom up instead of top down; |
433 | - //This is compounded by DirectX standard being different to OpenGl | |
434 | - if ( !renderTarget->requiresTextureFlipping() && shaderProfile != "hlsl" ) | |
433 | + //This is compounded by OpenGL standard being different to DirectX and Metal | |
434 | + if ( !renderTarget->requiresTextureFlipping() && shaderProfile == "glsl" ) | |
435 | 435 | { |
436 | 436 | viewportHeightOffset = static_cast<float>( (1.0 - (viewport->getTop() + viewport->getHeight()) ) |
437 | 437 | * renderTarget->getHeight() ); |
@@ -629,8 +629,8 @@ | ||
629 | 629 | //The way ogre represents viewports is top = 0 bottom = 1. As a result if 'texture flipping' is required |
630 | 630 | //all is ok. However if it is not required then viewport offsets are actually represented from the bottom up. |
631 | 631 | //As a result we need convert our veiwport height offsets to work bottom up instead of top down; |
632 | - //This is compounded by DirectX standard being different to OpenGl | |
633 | - if (!renderTarget->requiresTextureFlipping() && shaderProfile != "hlsl") | |
632 | + //This is compounded by OpenGL standard being different to DirectX and Metal | |
633 | + if ( !renderTarget->requiresTextureFlipping() && shaderProfile == "glsl" ) | |
634 | 634 | { |
635 | 635 | viewportHeightOffset = static_cast<float>((1.0 - (viewport->getTop() + viewport->getHeight()) ) |
636 | 636 | * renderTarget->getHeight()); |
@@ -29,7 +29,7 @@ | ||
29 | 29 | //passBuf.f3dGridHWW[slice].z = grid_width * lightsPerCell; |
30 | 30 | //uint sampleOffset = 0; |
31 | 31 | uint sampleOffset = offset + |
32 | - uint(floor( (windowHeight - (inPs.gl_FragCoord.y - passBuf.f3dViewportOffset.y) * passBuf.f3dGridHWW[slice].y ) * passBuf.f3dGridHWW[slice].z) + | |
32 | + uint(floor( (windowHeight - (inPs.gl_FragCoord.y - passBuf.f3dViewportOffset.y) * passBuf.f3dGridHWW[slice].y )) * passBuf.f3dGridHWW[slice].z) + | |
33 | 33 | uint(floor( (inPs.gl_FragCoord.x - passBuf.f3dViewportOffset.x ) * passBuf.f3dGridHWW[slice].x ) * lightsPerCell); |
34 | 34 | @end @property( hlms_forwardplus != forward3d ) |
35 | 35 | float f3dMinDistance = passBuf.f3dData.x; |