浏览代码

Merge pull request #220 from EvgeniiG/master

Implement projector lights
/Branch_Batching2
GitHub 8 年前
当前提交
a011b30d
共有 20 个文件被更改,包括 1261 次插入331 次删除
  1. 8
      Assets/ScriptableRenderPipeline/AdditionalLightData.cs
  2. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs
  3. 32
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/FeatureFlags.hlsl
  4. 7
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-clustered.compute
  5. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild.compute
  6. 307
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  7. 10
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs.hlsl
  8. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
  9. 36
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl
  10. 118
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
  11. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/Shadow.cs
  12. 21
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowUtilities.cs
  13. 1
      Assets/ScriptableRenderPipeline/ShaderLibrary/API/D3D11.hlsl
  14. 1
      Assets/ScriptableRenderPipeline/ShaderLibrary/API/Metal.hlsl
  15. 1
      Assets/ScriptableRenderPipeline/ShaderLibrary/API/PSSL.hlsl
  16. 631
      Assets/TestScenes/HDTest/HDRenderLoopTest.unity
  17. 2
      ProjectSettings/ProjectVersion.txt
  18. 202
      Assets/Textures/Batman.png
  19. 98
      Assets/Textures/Batman.png.meta
  20. 101
      Assets/Textures/cookieTest.png.meta

8
Assets/ScriptableRenderPipeline/AdditionalLightData.cs


namespace UnityEngine.Experimental.Rendering
{
public enum LightArchetype { Punctual, Rectangle, Line };
public enum LightArchetype { Punctual, Area, Projector };
//@TODO: We should continuously move these values
// into the engine when we can see them being generally useful

public bool affectSpecular = true;
public LightArchetype archetype = LightArchetype.Punctual;
public bool isDoubleSided = false;
public bool isDoubleSided = false; // Rectangular area lights only
public float areaLightLength = 0.0f;
public float lightLength = 0.0f; // Area & projector lights
public float areaLightWidth = 0.0f;
public float lightWidth = 0.0f; // Area & projector lights
}
}

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs


public int cookieIndex;
public GPULightType lightType;
// Area Light specific
public Vector2 size; // x = cot(outerHalfAngle) for spot lights
public bool twoSided;
public Vector2 size; // Used by area, projector and spot lights; x = cot(outerHalfAngle) for spot lights
public bool twoSided; // Used by rectangular area lights only
};
[GenerateHLSL]

32
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/FeatureFlags.hlsl


static const uint FeatureVariantFlags[NUM_FEATURE_VARIANTS] =
{
/* 0 */ 0 | FEATURE_FLAG_ALL_MATERIALS,
/* 1 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 2 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 3 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 3 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 5 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 6 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 7 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_ALL_MATERIALS,
/* 8 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_ALL_MATERIALS,
/* 9 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_ALL_MATERIALS,
/*10 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_ALL_MATERIALS,
/*11 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_ALL_MATERIALS,
/*12 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_ALL_MATERIALS,
/*13 */ 0xFFFFFFFF,
/*14 */ 0xFFFFFFFF,
/*15 */ 0xFFFFFFFF,
/* 0 */ 0 | FEATURE_FLAG_ALL_MATERIALS,
/* 1 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 2 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 3 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 3 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 5 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 6 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 7 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_LIGHT_PROJECTOR | FEATURE_FLAG_MATERIAL_LIT_STANDARD,
/* 8 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_ALL_MATERIALS,
/* 9 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_ALL_MATERIALS,
/* 10 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_ALL_MATERIALS,
/* 11 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_ALL_MATERIALS,
/* 12 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_ALL_MATERIALS,
/* 13 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_ALL_MATERIALS,
/* 14 */ FEATURE_FLAG_LIGHT_SKY | FEATURE_FLAG_LIGHT_DIRECTIONAL | FEATURE_FLAG_LIGHT_AREA | FEATURE_FLAG_LIGHT_PUNCTUAL | FEATURE_FLAG_LIGHT_ENV | FEATURE_FLAG_LIGHT_PROJECTOR | FEATURE_FLAG_ALL_MATERIALS,
/* 15 */ 0xFFFFFFFF
};
uint FeatureFlagsToTileVariant(uint featureFlags)

7
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-clustered.compute


