Marty McFly Tonemaps ported to v3.x

  • XIIICaesar
  • Topic Author
More
8 years 1 month ago - 8 years 1 month ago #1 by XIIICaesar Marty McFly Tonemaps ported to v3.x was created by XIIICaesar
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: 8 years 1 month ago by XIIICaesar.

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 1 month ago #2 by crosire Replied by crosire on topic HPD Tonemap ported to v3.x
Cleaned up the code and removed the uncessary parts. Hope you don't mind =).

Please Log in or Create an account to join the conversation.

  • XIIICaesar
  • Topic Author
More
8 years 1 month ago - 8 years 1 month ago #3 by XIIICaesar Replied by XIIICaesar on topic HPD Tonemap ported to v3.x

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.

[strike]I don't need the LumCoeff parts do I crosire?[/strike] 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: 8 years 1 month ago by XIIICaesar.

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 1 month ago #4 by crosire Replied by crosire on topic HPD Tonemap ported to v3.x
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.

Please Log in or Create an account to join the conversation.

  • XIIICaesar
  • Topic Author
More
8 years 1 month ago - 8 years 1 month ago #5 by XIIICaesar Replied by XIIICaesar on topic HPD Tonemap ported to v3.x
/**
 * 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: 8 years 1 month ago by XIIICaesar.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.