random bits of HLSL codes & functions

general download section
Post Reply
  • Author
  • Message
Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

random bits of HLSL codes & functions

==========tonemappers=============
pure functions, support both dx9 and dx11
  • TM_Device
**check dx9/dx11 example file and Overview.txt for implementation details.
tonemappers.zip
bugfixed: Jan 23, 2020
(11.5 KiB) Downloaded 349 times
Last edited by kingeric1992 on 23 Jan 2020, 12:04, edited 1 time in total.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
*blah-blah-blah maniac*
Posts: 552
Joined: 11 Apr 2012, 03:24

Re: random bits of HLSL codes & functions

Can this be implemented into reshade? Because I don't understand any of it, but I want it! Can you help me to put it into my ENB preset? Here is what I use:

https://drive.google.com/open?id=0B7vo8 ... jVpdlB5RU0
_________________
i5-6600k -- Nvidia GTX 970 -- 16Gb ram @3200mhz

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: random bits of HLSL codes & functions

the function are of the form:

Code: Select all

    float3 result = TM_somefunction( linear_color_in);
or

Code: Select all

    float3 result = TM_somefunction( linear_color_in, params_in);
and for HLSL, you just need to include them in the start of the file. (they are independent to each others)

Code: Select all

#include "TM_PiecewiseFilmic.fxh"
#include "TM_Uncharted2.fxh"
#include "TM_FilmicALU.fxh"
#include "TM_VDR16.fxh"
#include "TM_FilmicACES.fxh"
#include "TM_Lin2Log.fxh"
#include "TM_Device.fxh"
as shown in the included example.

Reshade doesn't have struct initializer (no global struct const), so the function need to have various change on input setup.
ie. use overload functions instead of assigning initial value,
additional param constructor to fill in the data in shader file.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
*blah-blah-blah maniac*
Posts: 552
Joined: 11 Apr 2012, 03:24

Re: random bits of HLSL codes & functions

Will this include a GUI?
_________________
i5-6600k -- Nvidia GTX 970 -- 16Gb ram @3200mhz

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: random bits of HLSL codes & functions

No, easier to manage user preset this way.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*blah-blah-blah maniac*
Posts: 530
Joined: 30 Jan 2012, 13:18

Re: random bits of HLSL codes & functions

You sure love structs, don't you :p
I got the tonemapper from the frostbite engine somewhere in case you want it. It's rather... intense.

@evok99: You won't need this in ReShade, tonemapper convert your HDR input data to LDR output your screen can display (the game color data before tonemapping is often multiple times brighter than FFFFFF white). ReShade's input is already LDR so tonemapping just makes it darker. Tonemapping it a second time and up scaling it with levels just reduces color range and is similar to a color grading filter.

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: random bits of HLSL codes & functions

sure.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*blah-blah-blah maniac*
Posts: 530
Joined: 30 Jan 2012, 13:18

Re: random bits of HLSL codes & functions

Hm, can't find it anywhere. I think I found a bug in the VDR16 shader: the whitepoint value isn't used anywhere and the shader returns really strange colors. When I replace "float white = pow(M, i.contrast);" with "float white = pow(i.white, i.contrast);" the colors look natural so I assume that's how it's supposed to be.
Post Reply