// All our cull data are in the same list, but at render time envLights are separated so we need to shit the index
// to make it work correctly
int shiftIndex[LIGHTCATEGORY_COUNT] = {0, 0, _EnvLightIndexShift}; // 3 for now, will throw an error if we change LIGHTCATEGORY_COUNT
int shiftIndex[LIGHTCATEGORY_COUNT];
ZERO_INITIALIZE_ARRAY(int, shiftIndex, LIGHTCATEGORY_COUNT);
shiftIndex[LIGHTCATEGORY_COUNT - 1] = _EnvLightIndexShift;
int categoryListCount[LIGHTCATEGORY_COUNT]={0,0,0}; // direct light count and reflection lights
int categoryListCount[LIGHTCATEGORY_COUNT]; // direct light count and reflection lights
ZERO_INITIALIZE_ARRAY(int, categoryListCount, LIGHTCATEGORY_COUNT);
uint offs = start;
for(int ll=0; ll<iNrCoarseLights; ll+=4)
{

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild.compute


#endif
groupshared int ldsNrLightsFinal;
groupshared int ldsCategoryListCount[LIGHTCATEGORY_COUNT]; // since LIGHTCATEGORY_COUNT is 3
groupshared int ldsCategoryListCount[LIGHTCATEGORY_COUNT];
#ifdef PERFORM_SPHERICAL_INTERSECTION_TESTS
groupshared uint lightOffsSph;

// All our cull data are in the same list, but at render time envLights are separated so we need to shit the index
// to make it work correctly
int shiftIndex[LIGHTCATEGORY_COUNT] = {0, 0, _EnvLightIndexShift}; // 3 for now, will throw an error if we change LIGHTCATEGORY_COUNT
int shiftIndex[LIGHTCATEGORY_COUNT];
ZERO_INITIALIZE_ARRAY(int, shiftIndex, LIGHTCATEGORY_COUNT);
shiftIndex[LIGHTCATEGORY_COUNT - 1] = _EnvLightIndexShift;
for(int category=0; category<LIGHTCATEGORY_COUNT; category++)
{

307
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs


{
Punctual,
Area,
Projector,
Env,
Count
}

{
public static uint FEATURE_FLAG_LIGHT_PUNCTUAL = 1 << 0;
public static uint FEATURE_FLAG_LIGHT_AREA = 1 << 1;
public static uint FEATURE_FLAG_LIGHT_PUNCTUAL = 1 << 0;
public static uint FEATURE_FLAG_LIGHT_AREA = 1 << 1;
public static uint FEATURE_FLAG_LIGHT_ENV = 1 << 3;
public static uint FEATURE_FLAG_LIGHT_SKY = 1 << 4;
public static uint FEATURE_FLAG_LIGHT_PROJECTOR = 1 << 3;
public static uint FEATURE_FLAG_LIGHT_ENV = 1 << 4;
public static uint FEATURE_FLAG_LIGHT_SKY = 1 << 5;
}
[GenerateHLSL]

public class LightLoop : BaseLightLoop
{
public const int k_MaxDirectionalLightsOnScreen = 10;
public const int k_MaxPunctualLightsOnScreen = 512;
public const int k_MaxAreaLightsOnSCreen = 128;
public const int k_MaxLightsOnScreen = k_MaxDirectionalLightsOnScreen + k_MaxPunctualLightsOnScreen + k_MaxAreaLightsOnSCreen;
public const int k_MaxDirectionalLightsOnScreen = 4;
public const int k_MaxPunctualLightsOnScreen = 512;
public const int k_MaxAreaLightsOnScreen = 64;
public const int k_MaxProjectorLightsOnScreen = 64;
public const int k_MaxLightsOnScreen = k_MaxDirectionalLightsOnScreen + k_MaxPunctualLightsOnScreen + k_MaxAreaLightsOnScreen + k_MaxProjectorLightsOnScreen;
public const int k_MaxEnvLightsOnScreen = 64;
public const int k_MaxShadowOnScreen = 16;
public const int k_MaxCascadeCount = 4; //Should be not less than m_Settings.directionalLightCascadeCount;

LightList m_lightList;
int m_punctualLightCount = 0;
int m_areaLightCount = 0;
int m_projectorLightCount = 0;
int m_lightCount = 0;
private ComputeShader buildScreenAABBShader { get { return m_PassResources.buildScreenAABBShader; } }

m_lightList.Allocate();
s_DirectionalLightDatas = new ComputeBuffer(k_MaxDirectionalLightsOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(DirectionalLightData)));
s_LightDatas = new ComputeBuffer(k_MaxPunctualLightsOnScreen + k_MaxAreaLightsOnSCreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(LightData)));
s_LightDatas = new ComputeBuffer(k_MaxPunctualLightsOnScreen + k_MaxAreaLightsOnScreen + k_MaxProjectorLightsOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(LightData)));
s_EnvLightDatas = new ComputeBuffer(k_MaxEnvLightsOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(EnvLightData)));
s_shadowDatas = new ComputeBuffer(k_MaxCascadeCount + k_MaxShadowOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(ShadowData)));

