Browse Source

Fixed GLES low quality shadows. Fixed Android/iOS not initializing engine parameters from CommandLine.txt.

Lasse Öörni 12 years ago
parent
commit
32a9e72752

+ 2 - 2
Bin/CoreData/Shaders/GLSL/Lighting.frag

@@ -73,9 +73,9 @@ float GetShadow(vec4 shadowPos)
             return cShadowIntensity.y + cShadowIntensity.x * inLight;
             return cShadowIntensity.y + cShadowIntensity.x * inLight;
         #endif
         #endif
     #else
     #else
-        vec2 offsets = cShadowMapInvSize * shadowPos.w;
         #ifndef LQSHADOW
         #ifndef LQSHADOW
             // Take four samples and average them
             // Take four samples and average them
+            vec2 offsets = cShadowMapInvSize * shadowPos.w;
             vec4 inLight = vec4(
             vec4 inLight = vec4(
                 texture2DProj(sShadowMap, shadowPos).r * shadowPos.w > shadowPos.z,
                 texture2DProj(sShadowMap, shadowPos).r * shadowPos.w > shadowPos.z,
                 texture2DProj(sShadowMap, vec4(shadowPos.x + offsets.x, shadowPos.yzw)).r * shadowPos.w > shadowPos.z,
                 texture2DProj(sShadowMap, vec4(shadowPos.x + offsets.x, shadowPos.yzw)).r * shadowPos.w > shadowPos.z,
@@ -85,7 +85,7 @@ float GetShadow(vec4 shadowPos)
             return cShadowIntensity.y + dot(inLight, vec4(cShadowIntensity.x));
             return cShadowIntensity.y + dot(inLight, vec4(cShadowIntensity.x));
         #else
         #else
             // Take one sample
             // Take one sample
-            return cShadowIntensity.y + (texture2DProj(sShadowMap, shadowPos).r * shadowPos.w > shadowPos.z) ? cShadowIntensity.x : 0.0;
+            return cShadowIntensity.y + (texture2DProj(sShadowMap, shadowPos).r * shadowPos.w > shadowPos.z ? cShadowIntensity.x : 0.0);
         #endif
         #endif
     #endif
     #endif
 }
 }

+ 3 - 1
Source/Tools/Urho3DPlayer/Urho3DPlayer.cpp

@@ -55,8 +55,10 @@ void Urho3DPlayer::Setup()
     SharedPtr<File> commandFile(new File(context_, GetSubsystem<FileSystem>()->GetProgramDir() + "Data/CommandLine.txt",
     SharedPtr<File> commandFile(new File(context_, GetSubsystem<FileSystem>()->GetProgramDir() + "Data/CommandLine.txt",
         FILE_READ));
         FILE_READ));
     String commandLine = commandFile->ReadLine();
     String commandLine = commandFile->ReadLine();
-    ParseArguments(commandLine, false);
     commandFile->Close();
     commandFile->Close();
+    ParseArguments(commandLine, false);
+    // Reparse engine startup parameters now
+    engineParameters_ = Engine::ParseParameters(GetArguments());
     #endif
     #endif
 
 
     // Check for script file name
     // Check for script file name