<commit_before>//EMPTY_META_DATA

#include "FullScreenShader.h"
#include "ShaderCommon.h"
#include "HDRCommon.h"
#include "ToneMapping.h"

Texture2D<float4>	CurColorMap				: register( t0 );
Texture2D<float4>	PrevAdaptedLuminanceMap	: register( t1 );
Texture2D<float4>	InputBloomMap			: register( t2 );

SamplerState		Sampler					: register( s0 );

float AverageLuminance()
{
	return PrevAdaptedLuminanceMap.Load(uint3(0,0,0)).x;
}

float3 ComputeExposedColor(float3 color, float avgLum, float threshold)
{
	avgLum = max(avgLum, 0.0001f);

	float linearExposure	= (GetExposureStrength() / avgLum);

	float	exposure = log2( max(linearExposure, 0.001f) );
			exposure -= threshold;

	return color * exp2(exposure);
}

float4 Bloom_Threshold_InFullScreen_PS(PS_INPUT input) : SV_Target
{
	float3 color		= CurColorMap.Sample(Sampler, input.uv).rgb;
	float avgLum		= AverageLuminance();

	color = ComputeExposedColor(color.rgb, avgLum, GetBloomThreshold());

	return float4(color, 1.0f);
}

float3 BloomToneMapping(float3 color, float avgLum, float threshold)
{
	color = ComputeExposedColor(color, avgLum, threshold);

	return color;
}

float4 Bloom_InFullScreen_PS(PS_INPUT input) : SV_Target
{
	float4 color		= CurColorMap.Sample(Sampler, input.uv);
	float avgLum		= AverageLuminance();
	color.rgb			= ToGamma(BloomToneMapping(color.rgb, avgLum, 0.0f), GetGamma());

	float3 bloom		= InputBloomMap.Sample(Sampler, input.uv).rgb;
	float3 finalColor	= min(color.rgb + bloom.rgb, 1.0f);

	return float4(finalColor, color.a);
}<commit_msg>Bloom - USE_BLOOM 추가<commit_after>//EMPTY_META_DATA

#include "FullScreenShader.h"
#include "ShaderCommon.h"
#include "HDRCommon.h"
#include "ToneMapping.h"

Texture2D<float4>	CurColorMap				: register( t0 );
Texture2D<float4>	PrevAdaptedLuminanceMap	: register( t1 );
Texture2D<float4>	InputBloomMap			: register( t2 );

SamplerState		Sampler					: register( s0 );

float AverageLuminance()
{
	return PrevAdaptedLuminanceMap.Load(uint3(0,0,0)).x;
}

float3 ComputeExposedColor(float3 color, float avgLum, float threshold)
{
	avgLum = max(avgLum, 0.0001f);

	float linearExposure	= (GetExposureStrength() / avgLum);

	float	exposure = log2( max(linearExposure, 0.001f) );
			exposure -= threshold;

	return color * exp2(exposure);
}

float4 Bloom_Threshold_InFullScreen_PS(PS_INPUT input) : SV_Target
{
	float3 color		= CurColorMap.Sample(Sampler, input.uv).rgb;
	float avgLum		= AverageLuminance();

	color = ComputeExposedColor(color.rgb, avgLum, GetBloomThreshold());

	return float4(color, 1.0f);
}

float3 BloomToneMapping(float3 color, float avgLum, float threshold)
{
	color = ComputeExposedColor(color, avgLum, threshold);

	return color;
}

float4 Bloom_InFullScreen_PS(PS_INPUT input) : SV_Target
{
	float4 color		= CurColorMap.Sample(Sampler, input.uv);

#ifdef USE_BLOOM
	float avgLum		= AverageLuminance();
	color.rgb			= ToGamma(BloomToneMapping(color.rgb, avgLum, 0.0f), GetGamma());

	float3 bloom		= InputBloomMap.Sample(Sampler, input.uv).rgb;
	float3 finalColor	= min(color.rgb + bloom.rgb, 1.0f);

	return float4(finalColor, color.a);
#else
	return float4(ToGamma(color.rgb, GetGamma()), color.a);
#endif
}
{'fraction_non_alphanumeric': 0.12258473234082991, 'fraction_numerical': 0.027557808045612923, 'mean_word_length': 5.620545073375262, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2967215', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1211, 'n_words': 234}