kernelBlurFragment.fx 486 B

1234567891011121314
  1. #ifdef DOF
  2. sampleDepth = sampleDistance(sampleCoord{X});
  3. factor = clamp(1.0-((centerSampleDepth - sampleDepth)/centerSampleDepth),0.0,1.0);
  4. computedWeight = KERNEL_WEIGHT{X} * factor;
  5. sumOfWeights += computedWeight;
  6. #else
  7. computedWeight = KERNEL_WEIGHT{X};
  8. #endif
  9. #ifdef PACKEDFLOAT
  10. blend += unpack(texture2D(textureSampler, sampleCoord{X})) * computedWeight;
  11. #else
  12. blend += texture2D(textureSampler, sampleCoord{X}) * computedWeight;
  13. #endif