• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisione305aa1074100dd98bf5255843a60edbd6c9a05f (tree)
Time2017-10-11 00:49:33
Authoral2950 <anguslauriepile@gmai...>
Commiteral2950

Log Message

[Metal] Fixes for Forward+ rendering for metal

Change Summary

Incremental Difference

diff -r 3d6143658b0b -r e305aa107410 OgreMain/src/OgreForward3D.cpp
--- a/OgreMain/src/OgreForward3D.cpp Fri Sep 22 17:56:59 2017 +0100
+++ b/OgreMain/src/OgreForward3D.cpp Tue Oct 10 16:49:33 2017 +0100
@@ -430,8 +430,8 @@
430430 //The way ogre represents viewports is top = 0 bottom = 1. As a result if 'texture flipping' is required
431431 //all is ok. However if it is not required then viewport offsets are actually represented from the bottom up.
432432 //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" )
435435 {
436436 viewportHeightOffset = static_cast<float>( (1.0 - (viewport->getTop() + viewport->getHeight()) )
437437 * renderTarget->getHeight() );
diff -r 3d6143658b0b -r e305aa107410 OgreMain/src/OgreForwardClustered.cpp
--- a/OgreMain/src/OgreForwardClustered.cpp Fri Sep 22 17:56:59 2017 +0100
+++ b/OgreMain/src/OgreForwardClustered.cpp Tue Oct 10 16:49:33 2017 +0100
@@ -629,8 +629,8 @@
629629 //The way ogre represents viewports is top = 0 bottom = 1. As a result if 'texture flipping' is required
630630 //all is ok. However if it is not required then viewport offsets are actually represented from the bottom up.
631631 //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" )
634634 {
635635 viewportHeightOffset = static_cast<float>((1.0 - (viewport->getTop() + viewport->getHeight()) )
636636 * renderTarget->getHeight());
diff -r 3d6143658b0b -r e305aa107410 Samples/Media/Hlms/Pbs/Metal/Forward3D_piece_ps.metal
--- a/Samples/Media/Hlms/Pbs/Metal/Forward3D_piece_ps.metal Fri Sep 22 17:56:59 2017 +0100
+++ b/Samples/Media/Hlms/Pbs/Metal/Forward3D_piece_ps.metal Tue Oct 10 16:49:33 2017 +0100
@@ -29,7 +29,7 @@
2929 //passBuf.f3dGridHWW[slice].z = grid_width * lightsPerCell;
3030 //uint sampleOffset = 0;
3131 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) +
3333 uint(floor( (inPs.gl_FragCoord.x - passBuf.f3dViewportOffset.x ) * passBuf.f3dGridHWW[slice].x ) * lightsPerCell);
3434 @end @property( hlms_forwardplus != forward3d )
3535 float f3dMinDistance = passBuf.f3dData.x;