您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
33 行
1.1 KiB
33 行
1.1 KiB
#ifndef __TILEDLIGHTINGTEMPLATE_H__
|
|
#define __TILEDLIGHTINGTEMPLATE_H__
|
|
|
|
|
|
#include "TiledLightingUtils.hlsl"
|
|
#include "LightingTemplate.hlsl"
|
|
|
|
|
|
|
|
float3 ExecuteLightList(out uint numLightsProcessed, uint2 pixCoord, float3 vP, float3 vPw, float3 Vworld)
|
|
{
|
|
uint nrTilesX = (g_widthRT+15)/16; uint nrTilesY = (g_heightRT+15)/16;
|
|
uint2 tileIDX = pixCoord / 16;
|
|
|
|
uint start = 0, numLights = 0;
|
|
GetCountAndStart(start, numLights, tileIDX, nrTilesX, nrTilesY, vP.z, DIRECT_LIGHT);
|
|
|
|
numLightsProcessed = numLights; // mainly for debugging/heat maps
|
|
return ExecuteLightList(start, numLights, vP, vPw, Vworld);
|
|
}
|
|
|
|
float3 ExecuteLightListTile(out uint numLightsProcessed, uint2 tileIDX, float3 vP, float3 vPw, float3 Vworld)
|
|
{
|
|
uint nrTilesX = (g_widthRT + 15) / 16; uint nrTilesY = (g_heightRT + 15) / 16;
|
|
|
|
uint start = 0, numLights = 0;
|
|
GetCountAndStart(start, numLights, tileIDX, nrTilesX, nrTilesY, vP.z, DIRECT_LIGHT);
|
|
|
|
numLightsProcessed = numLights; // mainly for debugging/heat maps
|
|
return ExecuteLightList(start, numLights, vP, vPw, Vworld);
|
|
}
|
|
|
|
#endif
|