lightData.cookieIndex = m_CubeCookieTexArray.FetchSlice(light.light.cookie);
break;
}
if (additionalData.archetype == LightArchetype.Projector)
{
lightData.cookieIndex = m_CookieTexArray.FetchSlice(light.light.cookie);
}
}
float shadowDistanceFade = ComputeLinearDistanceFade(distanceToCamera, additionalData.shadowFadeDistance);

if (additionalData.archetype != LightArchetype.Punctual)
{
lightData.twoSided = additionalData.isDoubleSided;
lightData.size = new Vector2(additionalData.areaLightLength, additionalData.areaLightWidth);
lightData.size = new Vector2(additionalData.lightLength, additionalData.lightWidth);
}
m_lightList.lights.Add(lightData);

lightVolumeData.lightCategory = (uint)lightCategory;
lightVolumeData.lightVolume = (uint)lightVolumeType;
if (gpuLightType == GPULightType.Spot)
if (gpuLightType == GPULightType.Spot || gpuLightType == GPULightType.ProjectorPyramid)
Vector3 lightDir = lightToWorld.GetColumn(2); // Z axis in world space
Vector3 lightDir = lightToWorld.GetColumn(2);
var vz = lightDir; // Z axis in world space
Vector3 vz = lightDir; // Z axis in world space
// transform to camera space (becomes a left hand coordinate frame in Unity since Determinant(worldToView)<0)
vx = worldToView.MultiplyVector(vx);

const float degToRad = (float)(pi / 180.0);
var sa = light.light.spotAngle;
if (gpuLightType == GPULightType.ProjectorPyramid)
{
Vector3 lightPosToProjWindowCorner = (0.5f * lightData.size.x) * vx + (0.5f * lightData.size.y) * vy + 1.0f * vz;
cs = Vector3.Dot(vz, Vector3.Normalize(lightPosToProjWindowCorner));
si = Mathf.Sqrt(1.0f - cs * cs);
}
const float FltMax = 3.402823466e+38F;
var ta = cs > 0.0f ? (si / cs) : FltMax;
var cota = si > 0.0f ? (cs / si) : FltMax;

fAltDx *= range; fAltDy *= range;
// Handle case of pyramid with this select
var altDist = Mathf.Sqrt(fAltDy * fAltDy + (gpuLightType == GPULightType.Spot ? 1.0f : 2.0f) * fAltDx * fAltDx);
// Handle case of pyramid with this select (currently unused)
var altDist = Mathf.Sqrt(fAltDy * fAltDy + (true ? 1.0f : 2.0f) * fAltDx * fAltDx);
bound.radius = altDist > (0.5f * range) ? altDist : (0.5f * range); // will always pick fAltDist
bound.scaleXY = squeeze ? new Vector2(0.01f, 0.01f) : new Vector2(1.0f, 1.0f);

lightVolumeData.lightPos = worldToView.MultiplyPoint(lightPos);
lightVolumeData.radiusSq = range * range;
lightVolumeData.cotan = cota;
lightVolumeData.featureFlags = LightFeatureFlags.FEATURE_FLAG_LIGHT_PUNCTUAL;
lightVolumeData.featureFlags = (gpuLightType == GPULightType.Spot) ? LightFeatureFlags.FEATURE_FLAG_LIGHT_PUNCTUAL
: LightFeatureFlags.FEATURE_FLAG_LIGHT_PROJECTOR;
}
else if (gpuLightType == GPULightType.Point)
{

lightVolumeData.boxInvRange.Set(1.0f / radius, 1.0f / radius, 1.0f / radius);
lightVolumeData.featureFlags = LightFeatureFlags.FEATURE_FLAG_LIGHT_AREA;
}
else if (gpuLightType == GPULightType.ProjectorOrtho)
{
Vector3 posVS = worldToView.MultiplyPoint(lightData.positionWS);
Vector3 xAxisVS = worldToView.MultiplyVector(lightData.right);
Vector3 yAxisVS = worldToView.MultiplyVector(lightData.up);
Vector3 zAxisVS = worldToView.MultiplyVector(lightData.forward);
// Projector lights point forwards (along Z). The projection window is aligned with the XY plane.
Vector3 boxDims = new Vector3(lightData.size.x, lightData.size.y, 1000000.0f);
Vector3 halfDims = 0.5f * boxDims;
bound.center = posVS;
bound.boxAxisX = halfDims.x * xAxisVS; // Should this be halved or not?
bound.boxAxisY = halfDims.y * yAxisVS; // Should this be halved or not?
bound.boxAxisZ = halfDims.z * zAxisVS; // Should this be halved or not?
bound.radius = halfDims.magnitude; // Radius of a circumscribed sphere?
bound.scaleXY.Set(1.0f, 1.0f);
lightVolumeData.lightPos = posVS; // Is this the center of the volume?
lightVolumeData.lightAxisX = xAxisVS;
lightVolumeData.lightAxisY = yAxisVS;
lightVolumeData.lightAxisZ = zAxisVS;
lightVolumeData.boxInnerDist = halfDims; // No idea what this is. Document your code
lightVolumeData.boxInvRange.Set(1.0f / halfDims.x, 1.0f / halfDims.y, 1.0f / halfDims.z); // No idea what this is. Document your code
lightVolumeData.featureFlags = LightFeatureFlags.FEATURE_FLAG_LIGHT_PROJECTOR;
}
// TODO implement unsupported type
Debug.Assert(false);
Debug.Assert(false, "TODO: encountered an unknown GPULightType.");
}
m_lightList.bounds.Add(bound);

