Heat Distortion/Heat Blur with depth
- timberlake90
- Topic Author
Less
More
4 years 4 months ago - 4 years 4 months ago #1
by timberlake90
Heat Distortion/Heat Blur with depth was created by timberlake90
I was wondering if it'd be possible to create this blur effect by merging an effect with a depth effect?
Yesterday I started searching the forum for "heat blur" shaders that I can add into a game called "X-plane 11". I make videos that are more focused on the visual aspect of whatever program/topic I'm covering. Right now I'm trying to get the most out of xplane. I record in 4K 60fps and there's a lot of boring and plain emptiness in the footage that I feel can be complimented/enhanced by something you would see in real life. So right now im trying to add heat blur since haze and the other effects that can be achieved with the depth detection , actually take away from the realism in some scenarios and hide the details this software is capable of.
When I searched the forums I found this topic. People were sharing ported shaders from v2 to v3. Someone at the bottom of the first page shared a heat blur effect that works very well.
I installed it and tried it out.
I was able to create the effect I wanted but it covers the entire screen. I was wondering if it'd be possible to apply this blur and all of its customizability onto an effect such as adaptive fog or depth haze which would give it the ability to be put in the background and not be applied to objects in the foreground.
These are the kinds of shots/angles I want to apply the effect onto.
The background is very boring and if there is that nice smooth shimmer moving it'll add a little more realism on top of everything else im able to do in the sim. it'll also be very visually
appealing to anyone with a high resolution display running footage or gameplay at a high frame rate.
*EDIT*
just for extra clarification, this is a real life video example of the effect. Focus on the blur created naturally in the distance, not from the heat created by the engines.
In one of my recent videos I used plain depth of field and people were offended by it. I want the visuals to be realistic, something that's 500 feet away from you shouldn't look as if it's right next to you. When the videos are done and everything is full resolution and fps a lot of it looks toyish.
Yesterday I started searching the forum for "heat blur" shaders that I can add into a game called "X-plane 11". I make videos that are more focused on the visual aspect of whatever program/topic I'm covering. Right now I'm trying to get the most out of xplane. I record in 4K 60fps and there's a lot of boring and plain emptiness in the footage that I feel can be complimented/enhanced by something you would see in real life. So right now im trying to add heat blur since haze and the other effects that can be achieved with the depth detection , actually take away from the realism in some scenarios and hide the details this software is capable of.
When I searched the forums I found this topic. People were sharing ported shaders from v2 to v3. Someone at the bottom of the first page shared a heat blur effect that works very well.
Warning: Spoiler!
/**
* Heat Haze
* by Marty McFly
*
* Ported from ReShade Framework
* to ReShade 3.0+ by mbah.primbon
*
*/
//
GUI Settings
uniform bool bHeatHazeDebug <
ui_label = "Heat Haze Debug View";
ui_tooltip = "Enables raw texture output for debugging purposes. Useful for texture experiments.";
> = false;
uniform float fHeatHazeSpeed <
ui_type = "drag";
ui_min = 0.00; ui_max = 10.00;
ui_label = "Heat Haze Speed";
ui_tooltip = "Speed of heathaze waves";
> = 1.80;
uniform float fHeatHazeOffset <
ui_type = "drag";
ui_min = 0.50; ui_max = 20.00; ui_step = 0.1;
ui_label = "Heat Haze Offset";
ui_tooltip = "Amount of image distortion caused by heathaze effect";
> = 4.40;
uniform float fHeatHazeTextureScale <
ui_type = "drag";
ui_min = 0.50; ui_max = 8.00; ui_step = 0.1;
ui_label = "Heat Haze Texture Scale";
ui_tooltip = "Scale of source texture, affecting the tile size. Use Heathaze debug effect for better visible effect.";
> = 1.00;
uniform float fHeatHazeChromaAmount <
ui_type = "drag";
ui_min = 0.00; ui_max = 2.00; ui_step = 0.01;
ui_label = "Heat Haze Chroma Amount";
ui_tooltip = "Amount of color shift caused by heat haze. Linearly scales with fHeatHazeOffset.";
> = 0.3;
//
#include "ReShade.fxh"
uniform float Timer < source = "timer"; >;
// Textures and samplers
texture texBump <source = "haze.png";> {Width = 512; Height = 512; Format = RGBA8;};
sampler samplerBump {Texture = texBump; MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = LINEAR; AddressU = Repeat; AddressV = Repeat;};
// Pixel shaders
void PS_HeatHaze(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float3 color : SV_Target)
{
float3 heatnormal = tex2Dlod(samplerBump, float4(texcoord.xy*fHeatHazeTextureScale+float2(0.0,Timer.x*0.0001*fHeatHazeSpeed),0,0)).rgb - 0.5;
float2 heatoffset = normalize(heatnormal.xy) * pow(length(heatnormal.xy), 0.5);
float3 heathazecolor = 0;
heathazecolor.y = tex2D(ReShade::BackBuffer, texcoord.xy + heatoffset.xy * 0.001 * fHeatHazeOffset).y;
heathazecolor.x = tex2D(ReShade::BackBuffer, texcoord.xy + heatoffset.xy * 0.001 * fHeatHazeOffset * (1.0+fHeatHazeChromaAmount)).x;
heathazecolor.z = tex2D(ReShade::BackBuffer, texcoord.xy + heatoffset.xy * 0.001 * fHeatHazeOffset * (1.0-fHeatHazeChromaAmount)).z;
color.xyz = heathazecolor;
if(bHeatHazeDebug) color.xyz = heatnormal.xyz+0.5;
}
// Rendering passes
technique HeatHaze
{
pass HeatHazeBEGINNN
{
VertexShader = PostProcessVS;
PixelShader = PS_HeatHaze;
}
}
* Heat Haze
* by Marty McFly
*
* Ported from ReShade Framework
* to ReShade 3.0+ by mbah.primbon
*
*/
//
GUI Settings
uniform bool bHeatHazeDebug <
ui_label = "Heat Haze Debug View";
ui_tooltip = "Enables raw texture output for debugging purposes. Useful for texture experiments.";
> = false;
uniform float fHeatHazeSpeed <
ui_type = "drag";
ui_min = 0.00; ui_max = 10.00;
ui_label = "Heat Haze Speed";
ui_tooltip = "Speed of heathaze waves";
> = 1.80;
uniform float fHeatHazeOffset <
ui_type = "drag";
ui_min = 0.50; ui_max = 20.00; ui_step = 0.1;
ui_label = "Heat Haze Offset";
ui_tooltip = "Amount of image distortion caused by heathaze effect";
> = 4.40;
uniform float fHeatHazeTextureScale <
ui_type = "drag";
ui_min = 0.50; ui_max = 8.00; ui_step = 0.1;
ui_label = "Heat Haze Texture Scale";
ui_tooltip = "Scale of source texture, affecting the tile size. Use Heathaze debug effect for better visible effect.";
> = 1.00;
uniform float fHeatHazeChromaAmount <
ui_type = "drag";
ui_min = 0.00; ui_max = 2.00; ui_step = 0.01;
ui_label = "Heat Haze Chroma Amount";
ui_tooltip = "Amount of color shift caused by heat haze. Linearly scales with fHeatHazeOffset.";
> = 0.3;
//
#include "ReShade.fxh"
uniform float Timer < source = "timer"; >;
// Textures and samplers
texture texBump <source = "haze.png";> {Width = 512; Height = 512; Format = RGBA8;};
sampler samplerBump {Texture = texBump; MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = LINEAR; AddressU = Repeat; AddressV = Repeat;};
// Pixel shaders
void PS_HeatHaze(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float3 color : SV_Target)
{
float3 heatnormal = tex2Dlod(samplerBump, float4(texcoord.xy*fHeatHazeTextureScale+float2(0.0,Timer.x*0.0001*fHeatHazeSpeed),0,0)).rgb - 0.5;
float2 heatoffset = normalize(heatnormal.xy) * pow(length(heatnormal.xy), 0.5);
float3 heathazecolor = 0;
heathazecolor.y = tex2D(ReShade::BackBuffer, texcoord.xy + heatoffset.xy * 0.001 * fHeatHazeOffset).y;
heathazecolor.x = tex2D(ReShade::BackBuffer, texcoord.xy + heatoffset.xy * 0.001 * fHeatHazeOffset * (1.0+fHeatHazeChromaAmount)).x;
heathazecolor.z = tex2D(ReShade::BackBuffer, texcoord.xy + heatoffset.xy * 0.001 * fHeatHazeOffset * (1.0-fHeatHazeChromaAmount)).z;
color.xyz = heathazecolor;
if(bHeatHazeDebug) color.xyz = heatnormal.xyz+0.5;
}
// Rendering passes
technique HeatHaze
{
pass HeatHazeBEGINNN
{
VertexShader = PostProcessVS;
PixelShader = PS_HeatHaze;
}
}
I installed it and tried it out.
I was able to create the effect I wanted but it covers the entire screen. I was wondering if it'd be possible to apply this blur and all of its customizability onto an effect such as adaptive fog or depth haze which would give it the ability to be put in the background and not be applied to objects in the foreground.
These are the kinds of shots/angles I want to apply the effect onto.
The background is very boring and if there is that nice smooth shimmer moving it'll add a little more realism on top of everything else im able to do in the sim. it'll also be very visually
appealing to anyone with a high resolution display running footage or gameplay at a high frame rate.
*EDIT*
just for extra clarification, this is a real life video example of the effect. Focus on the blur created naturally in the distance, not from the heat created by the engines.
In one of my recent videos I used plain depth of field and people were offended by it. I want the visuals to be realistic, something that's 500 feet away from you shouldn't look as if it's right next to you. When the videos are done and everything is full resolution and fps a lot of it looks toyish.
Last edit: 4 years 4 months ago by timberlake90. Reason: first attempt to add video link failed
Please Log in or Create an account to join the conversation.
4 years 4 months ago #2
by matsilagi
Replied by matsilagi on topic Heat Distortion/Heat Blur with depth
Wish granted.
Warning: Spoiler!
/**
* Heat Haze
* by Marty McFly
*
* Ported from ReShade Framework
* to ReShade 3.0+ by mbah.primbon
*
*/
//-------------------- GUI Settings ----------------------
uniform bool bHeatHazeDebug <
ui_label = "Heat Haze Debug View";
ui_tooltip = "Enables raw texture output for debugging purposes. Useful for texture experiments.";
> = false;
uniform bool bHeatHazeDepth <
ui_label = "Heat Haze Depth";
ui_tooltip = "Applies the Heat Haze on the Depth Buffer";
> = false;
uniform float fHeatHazeDistance <
ui_type = "drag";
ui_min = 0.000; ui_max = 1.00;
ui_step = 0.001;
ui_label = "Heat Haze Distance";
ui_tooltip = "Distance the image gets distorted by the Heat Haze\n When using depth buffer.";
> = 0.5;
uniform float fHeatHazeSpeed <
ui_type = "drag";
ui_min = 0.00; ui_max = 10.00;
ui_label = "Heat Haze Speed";
ui_tooltip = "Speed of heathaze waves";
> = 1.80;
uniform float fHeatHazeOffset <
ui_type = "drag";
ui_min = 0.50; ui_max = 20.00; ui_step = 0.1;
ui_label = "Heat Haze Offset";
ui_tooltip = "Amount of image distortion caused by heathaze effect";
> = 4.40;
uniform float fHeatHazeTextureScale <
ui_type = "drag";
ui_min = 0.50; ui_max = 8.00; ui_step = 0.1;
ui_label = "Heat Haze Texture Scale";
ui_tooltip = "Scale of source texture, affecting the tile size. Use Heathaze debug effect for better visible effect.";
> = 1.00;
uniform float fHeatHazeChromaAmount <
ui_type = "drag";
ui_min = 0.00; ui_max = 2.00; ui_step = 0.01;
ui_label = "Heat Haze Chroma Amount";
ui_tooltip = "Amount of color shift caused by heat haze. Linearly scales with fHeatHazeOffset.";
> = 0.3;
//------------------------------------------------------------------------
#include "ReShade.fxh"
uniform float Timer < source = "timer"; >;
// Textures and samplers
texture texBump <source = "haze.png";> {Width = 512; Height = 512; Format = RGBA8;};
sampler samplerBump {Texture = texBump; MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = LINEAR; AddressU = Repeat; AddressV = Repeat;};
// Pixel shaders
void PS_HeatHaze(float4 vpos : SV_Position, float2 texcoord : TEXCOORD, out float3 color : SV_Target)
{
float3 col = tex2D(ReShade::BackBuffer,texcoord).rgb;
float3 heatnormal = tex2Dlod(samplerBump, float4(texcoord.xy*fHeatHazeTextureScale+float2(0.0,Timer.x*0.0001*fHeatHazeSpeed),0,0)).rgb - 0.5;
float2 heatoffset = normalize(heatnormal.xy) * pow(length(heatnormal.xy), 0.5);
float3 heathazecolor = 0;
heathazecolor.y = tex2D(ReShade::BackBuffer, texcoord.xy + heatoffset.xy * 0.001 * fHeatHazeOffset).y;
heathazecolor.x = tex2D(ReShade::BackBuffer, texcoord.xy + heatoffset.xy * 0.001 * fHeatHazeOffset * (1.0+fHeatHazeChromaAmount)).x;
heathazecolor.z = tex2D(ReShade::BackBuffer, texcoord.xy + heatoffset.xy * 0.001 * fHeatHazeOffset * (1.0-fHeatHazeChromaAmount)).z;
if(bHeatHazeDebug) heathazecolor.xyz = heatnormal.xyz+0.5;
if(bHeatHazeDepth){
float depth = ReShade::GetLinearizedDepth(texcoord);
color.xyz = depth >= fHeatHazeDistance ? heathazecolor : col;
} else {
color.xyz = heathazecolor;
}
}
// Rendering passes
technique HeatHaze
{
pass HeatHazeBEGINNN
{
VertexShader = PostProcessVS;
PixelShader = PS_HeatHaze;
}
}
The following user(s) said Thank You: acknowledge, ymt
Please Log in or Create an account to join the conversation.
- timberlake90
- Topic Author
Less
More
4 years 4 months ago #3
by timberlake90
Replied by timberlake90 on topic Heat Distortion/Heat Blur with depth
OH MY GOODNESS I can't express how much i love you thank you!
Please Log in or Create an account to join the conversation.
- Battleseekuh
Less
More
2 years 1 month ago #4
by Battleseekuh
Replied by Battleseekuh on topic Heat Distortion/Heat Blur with depth
where do i have to put the script?
Please Log in or Create an account to join the conversation.
- macron
Less
More
Cool script! But where can I find the original "haze.png"? The script asks for it.
Please Log in or Create an account to join the conversation.