Skip to content

Implement interpolated skybox stars#871

Merged
louist103 merged 2 commits intoHarbourMasters:develop-satokofrom
Archez:interpolate-stars
Nov 25, 2024
Merged

Implement interpolated skybox stars#871
louist103 merged 2 commits intoHarbourMasters:develop-satokofrom
Archez:interpolate-stars

Conversation

@Archez
Copy link
Copy Markdown
Contributor

@Archez Archez commented Nov 23, 2024

This adds an implementation to interpolate the skybox stars. The stars are originally drawn using texture rectangles, which are not possible to interpolate. Instead we have to draw the stars as quads against the projection matrix to take advantage of the matrix interpolation system.

The stars have "real" world positions which we can use to position a matrix, and then scale to match the shape of each star, then we apply the billboard matrix rotation so that they always face the camera. We have to perform additional math on the star positions to bring the stars "closer" to the camera, as some of them are beyond the Far clipping value of the projection matrix (causing them to not render).

The interpolated stars flow will only execute when a FPS setting above 20 is used, otherwise the original stars are rendered.

I did my best to calculate the math such that the interpolated stars are as close as possible in size/position to how the original stars were. Any remaining differences are largely just from texture rectangles "snapping" to whole integer values, where as quads have more precision.

smooth-stars.mp4

There is an additional bug fix to correct missing alpha fading on the stars when they appear/disappear. This required a similar "fix" that the bombers notebook needed for some of its elements.

Closes #492

Build Artifacts

@Archez Archez mentioned this pull request Nov 23, 2024
27 tasks
@Archez
Copy link
Copy Markdown
Contributor Author

Archez commented Nov 23, 2024

I could also see this worth being pointed to Satoko instead so that it gets release sooner.

Edit: On second thought, I think this should go into Satoko, as I plan to make a couple other quick fixes.

@Archez Archez changed the base branch from develop to develop-satoko November 23, 2024 21:50
@louist103 louist103 merged commit 809c61d into HarbourMasters:develop-satoko Nov 25, 2024
@Archez Archez deleted the interpolate-stars branch November 25, 2024 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stars are not interpolated

2 participants