if (cullResults.visibleLights.Length != 0 || cullResults.visibleReflectionProbes.Length != 0)
{
#if (SHADOWS_ENABLED)
// 0. deal with shadows
{
m_FrameId.frameCount++;
// get the indices for all lights that want to have shadows
m_ShadowRequests.Clear();
m_ShadowRequests.Capacity = cullResults.visibleLights.Length;
int lcnt = cullResults.visibleLights.Length;
for (int i = 0; i < lcnt; ++i)
// 0. deal with shadows
if (cullResults.visibleLights[i].light.shadows != LightShadows.None)
m_ShadowRequests.Add(i);
}
// pass this list to a routine that assigns shadows based on some heuristic
uint shadowRequestCount = (uint)m_ShadowRequests.Count;
int[] shadowRequests = m_ShadowRequests.ToArray();
int[] shadowDataIndices;
uint originalRequestCount = shadowRequestCount;
m_ShadowMgr.ProcessShadowRequests(m_FrameId, cullResults, camera, cullResults.visibleLights,
ref shadowRequestCount, shadowRequests, out shadowDataIndices);
m_FrameId.frameCount++;
// get the indices for all lights that want to have shadows
m_ShadowRequests.Clear();
m_ShadowRequests.Capacity = cullResults.visibleLights.Length;
int lcnt = cullResults.visibleLights.Length;
for (int i = 0; i < lcnt; ++i)
{
if (cullResults.visibleLights[i].light.shadows != LightShadows.None)
m_ShadowRequests.Add(i);
}
// pass this list to a routine that assigns shadows based on some heuristic
uint shadowRequestCount = (uint)m_ShadowRequests.Count;
int[] shadowRequests = m_ShadowRequests.ToArray();
int[] shadowDataIndices;
uint originalRequestCount = shadowRequestCount;
m_ShadowMgr.ProcessShadowRequests(m_FrameId, cullResults, camera, cullResults.visibleLights,
ref shadowRequestCount, shadowRequests, out shadowDataIndices);
// update the visibleLights with the shadow information
m_ShadowIndices.Clear();
for (uint i = 0; i < shadowRequestCount; i++)
{
m_ShadowIndices.Add(shadowRequests[i], shadowDataIndices[i]);
// update the visibleLights with the shadow information
m_ShadowIndices.Clear();
for (uint i = 0; i < shadowRequestCount; i++)
{
m_ShadowIndices.Add(shadowRequests[i], shadowDataIndices[i]);
}
}
#endif
float oldSpecularGlobalDimmer = m_PassSettings.specularGlobalDimmer;
// Change some parameters in case of "special" rendering (can be preview, reflection, etc.

int directionalLightcount = 0;
int punctualLightcount = 0;
int areaLightCount = 0;
int projectorLightCount = 0;
int lightCount = Math.Min(cullResults.visibleLights.Length, k_MaxLightsOnScreen);
var sortKeys = new uint[lightCount];

GPULightType gpuLightType = GPULightType.Point;
LightVolumeType lightVolumeType = LightVolumeType.Count;
// Note: LightType.Area is offline only, use for baking, no need to test it
if (additionalData.archetype == LightArchetype.Punctual)
// Note: LightType.Area is offline only, use for baking, no need to test it
if (additionalData.archetype == LightArchetype.Punctual)
{
switch (light.lightType)
switch (light.lightType)
{
case LightType.Point:
if (punctualLightcount >= k_MaxPunctualLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Point;
lightVolumeType = LightVolumeType.Sphere;
break;
case LightType.Point:
if (punctualLightcount >= k_MaxPunctualLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Point;
lightVolumeType = LightVolumeType.Sphere;
break;
case LightType.Spot:
if (punctualLightcount >= k_MaxPunctualLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Spot;
lightVolumeType = LightVolumeType.Cone;
break;
case LightType.Directional:
if (directionalLightcount >= k_MaxDirectionalLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Directional;
// No need to add volume, always visible
lightVolumeType = LightVolumeType.Count; // Count is none
break;
case LightType.Spot:
if (punctualLightcount >= k_MaxPunctualLightsOnScreen)
continue;
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Spot;
lightVolumeType = LightVolumeType.Cone;
break;
default:
case LightType.Directional:
if (directionalLightcount >= k_MaxDirectionalLightsOnScreen)
}
lightCategory = LightCategory.Punctual;
gpuLightType = GPULightType.Directional;
// No need to add volume, always visible
lightVolumeType = LightVolumeType.Count; // Count is none
break;
default:
Debug.Assert(false, "TODO: encountered an unknown LightType.");
break;
else
}
else
{
switch (additionalData.archetype)
switch (additionalData.archetype)
{
case LightArchetype.Rectangle:
if (areaLightCount >= k_MaxAreaLightsOnSCreen)
continue;
lightCategory = LightCategory.Area;
gpuLightType = GPULightType.Rectangle;
lightVolumeType = LightVolumeType.Box;
break;
case LightArchetype.Line:
if (areaLightCount >= k_MaxAreaLightsOnSCreen)
continue;
lightCategory = LightCategory.Area;
gpuLightType = GPULightType.Line;
lightVolumeType = LightVolumeType.Box;
break;
default:
continue;
}
case LightArchetype.Area:
if (areaLightCount >= k_MaxAreaLightsOnScreen) { continue; }
lightCategory = LightCategory.Area;
gpuLightType = (additionalData.lightWidth > 0) ? GPULightType.Rectangle : GPULightType.Line;
lightVolumeType = LightVolumeType.Box;
break;
case LightArchetype.Projector:
if (projectorLightCount >= k_MaxProjectorLightsOnScreen) { continue; }
lightCategory = LightCategory.Projector;
switch (light.lightType)
{
case LightType.Directional:
gpuLightType = GPULightType.ProjectorOrtho;
lightVolumeType = LightVolumeType.Box;
break;
case LightType.Spot:
gpuLightType = GPULightType.ProjectorPyramid;
lightVolumeType = LightVolumeType.Cone;
break;
default:
Debug.Assert(false, "Projectors can only be Spot or Directional lights.");
break;
}
break;
default:
Debug.Assert(false, "TODO: encountered an unknown LightArchetype.");
break;
}
#if (SHADOWS_ENABLED)
uint shadow = m_ShadowIndices.ContainsKey(lightIndex) ? 1u : 0;

LightCategory lightCategory = (LightCategory)((sortKey >> 27) & 0x1F);
GPULightType gpuLightType = (GPULightType)((sortKey >> 22) & 0x1F);
#if (SHADOWS_ENABLED)
LightVolumeType lightVolumeType = (LightVolumeType)((sortKey >> 17) & 0x1F);
LightVolumeType lightVolumeType = (LightVolumeType)((sortKey >> 17) & 0x1F);
#else
LightVolumeType lightVolumeType = (LightVolumeType)((sortKey >> 16) & 0x3F);
#endif

directionalLightcount++;
#if (SHADOWS_ENABLED && SHADOWS_FIXSHADOWIDX)
// fix up shadow information
int shadowIdxDir;
if (m_ShadowIndices.TryGetValue(lightIndex, out shadowIdxDir))
{
var lightData = m_lightList.directionalLights[m_lightList.directionalLights.Count - 1];
lightData.shadowIndex = shadowIdxDir;
m_lightList.directionalLights[m_lightList.directionalLights.Count - 1] = lightData;
}
// fix up shadow information
int shadowIdxDir;
if (m_ShadowIndices.TryGetValue(lightIndex, out shadowIdxDir))
{
var lightData = m_lightList.directionalLights[m_lightList.directionalLights.Count - 1];
lightData.shadowIndex = shadowIdxDir;
m_lightList.directionalLights[m_lightList.directionalLights.Count - 1] = lightData;
}
// Spot, point, rect, line light - Rendering side
// Punctual, area, projector lights - the rendering side.
if (lightCategory == LightCategory.Punctual)
punctualLightcount++;
else if (lightCategory == LightCategory.Area)
areaLightCount++;
else
Debug.Assert(false); // Should not be anything else here.
switch (lightCategory)
{
case LightCategory.Punctual:
punctualLightcount++;
break;
case LightCategory.Area:
areaLightCount++;
break;
case LightCategory.Projector:
projectorLightCount++;
break;
default:
Debug.Assert(false, "TODO: encountered an unknown LightCategory.");
break;
}
// fix up shadow information
int shadowIdx;
if (m_ShadowIndices.TryGetValue(lightIndex, out shadowIdx))
{
var lightData = m_lightList.lights[m_lightList.lights.Count - 1];
lightData.shadowIndex = shadowIdx;
m_lightList.lights[m_lightList.lights.Count - 1] = lightData;
}
// fix up shadow information
int shadowIdx;
if (m_ShadowIndices.TryGetValue(lightIndex, out shadowIdx))
{
var lightData = m_lightList.lights[m_lightList.lights.Count - 1];
lightData.shadowIndex = shadowIdx;
m_lightList.lights[m_lightList.lights.Count - 1] = lightData;
}
Debug.Assert(m_lightList.lights.Count == areaLightCount + punctualLightcount);
m_areaLightCount = areaLightCount;
m_punctualLightCount = punctualLightcount;
Debug.Assert(m_lightList.lights.Count == areaLightCount + punctualLightcount + projectorLightCount);
m_punctualLightCount = punctualLightcount;
m_areaLightCount = areaLightCount;
m_projectorLightCount = projectorLightCount;
// Redo everything but this time with envLights
int envLightCount = 0;

SetGlobalBuffer("_LightDatas", s_LightDatas);
SetGlobalInt("_PunctualLightCount", m_punctualLightCount);
SetGlobalInt("_AreaLightCount", m_areaLightCount);
SetGlobalInt("_ProjectorLightCount", m_projectorLightCount);
SetGlobalBuffer("_EnvLightDatas", s_EnvLightDatas);
SetGlobalInt("_EnvLightCount", m_lightList.envLights.Count);
SetGlobalBuffer("_ShadowDatas", s_shadowDatas);

10
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs.hlsl


//
#define LIGHTCATEGORY_PUNCTUAL (0)
#define LIGHTCATEGORY_AREA (1)
#define LIGHTCATEGORY_ENV (2)
#define LIGHTCATEGORY_COUNT (3)
#define LIGHTCATEGORY_PROJECTOR (2)
#define LIGHTCATEGORY_ENV (3)
#define LIGHTCATEGORY_COUNT (4)
//
// UnityEngine.Experimental.Rendering.HDPipeline.TilePass.LightFeatureFlags: static fields

#define FEATURE_FLAG_LIGHT_DIRECTIONAL (4)
#define FEATURE_FLAG_LIGHT_ENV (8)
#define FEATURE_FLAG_LIGHT_SKY (16)
#define FEATURE_FLAG_LIGHT_PROJECTOR (8)
#define FEATURE_FLAG_LIGHT_ENV (16)
#define FEATURE_FLAG_LIGHT_SKY (32)
//
// UnityEngine.Experimental.Rendering.HDPipeline.TilePass.LightDefinitions: static fields

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl


#define PROCESS_DIRECTIONAL_LIGHT
#define PROCESS_PUNCTUAL_LIGHT
#define PROCESS_AREA_LIGHT
#define PROCESS_PROJECTOR_LIGHT
#endif
#if defined (LIGHTLOOP_TILE_INDIRECT) || defined(LIGHTLOOP_TILE_ALL)

uint _DirectionalLightCount;
uint _PunctualLightCount;
uint _AreaLightCount;
uint _ProjectorLightCount;
uint _EnvLightCount;
float4 _DirShadowSplitSpheres[4]; // TODO: share this max between C# and hlsl

36
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl


}
#endif
#ifdef PROCESS_PROJECTOR_LIGHT
if(featureFlags & FEATURE_FLAG_LIGHT_PROJECTOR)
{
// TODO: Convert the for loop below to a while on each type as we know we are sorted!
uint projectorLightStart;
uint projectorLightCount;
GetCountAndStart(posInput, LIGHTCATEGORY_PROJECTOR, projectorLightStart, projectorLightCount);
for(i = 0; i < projectorLightCount; ++i)
{
float3 localDiffuseLighting, localSpecularLighting;
uint projectorIndex = FetchIndex(projectorLightStart, i);
EvaluateBSDF_Projector(context, V, posInput, prelightData, _LightDatas[projectorIndex], bsdfData,
localDiffuseLighting, localSpecularLighting);
diffuseLighting += localDiffuseLighting;
specularLighting += localSpecularLighting;
}
}
#endif
#ifdef PROCESS_ENV_LIGHT
float3 iblDiffuseLighting = float3(0.0, 0.0, 0.0);
float3 iblSpecularLighting = float3(0.0, 0.0, 0.0);

specularLighting += localSpecularLighting;
}
// Area are store with punctual, just offset the index
for (i = _PunctualLightCount; i < _AreaLightCount + _PunctualLightCount; ++i)
for (; i < _PunctualLightCount + _AreaLightCount; ++i)
{
float3 localDiffuseLighting, localSpecularLighting;

EvaluateBSDF_Area( context, V, posInput, prelightData, _LightDatas[i], bsdfData,
localDiffuseLighting, localSpecularLighting);
}
diffuseLighting += localDiffuseLighting;
specularLighting += localSpecularLighting;
}
for (; i < _PunctualLightCount + _AreaLightCount + _ProjectorLightCount; ++i)
{
float3 localDiffuseLighting, localSpecularLighting;
EvaluateBSDF_Projector( context, V, posInput, prelightData, _LightDatas[i], bsdfData,
localDiffuseLighting, localSpecularLighting);
diffuseLighting += localDiffuseLighting;
specularLighting += localSpecularLighting;

118
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


// Project 'unL' onto the light's axes.
float2 coord = float2(dot(unL, lightData.right), dot(unL, lightData.up));
// Rescale the texture.
// Compute the NDC coordinates (in [-1, 1]^2).
// Remap the texture coordinates from [-1, 1]^2 to [0, 1]^2.
coord = coord * 0.5 + 0.5;
if (lightData.tileCookie || (abs(coord.x) <= 1 && abs(coord.y) <= 1))
{
// Remap the texture coordinates from [-1, 1]^2 to [0, 1]^2.
coord = coord * 0.5 + 0.5;
// Tile the texture if the 'repeat' wrap mode is enabled.
if (lightData.tileCookie)
coord = frac(coord);
// Tile the texture if the 'repeat' wrap mode is enabled.
if (lightData.tileCookie) { coord = frac(coord); }
cookie = SampleCookie2D(lightLoopContext, coord, lightData.cookieIndex);
cookie = SampleCookie2D(lightLoopContext, coord, lightData.cookieIndex);
}
else
{
cookie = float4(0, 0, 0, 0);
}
illuminance *= cookie.a;
}

float shadow = GetPunctualShadowAttenuation(lightLoopContext, lightData.lightType, biasedPositionWS + offset, lightData.shadowIndex, L, posInput.unPositionSS);
#endif
shadow = lerp(1.0, shadow, lightData.shadowDimmer);
illuminance *= shadow;
}
illuminance *= cookie.a;
// The difference between the Disney Diffuse and the Lambertian BRDF for transmittance is negligible.
float3 backLight = (cookie.rgb * lightData.color) * (illuminance * lightData.diffuseScale * Lambert());
// TODO: multiplication by 'diffuseColor' and 'transmittance' is the same for each light.
float3 transmittedLight = backLight * bsdfData.diffuseColor * bsdfData.transmittance;
// We use diffuse lighting for accumulation since it is going to be blurred during the SSS pass.
diffuseLighting += transmittedLight;
}
}
//-----------------------------------------------------------------------------
// EvaluateBSDF_Projector
//-----------------------------------------------------------------------------
void EvaluateBSDF_Projector(LightLoopContext lightLoopContext,
float3 V, PositionInputs posInput, PreLightData preLightData, LightData lightData, BSDFData bsdfData,
out float3 diffuseLighting,
out float3 specularLighting)
{
float3 positionWS = posInput.positionWS;
// Translate and rotate 'positionWS' into the light space.
float3 positionLS = mul(positionWS - lightData.positionWS,
transpose(float3x3(lightData.right, lightData.up, lightData.forward)));
if (lightData.lightType == GPULIGHTTYPE_PROJECTOR_PYRAMID)
{
// Perform perspective division.
positionLS *= rcp(positionLS.z);
}
else
{
// For orthographic projection, the Z coordinate plays no role.
positionLS.z = 0;
}
// Compute the NDC position (in [-1, 1]^2). TODO: precompute the inverse?
float2 positionNDC = positionLS.xy * rcp(0.5 * lightData.size);
// Perform clipping.
float clipFactor = ((positionLS.z >= 0) && (abs(positionNDC.x) <= 1 && abs(positionNDC.y) <= 1)) ? 1 : 0;
float3 L = -lightData.forward; // Lights are pointing backward in Unity
float illuminance = saturate(dot(bsdfData.normalWS, L) * clipFactor);
diffuseLighting = float3(0.0, 0.0, 0.0);
specularLighting = float3(0.0, 0.0, 0.0);
float4 cookie = float4(1.0, 1.0, 1.0, 1.0);
[branch] if (lightData.shadowIndex >= 0 && illuminance > 0.0)
{
#ifdef SHADOWS_USE_SHADOWCTXT
float shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
#else
float shadow = GetDirectionalShadowAttenuation(lightLoopContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);
#endif
illuminance *= shadow;
}
[branch] if (lightData.cookieIndex >= 0 && illuminance > 0.0)
{
// Compute the texture coordinates in [0, 1]^2.
float2 coord = positionNDC * 0.5 + 0.5;
cookie = SampleCookie2D(lightLoopContext, coord, lightData.cookieIndex);
illuminance *= cookie.a;
}
[branch] if (illuminance > 0.0)
{
BSDF(V, L, positionWS, preLightData, bsdfData, diffuseLighting, specularLighting);
diffuseLighting *= (cookie.rgb * lightData.color) * (illuminance * lightData.diffuseScale);
specularLighting *= (cookie.rgb * lightData.color) * (illuminance * lightData.specularScale);
}
[branch] if (bsdfData.enableTransmission)
{
// Reverse the normal.
illuminance = saturate(dot(-bsdfData.normalWS, L));
[branch] if (lightData.shadowIndex >= 0 && illuminance > 0.0)
{
// TODO: factor out the biased position?
float3 biasedPositionWS = positionWS + bsdfData.normalWS * bsdfData.thickness;
#ifdef SHADOWS_USE_SHADOWCTXT
float shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, biasedPositionWS, lightData.shadowIndex, L, posInput.unPositionSS);
#else
float shadow = GetDirectionalShadowAttenuation(lightLoopContext, biasedPositionWS, lightData.shadowIndex, L, posInput.unPositionSS);
#endif
illuminance *= shadow;
}

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/Shadow.cs


// set light specific values that are not related to the shadowmap
GPUShadowType shadowtype;
ShadowUtils.MapLightType(ald.archetype, vl.lightType, out sd.lightType, out shadowtype);
ShadowUtils.MapLightType(vl.lightType, ald, out sd.lightType, out shadowtype);
sd.bias = l.shadowBias;
sd.quality = 0;

21
Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowUtilities.cs


return proj * view;
}
public static bool MapLightType(LightArchetype la, LightType lt, out GPULightType gputype, out GPUShadowType shadowtype)
public static bool MapLightType(LightType lt, AdditionalLightData ald, out GPULightType gputype, out GPUShadowType shadowtype)
switch (la)
shadowtype = GPUShadowType.Unknown; // Default for all non-punctual lights
gputype = GPULightType.Spot;
switch (ald.archetype)
case LightArchetype.Punctual: return MapLightType(lt, out gputype, out shadowtype);
case LightArchetype.Rectangle: gputype = GPULightType.Rectangle; shadowtype = GPUShadowType.Unknown; return true;
case LightArchetype.Line: gputype = GPULightType.Line; shadowtype = GPUShadowType.Unknown; return true;
default: gputype = GPULightType.Spot; shadowtype = GPUShadowType.Unknown; return false; // <- probably not what you want
case LightArchetype.Punctual: return MapLightType(lt, out gputype, out shadowtype);
case LightArchetype.Area: gputype = (ald.lightWidth > 0) ? GPULightType.Rectangle : GPULightType.Line; return true;
case LightArchetype.Projector:
switch (lt)
{
case LightType.Directional: gputype = GPULightType.ProjectorOrtho; return true;
case LightType.Spot: gputype = GPULightType.ProjectorPyramid; return true;
default: Debug.Assert(false, "Projectors can only be Spot or Directional lights."); return false;
}
default: return false; // <- probably not what you want
}
}

