Simple change for better looking billboards. (Camera targeting billboards but with a distance check for rotating.)

Talk about the mods you'd like to see in Daggerfall Unity. Give mod creators some ideas!
Post Reply
User avatar
SpicerXD
Posts: 5
Joined: Fri May 21, 2021 6:15 pm

Simple change for better looking billboards. (Camera targeting billboards but with a distance check for rotating.)

Post by SpicerXD »

The billboards rendered in game should really be facing the camera's transform, not just matching the rotation of the camera. As the latter makes billboards behave strangely when rotating your camera near them.
I manually edited the game's code to do this for most of the billboards (DaggerfallBillboard, DaggerfallMobileUnit, MobilePersonBillboard). And the billboards look and behave much better for it. However I hit a wall with BillboardBatches, as they are oriented by a shader, something I'm not as experienced with editing. But these are the worst offenders since they render the massive trees. Which I think we can all agree look bad when rotating your camera near them.

I think this would be a really easy fix (one line of code in the cases of the scripted billboards) that will add a lot to the visual integrity of the game. :)

And if this doesn't get added as a vanilla feature. Would someone mind making a mod? XD <3
Last edited by SpicerXD on Fri May 21, 2021 8:47 pm, edited 2 times in total.

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

Re: Simple change for better looking billboards.

Post by pango »

Reminds me of old discussions... because it was attempted before
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
SpicerXD
Posts: 5
Joined: Fri May 21, 2021 6:15 pm

Re: Simple change for better looking billboards.

Post by SpicerXD »

I noticed that issue too. But it is pretty easily solved:

if (Vector3.Distance(this.mainCamera.transform.position, base.transform.position) >= 1f)
{
base.transform.LookAt(new Vector3(this.mainCamera.transform.position.x, base.transform.position.y, this.mainCamera.transform.position.z));
}

That'll stop them from rotating if you're on top of them. Works really well to get rid of any weirdness by making them kinda static if you're right next to them. As a bonus their backside isn't rendered, so it gets rid of near clipping on the camera unless you're "in front of them" or have "moved out of them."
Personally I think this solution is a lot more believable. I also tried it on very large billboards, like the big wagons in VIO. And it makes them look so much better when moving around them and through them.

Post Reply