float3 CalculateBezier(float3 t, float y1, float y2)
{
float3 u = 1.0f - t;
float3 tt = t * t;
float3 uu = u * u;
float3 ttt = tt * t;
float3 uut3 = 3 * uu * t;
float3 ttu3 = 3 * tt * u;
float3 p = uut3 * y1;
p += ttu3 * y2;
p += ttt;
return p;
}
float3 CustomPass(float4 position : SV_Position, float2 texcoord : TEXCOORD0) : SV_Target
{
float3 colorInput = tex2D(s0, texcoord).rgb;
return CalculateBezier(pow(abs(colorInput + 0.05), 1.25), 0.25f, 0.75f);
}
After thinking about it for a while (after looking at it, thinking that it should be easily converted to parallel), I have done it. The following code is functionally the same as the last post's.
0 Comments
I've been playing a lot of Sekiro recently, relative to other games anyway. I noticed at the start of the game things are quite hazy and washed out. This is an artistic choice, and the tone (the colour tone, as well as that of the story) of the game changes as one progresses through the game.
However, I am a fan of bright colours, and I like to see some definition in my games, so I thought I'd make some changes. I was inspired by watching a mod of Dark Souls that turned the game's textures into Lisa Frank style paintings using deep learning, I was also inspired by this article I read recently on tone-mapping: https://64.github.io/tonemapping/ Of the effects on there I preferred the Uncharted 2 tone map. I implemented it in Sekiro, but since that image is already clamped between 0 and 1 the results weren't pleasing. So I went back to my old friend, Bézier curves. I might as well post the code at this point.
Before:
After:
The difference is quite subtle in this one. It is more obvious when you're playing the game. Here is one image subtracted from the other:
Here's the difference between the images:
In other news, I have a job now, so I won't be posting here as often. It will be more of the same. Here are some projects I've got planned:
|
AuthorHi there, the name's Matthew Jenkinson and I'm currently working at Firesprite. In my spare time I work on programming projects like you see here. Archives
March 2021
CategoriesLinks to each effect in order:
|