fork download
  1. // Created by Ofer Rubinstein.
  2. // Licesne http://c...content-available-to-author-only...s.org/licenses/by/3.0/
  3.  
  4.  
  5. float4 DrawPS(GeoOut pin) : SV_TARGET
  6. {
  7. pin.PosH2/=pin.PosH2.w;
  8. pin.PosH2.y = -pin.PosH2.y;
  9. // Sample Depth map according to screen space coordinates of the pixel.
  10. float2 d = gDepth.Sample(samLinear, float3(0.5*(pin.PosH2.xy+1), 0), 0);
  11. // Clip pixels hidden behind solid geometry(according to the depth map)
  12. clip (d.r-pin.PosH2.z);
  13. // Fade out pixels which are of distance of Delta units in the Z value
  14. float Delta = 10;
  15. float z1 = gProj._43/(pin.PosH2.z-gProj._33);
  16. float z2 = gProj._43/(d.r-gProj._33);
  17. float l = max(min((z2-z1), Delta)/Delta, 0);
  18. // Make the particle look like a sphere
  19. float a = max((1.0-((pin.Tex.x-0.5)*(pin.Tex.x-0.5) + (pin.Tex.y-0.5)*(pin.Tex.y-0.5))/0.25), 0);
  20. // Blending two colors so that the particle is more red around the edge.
  21. float3 c1 = float3(0.75, 0.5, 0.1);
  22. float3 c2 = float3(0.5, 0, 0);
  23. a*=a;
  24. return float4((c1*a+(1-a)*c2)*a*l, a*l);
  25. }
  26.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘DrawPS’
stdout
Standard output is empty