I'm experiencing a problem with shadows on Android (because of shaders) but also on some kind of PC. I saw that on a Twitch video, I'm still expecting that guy's response about his hardware. Maybe a chromebook? Anyway...
Here's the shadow when it works: a flattened spaceship colored with a single color darker than the ground.

- shadow_ok.png (2.85 KiB) Viewed 17486 times
And when it's broken: the ship is colored but keeps its original vertex colors. I think it's the result of vertex color + shadow color.

- shadow_broken.png (3.16 KiB) Viewed 17486 times
My shadow works like that:
A BitmapExpression that gets updated when the ground changes color:
Code: Select all
Pixel.R = 0.1 + GroundColor.X * 0.2;
Pixel.G = 0.1 + GroundColor.Y * 0.2;
Pixel.B = 0.1 + GroundColor.Z * 0.2;
Pixel.A = 1;
And a Vertex Shader:
Code: Select all
void main(void)
{
vec4 v = vec4(gl_Vertex);
gl_Position = gl_ModelViewProjectionMatrix * v;
}
I don't recall how I got to this, I made that in 2017... It's working, but not on Android.
So I was wondering if there could be an even simpler way to color an entire Model who HasVertexColors activated. Maybe by calling something like glMaterialfv to color the model with the needed color?
Edit: Or maybe I should just upgrade the project to GLBase ES2/GL3?