/// Amplitude of Grating /// 0 /// 1 /// 0.5 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); /// Amplitude of Grating2 /// 0 /// 1 /// 0.5 float contrast2 : register(C5); /// Phase of Grating2 /// 0 /// 100 /// 100 float frequency2: register(C6); /// Phase of Grating2 /// 0 /// 6.283184 /// 0 float phase2: register(C7); /// Orientation of Grating2 /// 0 /// 6.283184 /// 0.785398 float orientation2: register(C8); /// Width of envelope /// 1 /// 1024 /// 32 float SizeH : register(C9); /// Height of envelope /// 1 /// 1024 /// 32 float SizeV : register(C10); 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 _x1 = sin(orientation)*uv[0]-cos(orientation)*uv[1]; float _x2 = sin(orientation2)*uv[0]-cos(orientation2)*uv[1]; float l = 0.5 + contrast*0.5*cos(frequency*_x1 + phase) + contrast2*0.5*cos(frequency2*_x2 + phase2); float4 color = float4(l,l,l,1.0); return color; }