Android build openmw

Everything about development and the OpenMW source code.
Locked
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Android build openmw

Post by scrawl » 25 Jul 2014, 16:57

I see. Can you get a backtrace?

User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger » 25 Jul 2014, 19:19

.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.

User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger » 25 Jul 2014, 20:18

.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 3 times in total.

User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger » 25 Jul 2014, 20:44

.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.

User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Android build openmw

Post by scrawl » 25 Jul 2014, 22:55

Terrain shader patch (this includes all previous patches to other shaders, please undo all your shader changes, then apply this)

Edit: updated

Code: Select all

diff --git a/files/materials/atmosphere.shader b/files/materials/atmosphere.shader
index f02c576..c8a8e02 100644
--- a/files/materials/atmosphere.shader
+++ b/files/materials/atmosphere.shader
@@ -33,7 +33,7 @@
 
     SH_START_PROGRAM
     {
-        shOutputColour(0) = alphaFade * atmosphereColour + (1.f - alphaFade) * horizonColour;
+        shOutputColour(0) = alphaFade * atmosphereColour + (1.0 - alphaFade) * horizonColour;
     }
 
 #endif
diff --git a/files/materials/clouds.shader b/files/materials/clouds.shader
index d3e5f08..9e9b102 100644
--- a/files/materials/clouds.shader
+++ b/files/materials/clouds.shader
@@ -25,7 +25,7 @@
 
         shOutputPosition = shMatrixMult(proj, shMatrixMult(worldviewFixed, shInputPosition));
         UV = uv0;
-            alphaFade = (shInputPosition.z <= 200.f) ? ((shInputPosition.z <= 100.f) ? 0.0 : 0.25) : 1.0;
+            alphaFade = (shInputPosition.z <= 200.0) ? ((shInputPosition.z <= 100.0) ? 0.0 : 0.25) : 1.0;
     }
 
 #else
diff --git a/files/materials/mygui.shader b/files/materials/mygui.shader
index 014558d..4d12eba 100644
--- a/files/materials/mygui.shader
+++ b/files/materials/mygui.shader
@@ -14,7 +14,7 @@
 
     SH_START_PROGRAM
     {
-        shOutputPosition = float4(shInputPosition.xyz, 1.f);
+        shOutputPosition = float4(shInputPosition.xyz, 1.0);
 #if TEXTURE
         UV.xy = uv0;
 #endif
diff --git a/files/materials/objects.shader b/files/materials/objects.shader
index ed75bab..bacf3f9 100644
--- a/files/materials/objects.shader
+++ b/files/materials/objects.shader
@@ -210,11 +210,11 @@
 #if VERTEXCOLOR_MODE == 2
             lightResult.xyz += colour.xyz * lightDiffuse[@shIterator].xyz
                     * shSaturate(1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d)))
-                    * max(dot(viewNormal.xyz, lightDir), 0);
+                    * max(dot(viewNormal.xyz, lightDir), 0.0);
 #else
             lightResult.xyz += materialDiffuse.xyz * lightDiffuse[@shIterator].xyz
                     * shSaturate(1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d)))
-                    * max(dot(viewNormal.xyz, lightDir), 0);
+                    * max(dot(viewNormal.xyz, lightDir), 0.0);
 #endif
 
 #if @shIterator == 0
@@ -432,11 +432,11 @@
 #if VERTEXCOLOR_MODE == 2
             lightResult.xyz += colourPassthrough.xyz * lightDiffuse[@shIterator].xyz
                     * shSaturate(1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d)))
-                    * max(dot(viewNormal.xyz, lightDir), 0);
+                    * max(dot(viewNormal.xyz, lightDir), 0.0);
 #else
             lightResult.xyz += materialDiffuse.xyz * lightDiffuse[@shIterator].xyz
                     * shSaturate(1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d)))
-                    * max(dot(viewNormal.xyz, lightDir), 0);
+                    * max(dot(viewNormal.xyz, lightDir), 0.0);
 #endif
 
 #if @shIterator == 0
@@ -504,8 +504,8 @@
 
 #if ENV_MAP
         // Everything looks better with fresnel
-        float facing = 1.0 - max(abs(dot(-eyeDir, normal)), 0);
-        float envFactor = shSaturate(0.25 + 0.75 * pow(facing, 1));
+        float facing = 1.0 - max(abs(dot(-eyeDir, normal)), 0.0);
+        float envFactor = shSaturate(0.25 + 0.75 * pow(facing, 1.0));
 
         shOutputColour(0).xyz += shSample(envMap, UV.zw).xyz * envFactor * env_map_color;
 #endif
@@ -513,7 +513,7 @@
 #if SPECULAR
         float3 light0Dir = normalize(lightPosObjSpace0.xyz);
 
-        float NdotL = max(dot(normal, light0Dir), 0);
+        float NdotL = max(dot(normal, light0Dir), 0.0);
         float3 halfVec = normalize (light0Dir + eyeDir);
 
         float shininess = matShininess;
@@ -522,7 +522,7 @@
         shininess *= (specTex.a);
 #endif
 
-        float3 specular = pow(max(dot(normal, halfVec), 0), shininess) * lightSpec0 * matSpec;
+        float3 specular = pow(max(dot(normal, halfVec), 0.0), shininess) * lightSpec0 * matSpec;
 #if SPEC_MAP
         specular *= specTex.xyz;
 #else
