Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. float3 CurColor=0;
  2. float3 CurColor=0;
  3. float2 NewUV = UV;
  4. int i=0;
  5. float StepSize = Distance / (int) DistanceSteps;
  6. float CurDistance=0;
  7. float2 CurOffset=0;
  8. float SubOffset = 0;
  9. float TwoPi = 6.283185;
  10. float accumdist=0;
  11.  
  12. if (DistanceSteps < 1)
  13. {
  14. return Texture2DSample(CustomDepthTexture,CustomDepthTextureSampler,UV);
  15. }
  16. else
  17. {
  18. while (i < (int) DistanceSteps)
  19. {
  20. CurDistance += StepSize;
  21. for (int j = 0; j < (int) RadialSteps; j++)
  22. {
  23. SubOffset +=1;
  24. CurOffset.x = cos(TwoPi*(SubOffset / RadialSteps));
  25. CurOffset.y = sin(TwoPi*(SubOffset / RadialSteps));
  26. NewUV.x = UV.x + CurOffset.x * CurDistance;
  27. NewUV.y = UV.y + CurOffset.y * CurDistance;
  28. float distpow = pow(CurDistance, KernelPower);
  29. CurColor += ceil(Texture2DSample(CustomDepthTexture,CustomDepthTextureSampler,NewUV))*distpow;
  30. accumdist += distpow;
  31. }
  32. SubOffset +=RadialOffset;
  33. i++;
  34. }
  35. CurColor = CurColor;
  36. CurColor /=accumdist;
  37. return CurColor;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement