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 Color Parameter Type float4 to .hlsl and User Input #691

Open
EricBanker12 opened this issue Jul 27, 2023 · 1 comment
Open

Add Color Parameter Type float4 to .hlsl and User Input #691

EricBanker12 opened this issue Jul 27, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@EricBanker12
Copy link

EricBanker12 commented Jul 27, 2023

Expected behavior 预期的功能

Expected Behavior:

  • .hlsl effects can have //!PARAMETER for color with type float4
  • Users can pick color from a ColorPicker to set parameter value.
//!PARAMETER
//!LABEL Color 0
//!RED 1.0
//!GREEN 1.0
//!BLUE 1.0
//!ALPHA 1.0
float4 Color_0;

Currently, shaders with color input must split color into many float parameters. Additionally, users must configure color using multiple sliders with no color preview.

For example, in my Shaders-for-Magpie repository, Nostolgia.hlsl, which emulates 8-bit color, requires 48 float sliders with no color preview to set up a custom 8-bit color palette.

I tried to add this functionality myself, but I got stuck. I could not understand how values are passed to shader to create float4.

Alternative behavior (optional) 近似的功能(可选)

Alternative Behavior:

  • .hlsl effects can have //!PARAMETER for color with 4 consecutive type float.
  • Users can pick color from a ColorPicker to set parameter values.
//!PARAMETER
//!LABEL Color 0
//!RED 1.0
//!GREEN 1.0
//!BLUE 1.0
//!ALPHA 1.0
float Color_0_Red, Color_0_Green, Color_0_Blue, Color_0_Alpha;

Alternative:

//!PARAMETER
//!LABEL Color 0
//!DEFAULT 1.0
//!COLOR 0
float Color_0_Red;

//!PARAMETER
//!LABEL Color 0
//!DEFAULT 1.0
//!COLOR 1
float Color_0_GREEN;

//!PARAMETER
//!LABEL Color 0
//!DEFAULT 1.0
//!COLOR 2
float Color_0_Blue;

//!PARAMETER
//!LABEL Color 0
//!DEFAULT 1.0
//!COLOR 3
float Color_0_Alpha;
@EricBanker12 EricBanker12 added the enhancement New feature or request label Jul 27, 2023
@Blinue
Copy link
Owner

Blinue commented Jul 28, 2023

This feature is fantastic and will also benefit existing effects like ImageAdjustment. I'm currently working on MagpieFX Version 4, where this functionality will be included.

The syntax for Magpie's effects is still unstable at the moment. Until the first official release (which won't be too far off), I won't be able to maintain compatibility with older versions. Please take note of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants