Browse Source

ProcSky has an issue with prepass on some integrated graphics chips, switch to deferred if supported

Josh Engebretson 10 years ago
parent
commit
5bfa179f54

+ 2 - 2
Data/AtomicEditor/Resources/EditorData/AtomicEditor/editor/ui/welcomeframe.tb.txt

@@ -20,8 +20,8 @@ TBLayout: distribution: gravity, size: available, axis: y, id: welcomelayout, po
 				lp: max-width: 420, min-width: 420
 				text: "Welcome to the Atomic Game Engine Early Access\n\n" \
 				"<color #D4FB79>First Steps</color>\n\n" \
-				"• Try out some of the example projects on the right.\n\n" \
-				"• You can also create a new project based on a 2D or 3D template.\n\n" \
+				"• Try out some of the example projects!\n\n" \
+				"• Create a new project based on a 2D or 3D template.\n\n" \
 				"<color #D4FB79>Getting Started Videos</color>\n" \
 				"<widget TBButton: text: 'http://atomicgameengine.com/videos', skin: TBButton.link>\n\n" \
 				"<color #D4FB79>API Documentation</color>\n" \

+ 1 - 1
Data/AtomicPlayer/Resources/CoreData/Techniques/DiffProcSky.xml

@@ -1,3 +1,3 @@
 <technique vs="ProcSky" ps="ProcSky">
-    <pass name="base"  depthtest="always" depthwrite="false" alphamask="false" />
+    <pass name="postopaque" depthwrite="false" />
 </technique>

+ 18 - 0
Source/Atomic/Engine/Engine.cpp

@@ -345,8 +345,26 @@ bool Engine::Initialize(const VariantMap& parameters)
 
         if (HasParameter(parameters, "DumpShaders"))
             graphics->BeginDumpShaders(GetParameter(parameters, "DumpShaders", String::EMPTY).GetString());
+
+        //TODO: make this a preference
+        bool useDeferred = false;
+
+#if defined(ATOMIC_PLATFORM_OSX) || defined(ATOMIC_PLATFORM_WINDOWS)
+        useDeferred = graphics->GetDeferredSupport();
+#endif
+        if (useDeferred)
+        {
+            renderer->SetDefaultRenderPath(cache->GetResource<XMLFile>("RenderPaths/Deferred.xml"));
+        }
+        else
+        {
+            renderer->SetDefaultRenderPath(cache->GetResource<XMLFile>("RenderPaths/Prepass.xml"));
+        }
+
+        /*
         if (HasParameter(parameters, "RenderPath"))
             renderer->SetDefaultRenderPath(cache->GetResource<XMLFile>(GetParameter(parameters, "RenderPath").GetString()));
+        */
 
         renderer->SetDrawShadows(GetParameter(parameters, "Shadows", true).GetBool());
         if (renderer->GetDrawShadows() && GetParameter(parameters, "LowQualityShadows", false).GetBool())

+ 4 - 4
Source/Atomic/Environment/ProcSky.cpp

@@ -340,7 +340,7 @@ if (flipped_)
     n = planes[0].CrossProduct(planes[2]);
     *vdest++ = -1.0f;
     *vdest++ =  top;
-    *vdest++ =  0.5f;
+    *vdest++ =  1.0f;
 
     *vdest++ = n.x_;
     *vdest++ = -n.y_;
@@ -351,7 +351,7 @@ if (flipped_)
     n = planes[3].CrossProduct(planes[0]);
     *vdest++ = -1.0f;
     *vdest++ = bottom;
-    *vdest++ =  0.5f;
+    *vdest++ =  1.0f;
 
     *vdest++ = n.x_;
     *vdest++ = -n.y_;
@@ -362,7 +362,7 @@ if (flipped_)
     n = planes[1].CrossProduct(planes[3]);
     *vdest++ = 1.0f;
     *vdest++ = bottom;
-    *vdest++ =  0.5f;
+    *vdest++ =  1.0f;
 
     *vdest++ = n.x_;
     *vdest++ = -n.y_;
@@ -374,7 +374,7 @@ if (flipped_)
     n = planes[2].CrossProduct(planes[1]);
     *vdest++ = 1.0f;
     *vdest++ = top;
-    *vdest++ =  0.5f;
+    *vdest++ = 1.0f;
 
     *vdest++ = n.x_;
     *vdest++ = -n.y_;