X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;ds=sidebyside;f=dev4%2FShader%2FGrating.fx;fp=dev4%2FShader%2FGrating.fx;h=f3ddd05699ee45214f2b2b9defc0338a0e1826aa;hb=08bcb090f6a3e6ee38c712571f24b57a4dd32fb4;hp=0000000000000000000000000000000000000000;hpb=7fe25aa821826f09903fb14def74d6b0376e3b5a;p=psychlops%2Fsilverlight.git
diff --git a/dev4/Shader/Grating.fx b/dev4/Shader/Grating.fx
new file mode 100644
index 0000000..f3ddd05
--- /dev/null
+++ b/dev4/Shader/Grating.fx
@@ -0,0 +1,54 @@
+/// Amplitude of Grating
+/// 0
+/// 1
+/// 1
+float contrast : register(C1);
+
+/// Phase of Grating
+/// 0
+/// 100
+/// 100
+float frequency: register(C2);
+
+/// Phase of Grating
+/// 0
+/// 6.283184
+/// 0
+float phase: register(C3);
+
+/// Orientation of Grating
+/// 0
+/// 6.283184
+/// 0
+float orientation: register(C4);
+
+/// Width of envelope
+/// 1
+/// 1024
+/// 32
+float SizeH : register(C5);
+
+/// Height of envelope
+/// 1
+/// 1024
+/// 32
+float SizeV : register(C6);
+
+float rp(float2 uv)
+{
+ const float2 Center = float2(0.5,0.5);
+ float2 dir = uv - Center; // vector from center to pixel
+ float dist = length(dir);
+ //dir /= dist;
+ return dist;
+}
+
+float4 main(float2 uv : TEXCOORD) : COLOR
+{
+ float _x = sin(orientation)*uv[0]-cos(orientation)*uv[1];
+ float l = 0.5
+ + contrast*0.5*cos(frequency*_x + phase);
+
+ float4 color = float4(l,l,l,1.0);
+ return color;
+}