diff --git a/files/materials/terrain.shader b/files/materials/terrain.shader
index 1436de0..8384588 100644
--- a/files/materials/terrain.shader
+++ b/files/materials/terrain.shader
@@ -175,7 +175,7 @@
 
             lightResult.xyz += lightDiffuse[@shIterator].xyz
                     * shSaturate(1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d)))
-                    * max(dot(normal.xyz, lightDir), 0);
+                    * max(dot(normal.xyz, lightDir), 0.0);
 
 #if @shIterator == 0
             directionalResult = lightResult.xyz;
@@ -310,7 +310,7 @@ shUniform(float4, cameraPos) @shAutoConstant(cameraPos, camera_position)
 
 #if !IS_FIRST_PASS
 // Opacity the previous passes should have, i.e. 1 - (opacity of this pass)
-float previousAlpha = 1.f;
+float previousAlpha = 1.0;
 #endif
 
 
@@ -334,7 +334,7 @@ float2 blendUV = (UV - 0.5) * (16.0 / (16.0+1.0)) + 0.5;
 
         float4 albedo = float4(0,0,0,1);
 
-        float2 layerUV = float2(UV.x, 1.f-UV.y) * 16; // Reverse Y, required to get proper tangents
+        float2 layerUV = float2(UV.x, 1.0-UV.y) * 16.0; // Reverse Y, required to get proper tangents
         float2 thisLayerUV;
         float4 normalTex;
         float4 diffuseTex;
@@ -349,9 +349,9 @@ float2 blendUV = (UV - 0.5) * (16.0 / (16.0+1.0)) + 0.5;
 #if @shPropertyBool([email protected])
         normalTex = shSample([email protected], thisLayerUV);
 #if @shIterator == 0 && IS_FIRST_PASS
-        TSnormal = normalize(normalTex.xyz * 2 - 1);
+        TSnormal = normalize(normalTex.xyz * 2.0 - 1.0);
 #else
-        TSnormal = shLerp(TSnormal, normalTex.xyz * 2 - 1, [email protected]([email protected]));
+        TSnormal = shLerp(TSnormal, normalTex.xyz * 2.0 - 1.0, [email protected]([email protected]));
 #endif
 #endif
 
@@ -361,7 +361,7 @@ float2 blendUV = (UV - 0.5) * (16.0 / (16.0+1.0)) + 0.5;
 
         diffuseTex = shSample([email protected], layerUV);
 #if [email protected]([email protected])
-        diffuseTex.a = 0;
+        diffuseTex.a = 0.0;
 #endif
 
 #if @shIterator == 0
@@ -371,7 +371,7 @@ albedo = shLerp(albedo, diffuseTex, [email protected](blendmap_compon
 #endif
 
 #if !IS_FIRST_PASS
-        previousAlpha *= [email protected]([email protected]);
+        previousAlpha *= [email protected]([email protected]);
 #endif
 
 
@@ -404,7 +404,7 @@ albedo = shLerp(albedo, diffuseTex, [email protected](blendmap_compon
 
             lightResult.xyz += lightDiffuse[@shIterator].xyz
                     * shSaturate(1.0 / ((lightAttenuation[@shIterator].y) + (lightAttenuation[@shIterator].z * d) + (lightAttenuation[@shIterator].w * d * d)))
-                    * max(dot(normal.xyz, lightDir), 0);
+                    * max(dot(normal.xyz, lightDir), 0.0);
 #if @shIterator == 0
             float3 directionalResult = lightResult.xyz;
 #endif
@@ -444,10 +444,10 @@ albedo = shLerp(albedo, diffuseTex, [email protected](blendmap_compon
         // Specular
         float3 light0Dir = normalize(lightPos0.xyz);
 
-        float NdotL = max(dot(normal, light0Dir), 0);
+        float NdotL = max(dot(normal, light0Dir), 0.0);
         float3 halfVec = normalize (light0Dir + eyeDir);
 
-        float3 specular = pow(max(dot(normal, halfVec), 0), 32) * lightSpec0;
+        float3 specular = pow(max(dot(normal, halfVec), 0.0), 32.0) * lightSpec0;
         shOutputColour(0).xyz += specular * (albedo.a) * shadow;
 #endif
 
@@ -465,9 +465,9 @@ albedo = shLerp(albedo, diffuseTex, [email protected](blendmap_compon
         shOutputColour(0).xyz = max(shOutputColour(0).xyz, float3(0,0,0));
 
 #if IS_FIRST_PASS
-        shOutputColour(0).a = 1;
+        shOutputColour(0).a = 1.0;
 #else
-        shOutputColour(0).a = 1.f-previousAlpha;
+        shOutputColour(0).a = 1.0-previousAlpha;
 #endif
     }
 

User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger » 26 Jul 2014, 14:13

.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.

User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger » 26 Jul 2014, 16:40

.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.

User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger » 26 Jul 2014, 17:32

.
Last edited by sandstranger on 01 Aug 2014, 16:48, edited 1 time in total.

User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger » 26 Jul 2014, 18:54

.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.

User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger » 26 Jul 2014, 19:59

.
Last edited by sandstranger on 01 Aug 2014, 16:48, edited 1 time in total.

Locked