Created
February 3, 2018 22:42
-
-
Save jrsa/60e983567454c6141578a315cc457589 to your computer and use it in GitHub Desktop.
color shifting displacement feedback process implemented as a unity3d postprocessing shader
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 "Jars/PostEffect" | |
{ | |
HLSLINCLUDE | |
#include "../PostProcessing/Shaders/StdLib.hlsl" | |
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex); | |
float _Blend; | |
float4 Frag(VaryingsDefault i) : SV_Target | |
{ | |
float4 prelook = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord); | |
float4 color2 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord + ((prelook.rb - 0.5) / 200.0)); | |
float4 shiftAmount = float4(0.005, 0.01, 0.015, 0.0); | |
return (color2 + shiftAmount) % 1.0;; | |
} | |
ENDHLSL | |
SubShader | |
{ | |
Cull Off ZWrite Off ZTest Always | |
Pass | |
{ | |
HLSLPROGRAM | |
#pragma vertex VertDefault | |
#pragma fragment Frag | |
ENDHLSL | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment