Last active
March 1, 2017 23:31
-
-
Save enue/c2130a3653871d6f9f42212485311fd1 to your computer and use it in GitHub Desktop.
[Unity]陽炎エフェクト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
↓が必要
https://github.com/keijiro/NoiseShader/blob/master/Assets/HLSL/ClassicNoise3D.cginc