Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float3 CurColor=0;
- float3 CurColor=0;
- float2 NewUV = UV;
- int i=0;
- float StepSize = Distance / (int) DistanceSteps;
- float CurDistance=0;
- float2 CurOffset=0;
- float SubOffset = 0;
- float TwoPi = 6.283185;
- float accumdist=0;
- if (DistanceSteps < 1)
- {
- return Texture2DSample(CustomDepthTexture,CustomDepthTextureSampler,UV);
- }
- else
- {
- while (i < (int) DistanceSteps)
- {
- CurDistance += StepSize;
- for (int j = 0; j < (int) RadialSteps; j++)
- {
- SubOffset +=1;
- CurOffset.x = cos(TwoPi*(SubOffset / RadialSteps));
- CurOffset.y = sin(TwoPi*(SubOffset / RadialSteps));
- NewUV.x = UV.x + CurOffset.x * CurDistance;
- NewUV.y = UV.y + CurOffset.y * CurDistance;
- float distpow = pow(CurDistance, KernelPower);
- CurColor += ceil(Texture2DSample(CustomDepthTexture,CustomDepthTextureSampler,NewUV))*distpow;
- accumdist += distpow;
- }
- SubOffset +=RadialOffset;
- i++;
- }
- CurColor = CurColor;
- CurColor /=accumdist;
- return CurColor;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement