Custom.h 701 B

1234567891011121314151617181920212223
  1. /*-----------------------------------------------------------.
  2. / Custom /
  3. '-----------------------------------------------------------*/
  4. /*
  5. */
  6. #define CustomLuma float3(0.2126, 0.7152, 0.0722)
  7. float4 CustomPass( float4 colorInput, float2 tex )
  8. {
  9. //just some example code.
  10. float luma = dot(colorInput.rgb,CustomLuma); //Calculate luma
  11. float3 chroma = colorInput.rgb - luma; //Calculate chroma
  12. float3 color = 1.0 - luma; //invert the luma
  13. color = color + chroma; //add the chroma back in
  14. colorInput.rgb = lerp(colorInput.rgb, color, custom_strength); //Adjust the strength of the effect
  15. return saturate(colorInput);
  16. }