Skip to content

Color conversion functions for shaders #20523

@viridia

Description

@viridia

What problem does this solve or what need does it fill?

Part of @ickshonpe 's recent work on shaders involved coding up WGSL color conversion functions for HSL, SRGBA, and other color spaces. Currently these functions are part of the gradient shader; however I would like to use these same functions in other shaders, particularly the "color plane" shader for the feathers color picker.

What solution would you like?

I'd like to move the color conversion functions somewhere that they can be used by multiple shaders. Ideally, I should just be able to import them into my shader code like the other Bevy pbr functions.

What alternative(s) have you considered?

Cutting and pasting the conversion functions into my own shader.

Additional context

#20010 #20035

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ColorColor spaces and color mathC-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesD-ShadersThis code uses GPU shader languagesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions