Welcome, Guest.
Username: Password: Remember me

TOPIC: UI, Texture, Sampler, and Technique Macros

UI, Texture, Sampler, and Technique Macros 11 months 1 week ago #1

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:
#include "Macros.fxh"

The demonstration file below shows the proper syntax to use the macros.

Macros File: Macros.fxh
Warning: Spoiler! [ Click to expand ]


Demonstration File: MacrosDemo.fx
Warning: Spoiler! [ Click to expand ]


UPDATED 12/15/2018

Now fully supports ReShade 4
(some macro names have changed!)
Last Edit: 1 month 1 week ago by TreyM.
The administrator has disabled public write access.
The following user(s) said Thank You: OtisInf, The0roboroSpace, Masterfireheart

UI and Technique Macros 11 months 1 week ago #2

Some examples:

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: 7 months 2 days ago by TreyM.
The administrator has disabled public write access.

UI and Technique Macros 11 months 1 week ago #3

Reserved.
Last Edit: 7 months 3 days ago by TreyM.
The administrator has disabled public write access.

UI and Technique Macros 11 months 1 week ago #4

Nice! I'd suggest for this to be added to the shader repository, so it's automatically installed with ReShade.
Cheers, crosire =)
The administrator has disabled public write access.

UI and Technique Macros 11 months 1 week ago #5

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: 11 months 1 week ago by TreyM.
The administrator has disabled public write access.

UI and Technique Macros 7 months 2 weeks ago #6

I'm currently updating these to fully support some of the new ReShade 4 features and I'll send a pull request.
The administrator has disabled public write access.
The following user(s) said Thank You: Masterfireheart, seri14

UI and Technique Macros 7 months 3 days ago #7

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 administrator has disabled public write access.
The following user(s) said Thank You: crosire