What to do about planes on models?

I have a character which uses planes for textures (I’d like to have the center one to be a single billboard which follows the character…)

It looks like this

The editor culls the back faces and I can’t change that.

I can disable backface culling in the render script by not listing it at all, but I’m not sure I actually want that?

If I do that then the “back facing” are drawn but shaded as if they were facing backward, the lighting is wrong. (disabled alpha to illustrate)

Any ideas on solving these issues? They are common problems in other engines but there are solutions in other tools too. ex https://answers.unity.com/questions/280741/how-make-visible-the-back-face-of-a-mesh.html

Probably I have to make the planes double sided to avoid the incorrect lighting?

Just fix normals in shader a bit. This issue can be fixed with normal maps, but for simple plane use of normal map can be excessive.

Here is the model with normal map, sails have no issues now.
ships

2 Likes

Could you post example of fix?

Try this - take build-in model fragment shader and use

vec4 normal = vec4(0.,0.,1.,0.);

in calculation instead of var_normal

That removes the fresnel lighting effect entirely unfortunately.

use either normal map for the model or use separate models with different shaders,
e.g. tex1 has normal map, then

 vec4 normal = texture2D(tex1, var_texcoord0.xy);

You can duplicate the plane, but inverse the normal in the model. More faces, but keeps backface culling.

2 Likes