Ursina Python Engine: Lighting, Shadows And Bloom Effects
Solution 1:
You have to import shaders from ursina and then apply directional light.
from ursina import *
from ursina.shaders import lit_with_shadows_shader
app = Ursina()
EditorCamera()
Entity(model='plane', scale=10, color=color.gray,
shader=lit_with_shadows_shader)
Entity(model='cube', y=1, shader=lit_with_shadows_shader)
pivot = Entity()
DirectionalLight(parent=pivot, y=2, z=3, shadows=True, rotation=(45, -45, 45))
app.run()
Solution 2:
You have to add lights and also apply lit_with_shadows_shader
to entities that will receive shadow.
See more here: https://www.ursinaengine.org/cheat_sheet.html#DirectionalLight