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

Add engine support for RGBA remap hue/saturation colour shifts. #19367

Merged
merged 3 commits into from
May 16, 2021

Conversation

pchote
Copy link
Member

@pchote pchote commented Apr 23, 2021

This PR implements the engine backend for chroma-keyed player colours on 32bit sprites.

Depends on #19335 (only the last 4 commits are new).

#3692 basically forces us to treat these as add-ons to existing indexed palettes. This fits well with our first major usecase (remastered asset support), but isn't great for mods that might want to exclusively use 32 bit sprites. The actual engine plumbing won't change much, but this does impact the way we set up the traits.

For this reason i'm limiting this PR to the engine plumbing, and leaving the actual traits to downstream mods until #3692 has been finished. This strikes a balance where advanced modders can start to use the feature and provide feedback/bugs but not lock us into supporting a set of traits that we know will need to be replaced.

The testcase commit adds @mabulsoud's chronosphere to the asset browser. Open the asset browser, search for pdox.png, and notice that it responds to the color picker.

@@ -155,46 +193,6 @@ public float GetBrightness()
return (max + min) / 510f;
}

public float GetSaturation()
Copy link
Member

Choose a reason for hiding this comment

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

Public API break for mods?

chrisforbes
chrisforbes previously approved these changes Apr 23, 2021
Copy link
Member

@chrisforbes chrisforbes left a comment

Choose a reason for hiding this comment

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

Not tested, but looks sensible enough to me.

glsl/combined.frag Outdated Show resolved Hide resolved
@pchote pchote force-pushed the playercolor-colorshift branch 2 times, most recently from 0758381 to 6abde6e Compare May 15, 2021 12:52
@teinarss
Copy link
Contributor

needs a rebase.

This was previously decreased to support legacy GPUs
that only supported 8 texture image units and we need
to reserve one of these for the palette texture.

OpenGL 3.X mandates a minimum of 16 (and most most GL2
cards also supported it) so we can now safely increase
this limit.
This avoids reallocating buffers each time the player changes zoom level.
@pchote
Copy link
Member Author

pchote commented May 15, 2021

Rebased and removed the testcase. That is pushed as 18532af if anyone else still wanted to try it.

@reaperrr reaperrr merged commit 0735345 into OpenRA:bleed May 16, 2021
@reaperrr
Copy link
Contributor

@pchote pchote deleted the playercolor-colorshift branch August 21, 2021 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants