Create a gist now

Instantly share code, notes, and snippets.

[Unity]陽炎エフェクト
using System;
using UnityEngine;
using UnityStandardAssets.ImageEffects;
namespace TSKT
{
[AddComponentMenu("TSKT/Image Effects/HeatShimmer")]
[RequireComponent(typeof(Camera))]
public class HeatShimmer : ImageEffectBase
{
void OnRenderImage(RenderTexture source, RenderTexture destination)
{
Graphics.Blit(source, destination, material);
}
}
}
Shader "TSKT/Hidden/HeatShimmer"
{
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#include "UnityCG.cginc"
#include "ClassicNoise3D.cginc"
uniform sampler2D _MainTex;
fixed4 frag (v2f_img i) : SV_Target
{
float noise = cnoise(float3(i.uv.x * 10, i.uv.y * 10, _Time.y));
fixed2 uv = i.uv;
uv.y += noise * 0.01;
return tex2D(_MainTex, uv);
}
ENDCG
}
}
Fallback off
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment