364"// display with simple tone mapping, does exposure and gamma correction \n"
365"color3 display_hdr(fragmentData input, \n"
366" uniform samplerIMG tex : TEXUNIT0, \n"
367" uniform float exposure = 1.0, \n"
368" uniform float gamma = 1.0 / 2.2, \n"
369" uniform int texRectFilter // flag indicating use of texture rectangular filtering \n"
370" ) : COLOR \n"
371"{ \n"
372" color3 c; \n"
373" if (!texRectFilter) { \n"
374" c = texIMG(tex, input.TexCoord0); \n"
375" } else { \n"
376" c = bilinear(tex, input.TexCoord0); \n"
377" } \n"
378" c.rgb = c.r * exposure; \n"
379" // c.rgb = pow(c.r, gamma); \n"
380" return c; \n"
381"} \n"
382" \n"
383"// threshold the image leaving output 1.0 if above threshold and 0.0 otherwise \n"
384"COLORTYPE threshold(fragmentData input, \n"
385" uniform samplerIMG tex : TEXUNIT0, \n"
386" uniform float thresholdGain = 2.0, \n"
387" uniform float thresholdOffset = -4.0, \n"
388" uniform int texRectFilter // flag indicating use of texture rectangular filtering \n"
389" ) : COLOR \n"
390"{ \n"
391" COLORTYPE c = 0; \n"
392" if (!texRectFilter) { \n"
393" if ((input.TexCoord0.x < 1.0) && (input.TexCoord0.y < 1.0) // this test eliminates a edge effect problem with halo turning on brighter on the edge. \n"