Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move subtex scaling to shader #1639

Merged
merged 9 commits into from
Apr 21, 2024
Merged

Conversation

heinezen
Copy link
Member

Move the scaling of subtextures (i.e. handling of zoom, animation scaling, etc.) to the world shader.

Camera zoom and viewport size are send via the camera's uniform buffer, so these variables are now requested only once per frame. The world object's have to send an additional float as a uniform, but no longer have to calculate the scaling themselves which roughly halves the cycles spent on creating these uniform values.

The PR also fixes a bug in the alignment of uniforms in the uniform buffer that was previously not discovered. Uniforms where not properly aligned to a multiple of their size which resulted in the created buffer being too small and using the wrong offsets. This should now be fixed.

@heinezen heinezen added improvement Enhancement of an existing component area: renderer Concerns our graphics renderer lang: c++ Done in C++ code labels Apr 21, 2024
@heinezen heinezen force-pushed the feature/scale-shader branch from d66fb18 to 185dd98 Compare April 21, 2024 16:06
Copy link
Member

@TheJJ TheJJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yey

@TheJJ TheJJ merged commit 920367b into SFTtech:master Apr 21, 2024
13 checks passed
@heinezen heinezen deleted the feature/scale-shader branch September 7, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: renderer Concerns our graphics renderer improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants