<commit_before>//NOT_CREATE_META_DATA

#ifndef __SOC_LIGHT_CULLING_CS_COMMON_H__
#define __SOC_LIGHT_CULLING_CS_COMMON_H__

#include "ShaderCommon.h"
#include "TBDRInput.h"

#define EDGE_DETECTION_COMPARE_DISTANCE			10.0f
#define TILE_RES_HALF							(LIGHT_CULLING_TILE_RES / 2)

#if defined(USE_COMPUTE_SHADER)

groupshared uint	s_lightIndexCounter;
groupshared uint	s_lightIdx[LIGHT_CULLING_LIGHT_MAX_COUNT_IN_TILE];

#endif

uint GetNumTilesX()
{
	return (uint)((GetViewportSize().x + LIGHT_CULLING_TILE_RES - 1) / (float)LIGHT_CULLING_TILE_RES);
}

uint GetNumTilesY()
{
	return (uint)((GetViewportSize().y + LIGHT_CULLING_TILE_RES - 1) / (float)LIGHT_CULLING_TILE_RES);
}

float4 CreatePlaneNormal( float4 b, float4 c )
{
    float4 n;
    //b.xyz - a.xyz, c.xyz - a.xyz̴.
    //⼭, a ̴. , ab  ش Ÿ    Ѵ.
    n.xyz = normalize(cross( b.xyz, c.xyz ));
    n.w = 0;

    return n;
}

bool InFrustum( float4 p, float4 frusutmNormal, float r )
{
	//⼭ ڿ + frusutmNormal.w ؾ,   0̶  ʿ 
	return (dot( frusutmNormal.xyz, p.xyz )/*+ frusutmNormal.w*/ < r);
}

float4 ProjToView( float4 p )
{
    p = mul( p, tbrParam_invProjMat );
    p /= p.w;
    return p;<commit_msg>Update LightCullingCommonCS.h<commit_after>//NOT_CREATE_META_DATA

#ifndef __SOC_LIGHT_CULLING_CS_COMMON_H__
#define __SOC_LIGHT_CULLING_CS_COMMON_H__

#include "ShaderCommon.h"
#include "TBDRInput.h"

#define EDGE_DETECTION_COMPARE_DISTANCE			10.0f
#define TILE_RES_HALF					(LIGHT_CULLING_TILE_RES / 2)

#if defined(USE_COMPUTE_SHADER)

groupshared uint	s_lightIndexCounter;
groupshared uint	s_lightIdx[LIGHT_CULLING_LIGHT_MAX_COUNT_IN_TILE];

#endif

uint GetNumTilesX()
{
	return (uint)((GetViewportSize().x + LIGHT_CULLING_TILE_RES - 1) / (float)LIGHT_CULLING_TILE_RES);
}

uint GetNumTilesY()
{
	return (uint)((GetViewportSize().y + LIGHT_CULLING_TILE_RES - 1) / (float)LIGHT_CULLING_TILE_RES);
}

float4 CreatePlaneNormal( float4 b, float4 c )
{
    float4 n;
    //b.xyz - a.xyz, c.xyz - a.xyz이다.
    //여기서, a는 원점이다. 즉, ab는 원점에서 해당 타일의 꼭짓점까지 떨어진 방향을 뜻한다.
    n.xyz = normalize(cross( b.xyz, c.xyz ));
    n.w = 0;

    return n;
}

bool InFrustum( float4 p, float4 frusutmNormal, float r )
{
	//여기서 뒤에 + frusutmNormal.w 해야하지만, 이 값은 0이라 더할 필요 없음
	return (dot( frusutmNormal.xyz, p.xyz )/*+ frusutmNormal.w*/ < r);
}

float4 ProjToView( float4 p )
{
    p = mul( p, tbrParam_invProjMat );
    p /= p.w;
    return p;
{'fraction_non_alphanumeric': 0.12159329140461216, 'fraction_numerical': 0.013417190775681341, 'mean_word_length': 4.065817409766455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5896308', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1153, 'n_words': 205}