UI, Texture, Sampler, and Technique Macros
- TreyM
- Topic Author
Less
More
5 years 8 months ago - 4 years 10 months ago #1
by TreyM
UI, Texture, Sampler, and Technique Macros was created by TreyM
This set of macros can speed up the creation of shader UI layouts, very quickly setup textures and samplers, and clean up the technique section of your code.
To use, simply copy the code from the Macros.fxh code block below into a new file named "Macros.fxh", then add it to the Shaders folder where ReShade.fx is, and include it with this line:
The demonstration file below shows the proper syntax to use the macros.
Macros File: Macros.fxh
Demonstration File: MacrosDemo.fx
UPDATED 12/15/2018
Now fully supports ReShade 4
(some macro names have changed!)
To use, simply copy the code from the Macros.fxh code block below into a new file named "Macros.fxh", then add it to the Shaders folder where ReShade.fx is, and include it with this line:
#include "Macros.fxh"
The demonstration file below shows the proper syntax to use the macros.
Macros File: Macros.fxh
Warning: Spoiler!
////////////////////////////////////////////////////////////
// BASIC MACROS FOR RESHADE 4 //
// AUTHOR: TREYM //
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// Macros Guide: //
////////////////////////////////////////////////////////////
/* //////////////////////////////////////////////////// *
* //////////////////////////////////////////////////// *
Usage of these macros is very simple once you understand
the syntax and variable names. Let's start with a Simple
integer slider. To begin, type:
UI_INT
Next we need to add _S to indicate that this is a
"slider" widget. Follow the syntax below:
UI_INT_S(INT_NAME, "Label", "Tooltip", 0, 100, 50)
Using just a single line of code, we have created a UI
tweakable integer named INT_NAME with a minimum value of
0, a maximum value of 100, and a default value of 50.
Next, let's create that same widget, but within a UI
category. This time, we'll type:
CAT_INT_S(INT_NAME, "Category", "Label", "Tooltip", 0, 100, 50)
As you can see, the syntax follows the same pattern but
with a new input for "Category"
Below you will find a useful list of examples to get you
started. I hope you find these useful and they help your
workflow. Happy coding!
- TreyM
* //////////////////////////////////////////////////// *
* //////////////////////////////////////////////////// *
Widget Types
Input = _I
Slider = _S
Drag = _D
* //////////////////////////////////////////////////// *
BOOLEAN Macro
UI_BOOL(BOOL_NAME, "Label", "Tooltip", true)
BOOLEAN Categorized Macro
CAT_BOOL(BOOL_NAME, "Category", "Label", "Tooltip", true)
* //////////////////////////////////////////////////// *
INTEGER Combo Widget
UI_COMBO(INT_NAME, "Label", "Tooltip", 0, 2, 0, "Item 1\0Item 2\0Item 3\0")
INTEGER Drag Widget
UI_INT_D(INT_NAME, "Label", "Tooltip", 0, 100, 50)
INTEGER Input Widget
UI_INT_I(INT_NAME, "Label", "Tooltip", 0, 100, 50)
INTEGER Radio Widget
UI_RADIO(INT_NAME, "Label", "Tooltip", 0, 2, 0, " Item 1 \0 Item 2 \0 Item 3\0")
INTEGER Slider Widget
UI_INT_S(INT_NAME, "Label", "Tooltip", 0, 100, 50)
INTEGER Categorized Combo Widget
CAT_COMBO(INT_NAME, "Category", "Label", "Tooltip", 0, 2, 0, " Item 1 \0 Item 2 \0 Item 3\0")
INTEGER Categorized Drag Widget
CAT_INT_D(INT_NAME, "Category", "Label", "Tooltip", 0, 100, 50)
INTEGER Categorized Input Widget
CAT_INT_I(INT_NAME, "Category", "Label", "Tooltip", 0, 100, 50)
INTEGER Categorized Radio Widget
CAT_RADIO(INT_NAME, "Category", "Label", "Tooltip", 0, 2, 0, " Item 1 \0 Item 2 \0 Item 3\0")
INTEGER Categorized Slider Widget
CAT_INT_S(INT_NAME, "Category", "Label", "Tooltip", 0, 100, 50)
* //////////////////////////////////////////////////// *
FLOAT Drag Widget
UI_FLOAT_D(FLOAT_NAME, "Label", "Tooltip", 0.0, 1.0, 0.5)
FLOAT Input Widget
UI_FLOAT_I(FLOAT_NAME, "Label", "Tooltip", 0.0, 1.0, 0.5)
FLOAT Slider Widget
UI_FLOAT_S(FLOAT_NAME, "Label", "Tooltip", 0.0, 1.0, 0.5)
FLOAT Categorized Drag Widget
CAT_FLOAT_D(FLOAT_NAME, "Category", "Label", "Tooltip", 0.0, 1.0, 0.5)
FLOAT Categorized Input Widget
CAT_FLOAT_I(FLOAT_NAME, "Category", "Label", "Tooltip", 0.0, 1.0, 0.5)
FLOAT Categorized Slider Widget
CAT_FLOAT_S(FLOAT_NAME, "Category", "Label", "Tooltip", 0.0, 1.0, 0.5)
FLOAT macro with full control (value after "Tooltip" is ui_step)
UI_FLOAT_FULL(FLOAT_NAME, "ui_type", "Label", "Tooltip", 0.1, 0.0, 1.0, 0.5)
FLOAT Categorized macro with full control (value after "Tooltip" is ui_step)
CAT_FLOAT_FULL(FLOAT_NAME, "ui_type", "Category", "Label", "Tooltip", 0.1, 0.0, 1.0, 0.5)
* //////////////////////////////////////////////////// *
FLOAT3 Drag Widget
UI_FLOAT3_D(FLOAT_NAME, "Label", "Tooltip", 0.5, 0.5, 0.5)
FLOAT3 Input Widget
UI_FLOAT3_I(FLOAT_NAME, "Label", "Tooltip", 0.5, 0.5, 0.5)
FLOAT3 Slider Widget
UI_FLOAT3_S(FLOAT_NAME, "Label", "Tooltip", 0.5, 0.5, 0.5)
FLOAT3 Categorized Drag Widget
CAT_FLOAT3_D(FLOAT_NAME, "Category", "Label", "Tooltip", 0.5, 0.5, 0.5)
FLOAT3 Categorized Input Widget
CAT_FLOAT3_I(FLOAT_NAME, "Category", "Label", "Tooltip", 0.5, 0.5, 0.5)
FLOAT3 Categorized Slider Widget
CAT_FLOAT3_S(FLOAT_NAME, "Category", "Label", "Tooltip", 0.5, 0.5, 0.5)
* //////////////////////////////////////////////////// *
FLOAT3 Color Widget
UI_COLOR(FLOAT_NAME, "Label", "Tooltip", 0.5, 0.5, 0.5)
FLOAT3 Categorized Color Widget
CAT_COLOR(FLOAT_NAME, "Category", "Label", "Tooltip", 0.5, 0.5, 0.5)
* //////////////////////////////////////////////////// *
SAMPLER Macro
SAMPLER(SamplerName, TextureName)
TEXTURE Macro
TEXTURE(TextureName, "TexturePath")
TEXTURE Full Macro
TEXTURE_FULL(TextureName, "TexturePath", Width, Height, Format)
* //////////////////////////////////////////////////// *
TECHNIQUE Macro
TECHNIQUE(TechniqueName, PassMacro)
PASS Macro
PASS(PassID, VertexShader, PixelShader)
PASS Macro with RenderTarget
PASS_RT(PassID, VertexShader, PixelShader, RenderTarget)
////////////////////////////////////////////////////
* //////////////////////////////////////////////////// */
// INTEGER MACROS ////////////////////////////////
#define UI_COMBO(var, label, tooltip, minval, maxval, defval, items) \
uniform int var \
< \
ui_type = "combo"; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_items = items; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define CAT_COMBO(var, category, label, tooltip, minval, maxval, defval, items) \
uniform int var \
< \
ui_type = "combo"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_items = items; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define UI_INT_I(var, label, tooltip, minval, maxval, defval) \
uniform int var \
< \
ui_type = "input"; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define CAT_INT_I(var, category, label, tooltip, minval, maxval, defval) \
uniform int var \
< \
ui_type = "input"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define UI_INT_S(var, label, tooltip, minval, maxval, defval) \
uniform int var \
< \
ui_type = "slider"; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define CAT_INT_S(var, category, label, tooltip, minval, maxval, defval) \
uniform int var \
< \
ui_type = "slider"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define UI_INT_D(var, label, tooltip, minval, maxval, defval) \
uniform int var \
< \
ui_type = "drag"; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define CAT_INT_D(var, category, label, tooltip, minval, maxval, defval) \
uniform int var \
< \
ui_type = "drag"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define UI_RADIO(var, label, tooltip, minval, maxval, defval, items) \
uniform int var \
< \
ui_type = "radio"; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_items = items; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define CAT_RADIO(var, category, label, tooltip, minval, maxval, defval, items) \
uniform int var \
< \
ui_type = "radio"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_items = items; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
// BOOL MACROS ///////////////////////////////////
#define UI_BOOL(var, label, tooltip, def) \
uniform bool var \
< \
ui_label = label; \
ui_tooltip = tooltip; \
> = def;
#define CAT_BOOL(var, category, label, tooltip, def) \
uniform bool var \
< \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
> = def;
// FLOAT MACROS //////////////////////////////////
#define UI_FLOAT_D(var, label, tooltip, minval, maxval, defval) \
uniform float var \
< \
ui_type = "drag"; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define CAT_FLOAT_D(var, category, label, tooltip, minval, maxval, defval) \
uniform float var \
< \
ui_type = "drag"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define UI_FLOAT_FULL(var, uitype, label, tooltip, uistep, minval, maxval, defval) \
uniform float var \
< \
ui_type = uitype; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_step = uistep; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define CAT_FLOAT_FULL(var, uitype, category, label, tooltip, uistep, minval, maxval, defval) \
uniform float var \
< \
ui_type = uitype; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_step = uistep; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define UI_FLOAT_I(var, label, tooltip, minval, maxval, defval) \
uniform float var \
< \
ui_type = "input"; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define CAT_FLOAT_I(var, category, label, tooltip, minval, maxval, defval) \
uniform float var \
< \
ui_type = "input"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define UI_FLOAT_S(var, label, tooltip, minval, maxval, defval) \
uniform float var \
< \
ui_type = "slider"; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define CAT_FLOAT_S(var, category, label, tooltip, minval, maxval, defval) \
uniform float var \
< \
ui_type = "slider"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
ui_min = minval; \
ui_max = maxval; \
> = defval;
#define UI_FLOAT3_D(var, label, tooltip, defval1, defval2, defval3) \
uniform float3 var \
< \
ui_type = "drag"; \
ui_label = label; \
ui_tooltip = tooltip; \
> = float3(defval1, defval2, defval3);
#define CAT_FLOAT3_D(var, category, label, tooltip, defval1, defval2, defval3) \
uniform float3 var \
< \
ui_type = "drag"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
> = float3(defval1, defval2, defval3);
#define UI_FLOAT3_I(var, label, tooltip, defval1, defval2, defval3) \
uniform float3 var \
< \
ui_type = "input"; \
ui_label = label; \
ui_tooltip = tooltip; \
> = float3(defval1, defval2, defval3);
#define CAT_FLOAT3_I(var, category, label, tooltip, defval1, defval2, defval3) \
uniform float3 var \
< \
ui_type = "input"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
> = float3(defval1, defval2, defval3);
#define UI_FLOAT3_S(var, label, tooltip, defval1, defval2, defval3) \
uniform float3 var \
< \
ui_type = "slider"; \
ui_label = label; \
ui_tooltip = tooltip; \
> = float3(defval1, defval2, defval3);
#define CAT_FLOAT3_S(var, category, label, tooltip, defval1, defval2, defval3) \
uniform float3 var \
< \
ui_type = "slider"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
> = float3(defval1, defval2, defval3);
// COLOR WIDGET MACROS ///////////////////////////
#define UI_COLOR(var, label, tooltip, defval1, defval2, defval3) \
uniform float3 var \
< \
ui_type = "color"; \
ui_label = label; \
ui_tooltip = tooltip; \
> = float3(defval1, defval2, defval3);
#define CAT_COLOR(var, category, label, tooltip, defval1, defval2, defval3) \
uniform float3 var \
< \
ui_type = "color"; \
ui_category = category; \
ui_label = label; \
ui_tooltip = tooltip; \
> = float3(defval1, defval2, defval3);
// SAMPLER MACRO /////////////////////////////////
#define SAMPLER(sname, tname) \
sampler sname \
{ \
Texture = tname; \
};
// TEXTURE MACROs ////////////////////////////////
#define TEXTURE(tname, src) \
texture tname <source=src;> \
{ \
Width = BUFFER_WIDTH; \
Height = BUFFER_HEIGHT; \
Format = RGBA8; \
};
#define TEXTURE_FULL(tname, src, width, height, fomat) \
texture tname <source=src;> \
{ \
Width = width; \
Height = height; \
Format = fomat; \
};
// TECHNIQUE MACROS //////////////////////////////
#define TECHNIQUE(tname, pass) \
technique tname \
{ \
pass \
}
#define PASS(ID, vs, ps) pass \
{ \
VertexShader = vs; \
PixelShader = ps; \
}
#define PASS_RT(ID, vs, ps, rt) pass \
{ \
VertexShader = vs; \
PixelShader = ps; \
RenderTarget = rt; \
}
Demonstration File: MacrosDemo.fx
Warning: Spoiler!
//////////////////////////////////////////////////
// RESHADE MACROS DEMONSTRATION FILE //
// //
// INSPIRED BY THE SANDVICH MAKER'S REFORGEDUI //
// AUTHOR: TREYM //
//////////////////////////////////////////////////
#include "ReShade.fxh"
#include "Macros.fxh"
// To use these macros, please follow the syntax
// shown in the comments above each UI element
// Don't forget your commas!
// More detailed information can be found within the
// Macros.fxh file itself
// UI ELEMENTS: NON-CATEGORIZED //////////////////
// Integer Slider Type: (Variable, "UI Label", "UI Tooltip", Minimum, Maximum, Default)
UI_INT_S(example_int_slider, "Example INT Slider", "Example Tooltip", 0, 100, 50)
// Integer Drag Type: (Variable, "UI Label", "UI Tooltip", Minimum, Maximum, Default)
UI_INT_D(example_int_drag, "Example INT Drag", "Example Tooltip", 0, 100, 50)
// Integer Input Type: (Variable, "UI Label", "UI Tooltip", Minimum, Maximum, Default)
UI_INT_I(example_int_input, "Example INT Input", "Example Tooltip", 0, 100, 50)
// Integer Combo Type: (Variable, "UI Label", "UI Tooltip", Minimum, Maximum, Default, "Items\0")
// This can get a bit unweildy for long item lists.
UI_COMBO(example_int_combo, "Example Combo", "Example Tooltip", 1, 5, 11, "Item 1\0Item 2\0Item 3\0Item 4\0Item 5\0")
// Integer Radio Type: (Variable, "UI Label", "UI Tooltip", Minimum, Maximum, Default, "Items\0")
// This can get a bit unweildy for long item lists.
UI_RADIO(example_int_radio, "Example Radio", "Example Tooltip", 1, 5, 1, "Item 1\0Item 2\0Item 3\0Item 4\0Item 5\0")
// Boolean: (Variable, "UI Label", "UI Tooltip", true/false)
UI_BOOL(example_bool, "Example Bool", "Example Tooltip", false)
// Float Full Control: (Variable, "ui_type", "UI Label", "UI Tooltip", "ui_step", Minimum, Maximum, Default)
// Macro with full control over all setup variables.
UI_FLOAT_FULL(example_float_full, "slider", "Example Full Control Float", "Example Tooltip", 0.1, 0.0, 1.0, 0.5)
// Float Drag Type: (Variable, "UI Label", "UI Tooltip", Minimum, Maximum, Default)
UI_FLOAT_S(example_float_slider, "Example Float Slider", "Example Tooltip", 0.0, 1.0, 0.5)
// Float Drag Type: (Variable, "UI Label", "UI Tooltip", Minimum, Maximum, Default)
UI_FLOAT_D(example_float_drag, "Example Float Drag", "Example Tooltip", 0.0, 1.0, 0.5)
// Float Input Type: (Variable, "UI Label", "UI Tooltip", Minimum, Maximum, Default)
UI_FLOAT_I(example_float_input, "Example Float Input", "Example Tooltip", 0.0, 1.0, 0.5)
// Float3 Slider Type: (Variable, "UI Label", "UI Tooltip", Value1, Value2, Value3)
UI_FLOAT3_S(example_float3_slider, "Example Float3 Slider", "Example Tooltip", 0.5, 0.5, 0.5)
// Float3 Drag Type: (Variable, "UI Label", "UI Tooltip", Value1, Value2, Value3)
UI_FLOAT3_D(example_float3_drag, "Example Float3 Drag", "Example Tooltip", 0.5, 0.5, 0.5)
// Float3 Input Type: (Variable, "UI Label", "UI Tooltip", Value1, Value2, Value3)
UI_FLOAT3_I(example_float3_input, "Example Float3 Input", "Example Tooltip", 0.5, 0.5, 0.5)
// Float3 Color Type: (Variable, "UI Label", "UI Tooltip", Red, Green, Blue)
UI_COLOR(example_color, "Example Color", "Example Tooltip", 1.0, 0.0, 0.0)
// UI ELEMENTS: CATEGORIZED //////////////////////
// Category Integer Drag Type: (Variable, "Category", "UI Label", "UI Tooltip", Minimum, Maximum, Default)
CAT_INT_S(example_int_slider_cat, "Example Category", "Example Categorized INT Slider", "Example Tooltip", 0, 10, 0)
// Category Integer Drag Type: (Variable, "Category", "UI Label", "UI Tooltip", Minimum, Maximum, Default)
CAT_INT_D(example_int_cat, "Example Category", "Example Categorized INT Drag", "Example Tooltip", 0, 10, 0)
// Category Integer Input Type: (Variable, "Category", "UI Label", "UI Tooltip", Minimum, Maximum, Default)
CAT_INT_I(example_int_input_cat, "Example Category", "Example Categorized INT Input", "Example Tooltip", 0, 100, 50)
// Category Integer Combo Type: (Variable, "Category", "UI Label", "UI Tooltip", Minimum, Maximum, Default, "Items\0")
// This can get a bit unweildy for long item lists.
CAT_COMBO(example_combo_cat, "Example Category", "Example Categorized Combo", "Example Tooltip", 1, 5, 1, "Item 1\0Item 2\0Item 3\0Item 4\0Item 5\0")
// Category Integer Combo Type: (Variable, "Category", "UI Label", "UI Tooltip", Minimum, Maximum, Default, "Items\0")
// This can get a bit unweildy for long item lists.
CAT_RADIO(example_radio_cat, "Example Category", "Example Categorized Radio", "Example Tooltip", 1, 5, 1, "Item 1\0Item 2\0Item 3\0Item 4\0Item 5\0")
// Category Boolean: (Variable, "Category", "UI Label", "UI Tooltip", true/false)
CAT_BOOL(example_bool_cat, "Example Category", "Example Categorized Bool", "Example Tooltip", false)
// Float Full Control: (Variable, "ui_type", "Category", "UI Label", "UI Tooltip", "ui_step", Minimum, Maximum, Default)
// Macro with full control over all setup variables.
CAT_FLOAT_FULL(example_float_full_cat, "slider", "Example Category", "Example Categorized Full Control Float", "Example Tooltip", 0.1, 0.0, 1.0, 0.5)
// Category Float Drag Type: (Variable, "Category", "UI Label", "UI Tooltip", Minimum, Maximum, Default)
CAT_FLOAT_S(example_float_slider_cat, "Example Category", "Example Categorized Float Slider", "Example Tooltip", 0.0, 1.0, 0.5)
// Category Float Drag Type: (Variable, "Category", "UI Label", "UI Tooltip", Minimum, Maximum, Default)
CAT_FLOAT_D(example_float_drag_cat, "Example Category", "Example Categorized Float Drag", "Example Tooltip", 0.0, 1.0, 0.5)
// Category Float Input Type: (Variable, "Category", "UI Label", "UI Tooltip", Minimum, Maximum, Default)
CAT_FLOAT_I(example_float_input_cat, "Example Category", "Example Categorized Float Input", "Example Tooltip", 0.0, 1.0, 0.5)
// Category Float3 Drag Type: (Variable, "Category", "UI Label", "UI Tooltip", Value1, Value2, Value3)
CAT_FLOAT3_S(example_float3_slider_cat, "Example Category", "Example Categorized Float3 Slider", "Example Tooltip", 0.5, 0.5, 0.5)
// Category Float3 Drag Type: (Variable, "Category", "UI Label", "UI Tooltip", Value1, Value2, Value3)
CAT_FLOAT3_D(example_float3_drag_cat, "Example Category", "Example Categorized Float3 Drag", "Example Tooltip", 0.5, 0.5, 0.5)
// Category Float3 Input Type: (Variable, "Category", "UI Label", "UI Tooltip", Value1, Value2, Value3)
CAT_FLOAT3_I(example_float3_input_cat, "Example Category", "Example Categorized Float3 Input", "Example Tooltip", 0.5, 0.5, 0.5)
// Category Float3 Color Type: (Variable, "Category", "UI Label", "UI Tooltip", Red, Green, Blue)
CAT_COLOR(example_color_cat, "Example Category", "Example Categorized Color", "Example Tooltip", 1.0, 0.0, 0.0)
// TEXTURES AND SAMPLERS /////////////////////////
/*
// Texture Macro: (TextureName, "TexturePath")
TEXTURE(Texture1, "Texture/Path/texture.png")
// Texture Full Macro: (TextureName, "TexturePath", Width, Height, Format)
TEXTURE_FULL(Texture2, "Texture/Path/texture.png", BUFFER_WIDTH, BUFFER_HEIGHT, RGBA8)
Sampler Macro: (SamplerName, TextureName)
SAMPLER(Sampler1, Texture1)
SAMPLER(Sampler2, Texture2)
*/
// PIXEL SHADER //////////////////////////////////
float4 PS_UIDemo(float4 position : SV_Position, float2 txcoord : TexCoord) : SV_Target {
return tex2D(ReShade::BackBuffer, txcoord);
}
// TECHNIQUE /////////////////////////////////////
// Technique macro: (TechniqueName, PASS(PassID, VertexShader, PixelShader))
TECHNIQUE(UIDemo, PASS(Pass1, PostProcessVS, PS_UIDemo))
/*
// Single pass technique with RenderTarget:
TECHNIQUE(UIDemo, PASS_RT(Pass1, PostProcessVS, PS_UIDemo, RenderTarget))
// Multi-pass Example:
TECHNIQUE(UIDemo,
PASS(Pass1, PostProcessVS, PS_UIDemo)
PASS(Pass2, PostProcessVS, PS_UIDemo)
PASS(Pass3, PostProcessVS, PS_UIDemo)
PASS(Pass4, PostProcessVS, PS_UIDemo)
)
// Multi-pass RenderTarget Example:
TECHNIQUE(UIDemo,
PASS_RT(Pass1, PostProcessVS, PS_UIDemo, RenderTarget1)
PASS(Pass2, PostProcessVS, PS_UIDemo)
PASS_RT(Pass3, PostProcessVS, PS_UIDemo, RenderTarget2)
PASS(Pass4, PostProcessVS, PS_UIDemo)
)
*/
UPDATED 12/15/2018
Now fully supports ReShade 4
(some macro names have changed!)
Last edit: 4 years 10 months ago by TreyM.
The following user(s) said Thank You: OtisInf, The0roboroSpace, Masterfireheart
Please Log in or Create an account to join the conversation.
- TreyM
- Topic Author
Less
More
5 years 8 months ago - 5 years 4 months ago #2
by TreyM
Replied by TreyM on topic UI and Technique Macros
Some examples:
Integer "slider" type:
Boolean:
Color Widget (float3):
Texture:
Sampler:
Creating a single pass technique:
Creating a single pass technique with RenderTarget:
Creating a multi-pass technique:
Creating a multi-pass technique with multiple RenderTargets:
Integer "slider" type:
UI_INT_S(example_int_slider, "Example INT Slider", "Example Tooltip", 0, 100, 50)
Boolean:
UI_BOOL(example_bool, "Example Bool", "Example Tooltip", false)
Color Widget (float3):
UI_COLOR(example_color, "Example Color", "Example Tooltip", 1.0, 0.0, 0.0)
Texture:
TEXTURE(Tex1, "example.jpg")
Sampler:
SAMPLER(sExample, Tex1)
Creating a single pass technique:
TECHNIQUE(ExampleTechnique, PASS(ExamplePass, VS_Example, PS_Example))
Creating a single pass technique with RenderTarget:
TECHNIQUE(ExampleTechnique, PASS_RT(ExamplePass, VS_Example, PS_Example, ExampleRenderTarget))
Creating a multi-pass technique:
TECHNIQUE(ExampleTechnique,
PASS (ExamplePass1, VS_Example, PS_Example1)
PASS (ExamplePass2, VS_Example, PS_Example2)
PASS (ExamplePass3, VS_Example, PS_Example3)
PASS (ExamplePass4, VS_Example, PS_Example4)
)
Creating a multi-pass technique with multiple RenderTargets:
TECHNIQUE(ExampleTechnique,
PASS_RT (ExamplePass1, VS_Example, PS_Example1, ExampleRenderTarget1)
PASS (ExamplePass2, VS_Example, PS_Example2)
PASS_RT (ExamplePass3, VS_Example, PS_Example3, ExampleRenderTarget2)
PASS (ExamplePass4, VS_Example, PS_Example4)
)
Last edit: 5 years 4 months ago by TreyM.
Please Log in or Create an account to join the conversation.
- TreyM
- Topic Author
Less
More
5 years 8 months ago - 5 years 4 months ago #3
by TreyM
Replied by TreyM on topic UI and Technique Macros
Reserved.
Last edit: 5 years 4 months ago by TreyM.
Please Log in or Create an account to join the conversation.
- crosire
Less
More
Nice! I'd suggest for this to be added to the shader repository, so it's automatically installed with ReShade.
Please Log in or Create an account to join the conversation.
- TreyM
- Topic Author
Less
More
5 years 8 months ago - 5 years 8 months ago #5
by TreyM
Replied by TreyM on topic UI and Technique Macros
I will for sure. Just want to make sure it's really easy to use and is as feature complete as my skill level will allow.
Last edit: 5 years 8 months ago by TreyM.
Please Log in or Create an account to join the conversation.
- TreyM
- Topic Author
Less
More
I'm currently updating these to fully support some of the new ReShade 4 features and I'll send a pull request.
The following user(s) said Thank You: Masterfireheart, seri14
Please Log in or Create an account to join the conversation.
- TreyM
- Topic Author
Less
More
The Macros are now fully supporting the new UI features in ReShade 4 as of December 15, 2018. Crosire, sending Git pull request now.
The following user(s) said Thank You: crosire
Please Log in or Create an account to join the conversation.