Tinting a truecolor sprite via translations

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)

Tinting a truecolor sprite via translations

Postby Rip and Tear » Wed Nov 24, 2021 10:24 am

Say I have a grayscale truecolor sprite in my mod. I'd like to use different colorized versions of this sprite— basically, using the brightness information in the sprite while applying hue/saturation values of some color across the entire sprite.

Is this something that could be done through GZDoom's translation features, or would I need to include a sprite for every color I'd want?
User avatar
Rip and Tear
I <3 ZScript
 
Joined: 02 May 2017
Operating System: Mac OS X 10.8 or later
Graphics Processor: Intel (Modern GZDoom)

Re: Tinting a truecolor sprite via translations

Postby Gez » Wed Nov 24, 2021 3:58 pm

Unfortunately, translation effects only apply to palette indices. Therefore when you apply a translation to a truecolor sprite, it is first forced into the palette, and then translated. Hopefully, the gray range in the palette is sufficiently large and granular that the image quality will not suffer too much.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Tinting a truecolor sprite via translations

Postby Graf Zahl » Wed Nov 24, 2021 4:06 pm

There's other colorization options. To evaluate what's right for you and determine if it can be done, can you post an example?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Tinting a truecolor sprite via translations

Postby Rip and Tear » Wed Nov 24, 2021 5:16 pm

Graf Zahl wrote:There's other colorization options. To evaluate what's right for you and determine if it can be done, can you post an example?

Sure, take a look at https://github.com/perfectionismtech/Cronos-Unleashed/tree/ae553e1d6bb7aa1f716b242367bfb2d837f0e227/sprites/flares. FLREA0 is the base sprite, B-G are the manually recolored sprites.
User avatar
Rip and Tear
I <3 ZScript
 
Joined: 02 May 2017
Operating System: Mac OS X 10.8 or later
Graphics Processor: Intel (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests