Android build openmw
Re: Android build openmw
I see. Can you get a backtrace?
- sandstranger
- Posts: 438
- Joined: 19 May 2014, 19:53
- Location: Oblivion
Re: Android build openmw
.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.
- sandstranger
- Posts: 438
- Joined: 19 May 2014, 19:53
- Location: Oblivion
Re: Android build openmw
.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 3 times in total.
- sandstranger
- Posts: 438
- Joined: 19 May 2014, 19:53
- Location: Oblivion
Re: Android build openmw
.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.
Re: Android build openmw
Terrain shader patch (this includes all previous patches to other shaders, please undo all your shader changes, then apply this)
Edit: updated
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(use_normal_map_@shIterator)
normalTex = shSample(normalMap@shIterator, 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, blendValues@shPropertyString(blendmap_component_@shIterator));
+ TSnormal = shLerp(TSnormal, normalTex.xyz * 2.0 - 1.0, blendValues@shPropertyString(blendmap_component_@shIterator));
#endif
#endif
@@ -361,7 +361,7 @@ float2 blendUV = (UV - 0.5) * (16.0 / (16.0+1.0)) + 0.5;
diffuseTex = shSample(diffuseMap@shIterator, layerUV);
#if !@shPropertyBool(use_specular_@shIterator)
- diffuseTex.a = 0;
+ diffuseTex.a = 0.0;
#endif
#if @shIterator == 0
@@ -371,7 +371,7 @@ albedo = shLerp(albedo, diffuseTex, blendValues@shPropertyString(blendmap_compon
#endif
#if !IS_FIRST_PASS
- previousAlpha *= 1.f-blendValues@shPropertyString(blendmap_component_@shIterator);
+ previousAlpha *= 1.0-blendValues@shPropertyString(blendmap_component_@shIterator);
#endif
@@ -404,7 +404,7 @@ albedo = shLerp(albedo, diffuseTex, blendValues@shPropertyString(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, blendValues@shPropertyString(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, blendValues@shPropertyString(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
}
- sandstranger
- Posts: 438
- Joined: 19 May 2014, 19:53
- Location: Oblivion
Re: Android build openmw
.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.
- sandstranger
- Posts: 438
- Joined: 19 May 2014, 19:53
- Location: Oblivion
Re: Android build openmw
.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.
- sandstranger
- Posts: 438
- Joined: 19 May 2014, 19:53
- Location: Oblivion
Re: Android build openmw
.
Last edited by sandstranger on 01 Aug 2014, 16:48, edited 1 time in total.
- sandstranger
- Posts: 438
- Joined: 19 May 2014, 19:53
- Location: Oblivion
Re: Android build openmw
.
Last edited by sandstranger on 01 Aug 2014, 16:47, edited 1 time in total.
- sandstranger
- Posts: 438
- Joined: 19 May 2014, 19:53
- Location: Oblivion
Re: Android build openmw
.
Last edited by sandstranger on 01 Aug 2014, 16:48, edited 1 time in total.