@:directlyUsed@:src({
@param var hdrTexture:Sampler2D;
@param var exposureExp:Float;
@const var isSRBG:Bool;
@const var mode:Int;
@param var invGamma:Float;
@param var a:Float;
@param var b:Float;
@param var c:Float;
@param var d:Float;
@param var e:Float;
var hdrColor:Vec4;
function __init__fragment() {
hdrColor = hdrTexture.get(calculatedUV);
};
function fragment() {
var color = hdrColor;
color.rgb *= exposureExp;
switch (mode) {
case 0:
color.rgb = color.rgb.saturate();
case 1:
color.rgb = color.rgb / (color.rgb + vec3(1.));
case 2:
color.rgb = saturate((color.rgb * (a * color.rgb + b)) / (color.rgb * (c * color.rgb + d) + e));
};
if (!isSRBG) color.rgb = pow(color.rgb, vec3(invGamma));
pixelColor = color;
};
})@:build(hxsl.Macros.buildShader())@:autoBuild(hxsl.Macros.buildShader())