0 votes

Hi, community!

I am writing a 3D mesh in Godot engine, and want to make it have a shadow-effect on the surface.

I set the mesh - GeometryInstance - Use In Baked Light: on. Then, added a DirectionalLight on the right-up corner of the scene, with Light-Shadow: enabled.

But there is no shadow on the mesh. If I try a built-in mesh, for example, a cube, the cube will show shadow with this light source.

What's wrong with it? Thank you!

-Eden

in Engine by (14 points)

are you adding normals to the mesh?

Yes, I have added normals to vertices by calculating two tangents and crossing them to get the normal. But it seems that I have to use a ShaderMaterial, which is totally white and has no shading unless I write a shading script. I am trying to control the shading parameters by a node script dynamically, because the mesh geometry changes with inputs. I don't know if I can achieve this...

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.