1
Assets/ScriptableRenderPipeline/ShaderLibrary/API/D3D11.hlsl


// Initialize arbitrary structure with zero values.
// Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0
#define ZERO_INITIALIZE(type, name) name = (type)0;
#define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } }
// Texture util abstraction

1
Assets/ScriptableRenderPipeline/ShaderLibrary/API/Metal.hlsl


// Initialize arbitrary structure with zero values.
// Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0
#define ZERO_INITIALIZE(type, name) name = (type)0;
#define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } }
// Texture util abstraction

1
Assets/ScriptableRenderPipeline/ShaderLibrary/API/PSSL.hlsl


// Initialize arbitrary structure with zero values.
// Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0
#define ZERO_INITIALIZE(type, name) name = (type)0;
#define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } }
// Texture util abstraction

631
Assets/TestScenes/HDTest/HDRenderLoopTest.unity
文件差异内容过多而无法显示
查看文件

2
ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2017.1.0a6
m_EditorVersion: 2017.1.0b2

202
Assets/Textures/Batman.png

之前 之后
宽度: 512  |  高度: 512  |  大小: 52 KiB

98
Assets/Textures/Batman.png.meta


fileFormatVersion: 2
guid: a5f5ba3665c610f469d392e02dadb3bd
timeCreated: 1491904075
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 0
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: tvOS
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

101
Assets/Textures/cookieTest.png.meta


fileFormatVersion: 2
guid: 32c4b9c8ddc1c5d49ac7d10122540447
timeCreated: 1472821822
licenseType: Pro
TextureImporter:
fileIDToRecycleName:
8900000: generatedCubemap
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 1
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 1
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 1
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 0
mipBias: -1
wrapMode: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 2
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 512
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: tvOS
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Windows Store Apps
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存