Re: Android build openmw
Posted: 20 Jul 2014, 10:28
Nice. I already expected there are more shader issues. Ogre log?
Code: Select all
diff --git a/files/materials/objects.shader b/files/materials/objects.shader
index ed75bab..7d0d392 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,7 +504,7 @@
#if ENV_MAP
// Everything looks better with fresnel
- float facing = 1.0 - max(abs(dot(-eyeDir, normal)), 0);
+ float facing = 1.0 - max(abs(dot(-eyeDir, normal)), 0.0);
float envFactor = shSaturate(0.25 + 0.75 * pow(facing, 1));
shOutputColour(0).xyz += shSample(envMap, UV.zw).xyz * envFactor * env_map_color;
@@ -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..7b24ccc 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;
@@ -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) * lightSpec0;
shOutputColour(0).xyz += specular * (albedo.a) * shadow;
#endif
Seems unlikely. In your last screenshot there are two objects actually displayed properly.It did not help . maybe problem in my patch becuase ogre used eglsurface created by sdl
Code: Select all
diff --git a/files/materials/objects.shader b/files/materials/objects.shader
index ed75bab..3801336 100644
--- a/files/materials/objects.shader
+++ b/files/materials/objects.shader
@@ -488,11 +488,13 @@
float3 waterEyePos = intercept(worldPos, cameraPos.xyz - worldPos, float3(0,0,1), waterLevel);
#endif
+ /*
#if SHADOWS || SHADOWS_PSSM
shOutputColour(0) *= (lightResult - float4(directionalResult * (1.0-shadow),0));
#else
shOutputColour(0) *= lightResult;
#endif
+*/
#if EMISSIVE_MAP
#if @shPropertyString(emissiveMapUVSet)
What was the error and what did you comment exactly?and than i have to commit function windowResized becuase war error when openmw runs