Last active
March 28, 2018 23:05
-
-
Save Andersama/bf318df1df8beb60880aa0b8b8beff61 to your computer and use it in GitHub Desktop.
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
uniform float4x4 ViewProj; | |
uniform texture2d image; | |
uniform texture2d image_1; | |
uniform texture2d image_2; | |
uniform texture2d image_3; | |
uniform texture2d image_4; | |
uniform texture2d image_5; | |
uniform texture2d image_6; | |
uniform texture2d image_7; | |
uniform float2 elapsed_time; | |
uniform float2 uv_offset; | |
uniform float2 uv_scale; | |
uniform float2 uv_pixel_interval; | |
sampler_state textureSampler { | |
Filter = Linear; | |
AddressU = Border; | |
AddressV = Border; | |
BorderColor = 00000000; | |
}; | |
struct VertData { | |
float4 pos : POSITION; | |
float2 uv : TEXCOORD0; | |
}; | |
struct ColorData { | |
float4 color_0 : SV_Target0; | |
float4 color_1 : SV_Target1; | |
float4 color_2 : SV_Target2; | |
float4 color_3 : SV_Target3; | |
float4 color_4 : SV_Target4; | |
float4 color_5 : SV_Target5; | |
float4 color_6 : SV_Target6; | |
float4 color_7 : SV_Target7; | |
}; | |
VertData mainTransform(VertData v_in) | |
{ | |
VertData vert_out; | |
vert_out.pos = mul(float4(v_in.pos.xyz, 1.0), ViewProj); | |
vert_out.uv = v_in.uv * uv_scale + uv_offset; | |
return vert_out; | |
} | |
ColorData mainImage(VertData v_in) //TARGET | |
{ | |
ColorData color_out; | |
color_out.color_7 = image.Sample(textureSampler, v_in.uv); | |
color_out.color_6 = image_1.Sample(textureSampler, v_in.uv); | |
color_out.color_5 = image_2.Sample(textureSampler, v_in.uv); | |
color_out.color_4 = image_3.Sample(textureSampler, v_in.uv); | |
color_out.color_3 = image_4.Sample(textureSampler, v_in.uv); | |
color_out.color_2 = image_5.Sample(textureSampler, v_in.uv); | |
color_out.color_1 = image_6.Sample(textureSampler, v_in.uv); | |
color_out.color_0 = (color_out.color_1 + color_out.color_2 + color_out.color_3 + color_out.color_4 + | |
color_out.color_5 + color_out.color_6 + color_out.color_7) / 7.0; | |
return color_out; | |
} | |
technique Draw | |
{ | |
pass p0 | |
{ | |
vertex_shader = mainTransform(v_in); | |
pixel_shader = mainImage(v_in); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment