Welcome, Guest.
Username: Password: Remember me

TOPIC: Marty McFly Tonemaps ported to v3.x

Marty McFly Tonemaps ported to v3.x 1 year 6 months ago #1

I've successfully ported the HPD filmic game tonemap by Marty McFly to ReShade v3.x. I'm also going to pos tthis in the port request thread as well for people.
/**
 * Haarm-Peter Duiker (HPD) Tonemap
 * Original by Marty McFly
 * Ported by XIIICaesar
 */

#include "ReShade.fxh"

float3 HaarmPeterDuikerPass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
	float3 x = tex2D(ReShade::BackBuffer, texcoord).rgb;
	x = max((float3)0.0f, x - 0.004f);
    	return pow(abs((x * (6.2f * x + 0.5f)) / (x * (6.2f * x + 1.7f) + 0.06)), 2.2f);
}

technique HPD
{
	pass
	{
		VertexShader = PostProcessVS;
		PixelShader = HaarmPeterDuikerPass;
	}
}
Last Edit: 1 year 6 months ago by XIIICaesar.
The administrator has disabled public write access.

HPD Tonemap ported to v3.x 1 year 6 months ago #2

Cleaned up the code and removed the uncessary parts. Hope you don't mind =).
Cheers, crosire =)
The administrator has disabled public write access.

HPD Tonemap ported to v3.x 1 year 6 months ago #3

crosire wrote:
Cleaned up the code and removed the uncessary parts. Hope you don't mind =).
Not at all dude. Never did shaders before. Just used ReShade and a lot of graphics editing with GIMP/PS :lol: . I'm actually surprised I got them working. Insomnia's idea over in the port request thread was tedious to do but worked. Also, below is FILMICCURVE.

I don't need the LumCoeff parts do I crosire? Nevermind. I cross-referenced them and figured it out. I gotta hit the bed but for those interested I know people's been asking about the other tonemaps Marty did as well in the request thread. I could attempt to port them later this evening sleep and everything I've planned for the day. I know Skyrim & Spherical were 2 in particular. No promises though. Oh, also, crosire do I need to commit these or whatever its called to your github or? Never done shaders so don't know how you do it...
Last Edit: 1 year 6 months ago by XIIICaesar.
The administrator has disabled public write access.

HPD Tonemap ported to v3.x 1 year 6 months ago #4

The LumCoeff define isn't used anywhere in the code, so nope, not needed.
Also, it's better to use the "code" BBCode rather than "spoiler" so whitespaces are preserved.
Cheers, crosire =)
The administrator has disabled public write access.

HPD Tonemap ported to v3.x 1 year 6 months ago #5

/**
 * Filmic Curve (Unchartered 2) Tonemap
 * Original by Marty McFly
 * Ported by XIIICaesar
 */

#include "ReShade.fxh"

float3 FilmicCurvePass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
	float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb;
	
	float3 x = color.rgb;
	//float x = color;
	
	const float A = 0.665f;
	const float B = 0.09f;
	const float C = 0.004f;
	const float D = 0.445f;
	const float E = 0.26f;
	const float F = 0.025f;
	const float G = 0.16f;//0.145f;
	const float H = 1.1844f;//1.15f;

    // gamma space or not?
	return (((x*(A*x+B)+C)/(x*(D*x+E)+F))-G) / H;
	
	return color;
}

technique FilmicCurve
{
	pass
	{
		VertexShader = PostProcessVS;
		PixelShader = FilmicCurvePass;
	}
}
I tried editing the last post to code after cleaning it up but couldn't figure it out :blink: . Sorry for multiposts.
Last Edit: 1 year 6 months ago by XIIICaesar.
The administrator has disabled public write access.