//half exposure; //half gamma; //half vignettePower; //half bloomBlend; half4 bloomValues = half4(1.0h, 1.0h, 1.8h, 0.5h); // Most of this shader came from http://www.gamedev.net/reference/articles/article2108.asp half3 ProcessBloom( half2 texCoords, half3 startColour, sampler2D fullyBlurredTex ) { // Obtain the bloom half4 BloomResult = h4tex2D(fullyBlurredTex, texCoords); BloomResult /= BloomResult.a; // Interpolate between the start colour and the bloom half3 result = startColour + (BloomResult * bloomValues.w);//lerp(startColour, BloomResult, bloomValues.w); // Modify based on the position on the screen (this section can be disabled) texCoords -= (0.5h, 0.5h); half vignette = 1.h - ((texCoords.x*texCoords.x)+(texCoords.y*texCoords.y));//dot(texCoords, texCoords); result *= pow(vignette, bloomValues.z); // Modify by exposure amount result *= bloomValues.x; // Modify by gamma amount //pow(result, bloomValues.y); return pow(abs(result), bloomValues.y); // GCC //return pow(abs(result), 1.0h); // SNC - No idea why }