Cleanup some old unused shader code
This commit is contained in:
@@ -3,19 +3,13 @@
|
||||
#ifndef __IES_PROFILE__
|
||||
#define __IES_PROFILE__
|
||||
|
||||
// Apply 1D IES light profile texture
|
||||
// Calculate IES light profile from 1D texture
|
||||
float ComputeLightProfileMultiplier(Texture2D tex, float3 worldPosition, float3 lightPosition, float3 lightDirection)
|
||||
{
|
||||
float3 negLightDirection = normalize(worldPosition - lightPosition);
|
||||
|
||||
// -1..1
|
||||
float dotProd = dot(negLightDirection, lightDirection);
|
||||
// -PI..PI (this distortion could be put into the texture but not without quality loss or more memory)
|
||||
float angle = asin(dotProd);
|
||||
// 0..1
|
||||
float normAngle = angle / PI + 0.5f;
|
||||
|
||||
return tex.SampleLevel(SamplerLinearClamp, float2(normAngle, 0), 0).r;
|
||||
float3 l = normalize(worldPosition - lightPosition);
|
||||
float d = dot(lightPosition, lightDirection);
|
||||
float angle = asin(d) / PI + 0.5f;
|
||||
return tex.SampleLevel(SamplerLinearClamp, float2(angle, 0), 0).r;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user