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

Animation renderer does not support translucency #201

Open
Rampastring opened this issue Oct 8, 2024 · 0 comments
Open

Animation renderer does not support translucency #201

Rampastring opened this issue Oct 8, 2024 · 0 comments

Comments

@Rampastring
Copy link
Member

Due to the new depth implementation, the main rendering shader uses the regular color alpha value as a "texture center offset" value, which has removed support for transparency in the renderer. Animations that use Translucency= with a value greater than 0 are at the time of writing simply not displayed at all.

The shader does support setting a separate custom opacity value as a parameter, but shader parameters can't be changed mid-batch.

One option for solving this is rendering transparent animations in a separate batch, for which a different opacity value would be applied. For this, ObjectSpriteRecord should get support for batching not only by palette texture and remap, but also by opacity.

Another option would be using the alpha color value as texture center offset only when rendering buildings, but use it as opacity for everything else (hardcoding the offset to 0.5). This would require separating the stored sprite record for building anims from buildings, so that the batch for rendering buildings would skip rendering animations, allowing them to be drawn with separate shader settings (complex depth disabled).

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

No branches or pull requests

1 participant