Weird lighting/shadow on billboard

Discuss modding questions and implementation details.
Post Reply
User avatar
numidium3rd
Posts: 187
Joined: Sun Mar 25, 2018 12:34 am
Location: United States

Weird lighting/shadow on billboard

Post by numidium3rd »

I implemented my own custom billboard class that's similar to DaggerfallBillboard. I want it to behave mostly like the spell missile explosion where it uses a light component. However, it does this weird thing where the top appears darker than the bottom. Does anyone know what DaggerfallBillboard does to avoid this?
Spoiler!
411_1670110916.jpg
411_1670110916.jpg (41.9 KiB) Viewed 1579 times

User avatar
thenameisthegame
Posts: 36
Joined: Sun Feb 19, 2023 10:02 pm

Re: Weird lighting/shadow on billboard

Post by thenameisthegame »

If I had to guess, I'd say maybe the light source is set on the same centered axis of the billboard, and as it both spawns and fades, causes shadows to be cast on - or ''through'' - the billboard for the parts behind it where light projects.

If environmental light is equal or greater than the light caused by the explosion, the issue is invisible/much less noticeable.

I don't know if a good work around could be to have the explosion have 2 light sources, one slightly in front and one slightly behind the center timed identically?
Attachments
billboard_explosion_light_off_or_shadowed_in_center.png
billboard_explosion_light_off_or_shadowed_in_center.png (549.24 KiB) Viewed 1384 times

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Weird lighting/shadow on billboard

Post by pango »

For enemies glow, I used several tricks, mainly put the light slightly in front on the billboard. Details:
https://github.com/Interkarma/daggerfal ... my.cs#L143
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
numidium3rd
Posts: 187
Joined: Sun Mar 25, 2018 12:34 am
Location: United States

Re: Weird lighting/shadow on billboard

Post by numidium3rd »

Thanks for resurrecting this post. I'll try putting it slightly in front. I'm guessing the issue is that the there's some z-fighting going on when the light source is at the exact position of the billboard.

Post Reply