I am still having a lot of trouble getting any tree to show up properly. I do not use AppGameKit planes. I am exporting from blender. The screen shot is a whooping 8k vertices, and still it looks like garbage.
Here is my shader code. I have tried everything to get the backfaces to show, but almost every angle is just ugly. Some angles show no leaves! The only way I can get a nice view is by forcing the normals to face the camera, but then the lighting is not natural.
void main()
{
mediump vec3 viewDir = normalize( TangentViewPos - TangentFragPos );
mediump vec3 lightDir = normalize( TangentLightPos - TangentFragPos );
mediump vec4 Color = texture2D(texture0, uvVarying);
vec3 finalColor = Color.rgb;
mediump vec4 normalMap = texture2D(texture1, uvVarying);
mediump vec3 ambient = vec3(0.05) * finalColor;
normalMap.rgb = normalize(normalMap.rgb*2.0-1.0);
float diff = abs((dot(lightDir, normalMap.rgb)));
finalColor = diff*finalColor;
//spec
mediump vec3 halfwayDir = normalize(lightDir + viewDir);
float spec = pow(max(dot(normalMap.rgb, halfwayDir), 0.0), 32.0);
mediump vec3 specular = vec3(.002) * spec;
finalColor = finalColor+specular+ambient;
mediump vec3 light = lightVarying + GetPSLighting( normalVarying, posVarying );
finalColor = ApplyFog( finalColor * light, posVarying );
gl_FragColor = vec4(finalColor,Color.a);
if (gl_FragColor.a < .5) discard;
}
Same tree different angle...