浏览代码

Merge remote-tracking branch 'refs/remotes/origin/master' into Support-UV0-UV3-on-lit-for-base

/main
sebastienlagarde 7 年前
当前提交
e16cb2e3
共有 29 个文件被更改,包括 2016 次插入25 次删除
  1. 24
      ScriptableRenderPipeline/Core/CoreRP/Camera/FreeCamera.cs
  2. 12
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl
  3. 4
      ScriptableRenderPipeline/Core/package.json
  4. 6
      ScriptableRenderPipeline/HDRenderPipeline/package.json
  5. 6
      ScriptableRenderPipeline/LightweightPipeline/package.json
  6. 4
      ScriptableRenderPipeline/master-package.json
  7. 4
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/3DObjects/CornelBox/Cornell Box.fbx.meta
  8. 2
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/3DObjects/Sphere/Sphere.fbx.meta
  9. 2
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Assets/CommonAssets/Cornell Box.fbx.meta
  10. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/040_UpgradeScene/Models/Environment/Floor.fbx.meta
  11. 20
      Tests/Scripts/Editor/GraphicTests/Framework/TestFramework.cs
  12. 1001
      ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.png
  13. 83
      ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.png.meta
  14. 8
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.meta
  15. 7
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.meta
  16. 85
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/HDRP_Default_Sky_SmallDist.asset
  17. 8
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/HDRP_Default_Sky_SmallDist.asset.meta
  18. 74
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/HDRP_ReflectionProbe256.asset
  19. 10
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/HDRP_ReflectionProbe256.asset.meta
  20. 212
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/ProbeVisualizer.mat
  21. 8
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/ProbeVisualizer.mat.meta
  22. 70
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/ReflectionProbeToTexture.cs
  23. 11
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/ReflectionProbeToTexture.cs.meta
  24. 228
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/Tess_Displace.mat
  25. 10
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/Tess_Displace.mat.meta
  26. 129
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/TexCubeToTex2D.shader
  27. 9
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/TexCubeToTex2D.shader.meta

24
ScriptableRenderPipeline/Core/CoreRP/Camera/FreeCamera.cs


public float m_LookSpeedController = 120f;
public float m_LookSpeedMouse = 10.0f;
public float m_MoveSpeed = 10.0f;
public float m_MoveSpeedIncrement = 2.5f;
public float m_Turbo = 10.0f;
private static string kMouseX = "Mouse X";

private static string kVertical = "Vertical";
private static string kHorizontal = "Horizontal";
private static string kYAxis = "YAxis";
private static string kSpeedAxis = "Speed Axis";
void OnEnable()
{
RegisterInputs();

{
#if UNITY_EDITOR
List <InputManagerEntry> inputEntries = new List<InputManagerEntry>();
List<InputManagerEntry> inputEntries = new List<InputManagerEntry>();
inputEntries.Add(new InputManagerEntry { name = kYAxis, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "page up", altBtnPositive = "joystick button 5", btnNegative = "page down", altBtnNegative = "joystick button 4", gravity = 1000.0f, deadZone = 0.001f, sensitivity = 1000.0f });
inputEntries.Add(new InputManagerEntry { name = kSpeedAxis, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "home", btnNegative = "end", gravity = 1000.0f, deadZone = 0.001f, sensitivity = 1000.0f });
inputEntries.Add(new InputManagerEntry { name = kSpeedAxis, kind = InputManagerEntry.Kind.Axis, axis = InputManagerEntry.Axis.Seventh, gravity = 1000.0f, deadZone = 0.001f, sensitivity = 1000.0f });
InputRegistering.RegisterInputs(inputEntries);
#endif
}

// If the debug menu is running, we don't want to conflict with its inputs.
if(DebugMenuManager.instance.menuUI.isEnabled)
if (DebugMenuManager.instance.menuUI.isEnabled)
return;
float inputRotateAxisX = 0.0f;

inputRotateAxisX += (Input.GetAxis(kRightStickX) * m_LookSpeedController * Time.deltaTime);
inputRotateAxisY += (Input.GetAxis(kRightStickY) * m_LookSpeedController * Time.deltaTime);
float inputChangeSpeed = Input.GetAxis(kSpeedAxis);
if (inputChangeSpeed != 0.0f)
{
m_MoveSpeed += inputChangeSpeed * m_MoveSpeedIncrement;
if (m_MoveSpeed < m_MoveSpeedIncrement) m_MoveSpeed = m_MoveSpeedIncrement;
}
float inputYAxis = Input.GetAxis(kYAxis);
bool moved = inputRotateAxisX != 0.0f || inputRotateAxisY != 0.0f || inputVertical != 0.0f || inputHorizontal != 0.0f;
bool moved = inputRotateAxisX != 0.0f || inputRotateAxisY != 0.0f || inputVertical != 0.0f || inputHorizontal != 0.0f || inputYAxis != 0.0f;
if (moved)
{
float rotationX = transform.localEulerAngles.x;

moveSpeed *= Input.GetAxis("Fire1") > 0.0f ? m_Turbo : 1.0f;
transform.position += transform.forward * moveSpeed * inputVertical;
transform.position += transform.right * moveSpeed * inputHorizontal;
transform.position += Vector3.up * moveSpeed * inputYAxis;
}
}
}

12
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl


#ifndef INTRINSIC_WAVEREADFIRSTLANE
// Warning: for correctness, the argument must have the same value across the wave!
// Warning: for correctness, the argument's value must be the same across all lanes of the wave.
TEMPLATE_1_REAL(WaveReadFirstLane, scalarValue, return scalarValue)
TEMPLATE_1_INT(WaveReadFirstLane, scalarValue, return scalarValue)
#endif

return faceID;
}
#endif // INTRINSIC_CUBEMAP_FACE_ID
// Intrinsic isnan can't be used because it require /Gic to be enabled on fxc that we can't do. So use IsNAN instead
// Intrinsic isnan can't be used because it require /Gic to be enabled on fxc that we can't do. So use IsNAN instead
bool IsNAN(float n)
{
return (n < 0.0 || n > 0.0 || n == 0.0) ? false : true;

bool IsNAN(float4 v)
{
return (IsNAN(v.x) || IsNAN(v.y) || IsNAN(v.z) || IsNAN(v.w)) ? true : false;
}
}
// ----------------------------------------------------------------------------
// Common math functions

0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1};
// Use case examples:
// (position = positionCS) => (clipSpaceTransform = use default)
// (position = positionVS) => (clipSpaceTransform = UNITY_MATRIX_P)

#endif
return positionCS;
}
}
// Use case examples:
// (position = positionCS) => (clipSpaceTransform = use default)

4
ScriptableRenderPipeline/Core/package.json


{
"name": "com.unity.render-pipelines.core",
"description": "Core library for Unity render pipelines.",
"version": "0.1.26",
"version": "0.1.27",
"com.unity.postprocessing": "0.1.7"
"com.unity.postprocessing": "0.1.8"
}
}

6
ScriptableRenderPipeline/HDRenderPipeline/package.json


{
"name": "com.unity.render-pipelines.high-definition",
"description": "HD Render Pipeline for Unity.",
"version": "0.1.26",
"version": "0.1.27",
"com.unity.postprocessing": "0.1.7",
"com.unity.render-pipelines.core": "0.1.26"
"com.unity.postprocessing": "0.1.8",
"com.unity.render-pipelines.core": "0.1.27"
}
}

6
ScriptableRenderPipeline/LightweightPipeline/package.json


{
"name": "com.unity.render-pipelines.lightweight",
"description": "Lightweight Render Pipeline for Unity.",
"version": "0.1.26",
"version": "0.1.27",
"com.unity.postprocessing": "0.1.7",
"com.unity.render-pipelines.core": "0.1.26"
"com.unity.postprocessing": "0.1.8",
"com.unity.render-pipelines.core": "0.1.27"
}
}

4
ScriptableRenderPipeline/master-package.json


{
"version": "0.1.26",
"version": "0.1.27",
"com.unity.postprocessing": "0.1.7"
"com.unity.postprocessing": "0.1.8"
},
"subPackages": [
"Core",

4
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/3DObjects/CornelBox/Cornell Box.fbx.meta


2186277476908879428: ImportLogs
2186277476908879430: ImportLogs
2186277476908879432: ImportLogs
2186277476908879434: ImportLogs
2186277476908879436: ImportLogs
externalObjects:
- first:
type: UnityEngine:Material

name: Cornell Box_red
second: {fileID: 2100000, guid: 9e230cd3dd687c74f9fd71088a260bb3, type: 2}
materials:
importMaterials: 1
importMaterials: 0
materialName: 0
materialSearch: 1
materialLocation: 0

2
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/3DObjects/Sphere/Sphere.fbx.meta


tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
importAnimation: 1
copyAvatar: 0

2
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Assets/CommonAssets/Cornell Box.fbx.meta


hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 2
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/040_UpgradeScene/Models/Environment/Floor.fbx.meta


rootMotionBoneName:
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
hasTranslationDoF: 0
hasExtraRoot: 0
hasExtraRoot: 1
animationType: 2
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:

20
Tests/Scripts/Editor/GraphicTests/Framework/TestFramework.cs


yield return null;
}
// Force rendering of all realtime reflection probes
ReflectionProbe[] probes = GameObject.FindObjectsOfType<ReflectionProbe>();
int[] renderIDs = new int[probes.Length];
for (int i=0; i<probes.Length; ++i)
{
if (probes[i].mode == UnityEngine.Rendering.ReflectionProbeMode.Realtime)
renderIDs[i] = probes[i].RenderProbe();
else
renderIDs[i] = -1;
}
for (int i=0; i<probes.Length; ++i)
{
if (renderIDs[i] != -1)
{
while (!probes[i].IsFinishedRendering(renderIDs[i])) yield return null;
}
}
testSetup.thingToDoBeforeTest.Invoke();
// Render the camera

var misMatchLocationTemplate = Path.Combine(failedPath, string.Format("{0}.template.{1}", testInfo.name, "png"));
var generated = captured.EncodeToPNG();
File.WriteAllBytes(misMatchLocationResult, generated);
File.Copy(dumpFileLocation, misMatchLocationTemplate);
File.Copy(dumpFileLocation, misMatchLocationTemplate, true);
}
Assert.IsTrue(areEqual, "Scene from {0}, did not match .template file.", testInfo.relativePath);

1001
ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.png
文件差异内容过多而无法显示
查看文件

83
ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.png.meta


fileFormatVersion: 2
guid: bbaff8be8ee1a5144a56b398100698e9
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
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: -1
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: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

8
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.meta


fileFormatVersion: 2
guid: 717ece33ecae1984aae26589c5a24f09
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.meta


fileFormatVersion: 2
guid: 3f6529c22f7d2ca46814b2e7afd04ef9
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

85
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/HDRP_Default_Sky_SmallDist.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
m_Name: HDRP_Default_Sky_SmallDist
m_EditorClassIdentifier:
components:
- {fileID: 114827887035766406}
- {fileID: 114408460862325740}
- {fileID: 114186374562632170}
--- !u!114 &114186374562632170
MonoBehaviour:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7ddcec8a8eb2d684d833ac8f5d26aebd, type: 3}
m_Name: HDShadowSettings
m_EditorClassIdentifier:
active: 1
maxShadowDistance:
m_OverrideState: 1
m_Value: 20
min: 0
--- !u!114 &114408460862325740
MonoBehaviour:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
m_Name: HDRISky
m_EditorClassIdentifier:
active: 1
rotation:
m_OverrideState: 1
m_Value: 160
min: 0
max: 360
exposure:
m_OverrideState: 1
m_Value: 0
multiplier:
m_OverrideState: 1
m_Value: 1
min: 0
updateMode:
m_OverrideState: 1
m_Value: 0
updatePeriod:
m_OverrideState: 1
m_Value: 0
min: 0
skyHDRI:
m_OverrideState: 1
m_Value: {fileID: 8900000, guid: fb0bf2eac2381484187ba8a68cdca165, type: 3}
--- !u!114 &114827887035766406
MonoBehaviour:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0d7593b3a9277ac4696b20006c21dde2, type: 3}
m_Name: VisualEnvironment
m_EditorClassIdentifier:
active: 1
skyType:
m_OverrideState: 1
m_Value: 1
fogType:
m_OverrideState: 1
m_Value: 0

8
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/HDRP_Default_Sky_SmallDist.asset.meta


fileFormatVersion: 2
guid: ccbdad4b791856b43a5c82a269a26316
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

74
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/HDRP_ReflectionProbe256.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cf1dab834d4ec34195b920ea7bbf9ec, type: 3}
m_Name: HDRP_ReflectionProbe256
m_EditorClassIdentifier:
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7,
type: 2}
m_FrameSettings:
enableShadow: 1
enableContactShadows: 1
enableSSR: 1
enableSSAO: 1
enableSubsurfaceScattering: 1
enableTransmission: 1
diffuseGlobalDimmer: 1
specularGlobalDimmer: 1
enableForwardRenderingOnly: 0
enableDepthPrepassWithDeferredRendering: 0
enableAlphaTestOnlyInDeferredPrepass: 0
enableTransparentPrepass: 1
enableMotionVectors: 1
enableObjectMotionVectors: 1
enableDBuffer: 1
enableAtmosphericScattering: 1
enableRoughRefraction: 1
enableTransparentPostpass: 1
enableDistortion: 1
enablePostprocess: 1
enableStereo: 0
enableAsyncCompute: 0
enableOpaqueObjects: 1
enableTransparentObjects: 1
enableMSAA: 0
enableShadowMask: 1
lightLoopSettings:
enableTileAndCluster: 1
enableComputeLightEvaluation: 1
enableComputeLightVariants: 1
enableComputeMaterialVariants: 1
enableFptlForForwardOpaque: 1
enableBigTilePrepass: 1
isFptlEnabled: 1
renderPipelineSettings:
supportShadowMask: 1
supportSSR: 1
supportSSAO: 1
supportSubsurfaceScattering: 1
supportDBuffer: 1
supportMSAA: 0
lightLoopSettings:
spotCookieSize: 128
cookieTexArraySize: 16
pointCookieSize: 512
cubeCookieTexArraySize: 16
reflectionProbeCacheSize: 128
reflectionCubemapSize: 256
reflectionCacheCompressed: 0
skyReflectionSize: 256
skyLightingOverrideLayerMask:
serializedVersion: 2
m_Bits: 0
shadowInitParams:
shadowAtlasWidth: 4096
shadowAtlasHeight: 4096
diffusionProfileSettings: {fileID: 11400000, guid: 802c802428a2d9640a87e821dfcdd9e8,
type: 2}

10
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/HDRP_ReflectionProbe256.asset.meta


fileFormatVersion: 2
guid: a5c1d86d729be5642aaa07f872c8f50f
timeCreated: 1509445177
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

212
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/ProbeVisualizer.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ProbeVisualizer
m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap: {}
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TransmittanceColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _UnlitColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AORemapMax: 1
- _AORemapMin: 0
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _AlphaCutoffPostpass: 0.5
- _AlphaCutoffPrepass: 0.5
- _Anisotropy: 0
- _BlendMode: 0
- _CoatMask: 1
- _CullMode: 2
- _CullModeForward: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DiffusionProfile: 0
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 1
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DistortionVectorBias: -1
- _DistortionVectorScale: 2
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableBlendModePreserveSpecularLighting: 1
- _EnableFogOnTransparent: 1
- _EnableMotionVectorForVertexAnimation: 0
- _EnableSpecularOcclusion: 0
- _EnableWind: 0
- _EnergyConservingSpecularColor: 1
- _HeightAmplitude: 0.02
- _HeightCenter: 0.5
- _HeightMapParametrization: 0
- _HeightMax: 1
- _HeightMin: -1
- _HeightOffset: 0
- _HeightPoMAmplitude: 2
- _HeightTessAmplitude: 2
- _HeightTessCenter: 0.5
- _IOR: 1
- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 1
- _StencilRef: 2
- _StencilRefMV: 128
- _StencilWriteMask: 7
- _StencilWriteMaskMV: 128
- _Stiffness: 1
- _SubsurfaceMask: 1
- _SupportDBuffer: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _TexWorldScaleEmissive: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _TransparentBackfaceEnable: 0
- _TransparentDepthPostpassEnable: 0
- _TransparentDepthPrepassEnable: 0
- _TransparentSortPriority: 0
- _UVBase: 0
- _UVDetail: 0
- _UVEmissive: 0
- _ZTestMode: 4
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 1, g: 1, b: 1, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0}
- _UnlitColor: {r: 1, g: 1, b: 1, a: 1}

8
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/ProbeVisualizer.mat.meta


fileFormatVersion: 2
guid: cca4727b1173f9e42b876caafe8c25ee
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

70
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/ReflectionProbeToTexture.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
[ExecuteInEditMode, RequireComponent(typeof(RawImage))]
public class ReflectionProbeToTexture : MonoBehaviour
{
[SerializeField] private ReflectionProbe targetProbe;
[SerializeField] private bool correctGamma = false;
private Material blitMat;
private Texture probeTexture;
private Texture2D texture;
private int renderID;
private void Start()
{
//Convert();
}
[ContextMenu("Refresh")]
public void Convert ()
{
if (targetProbe != null)
{
if (texture != null) DestroyImmediate(texture);
texture = new Texture2D(targetProbe.resolution * 4, targetProbe.resolution * 3) { wrapMode = TextureWrapMode.Clamp };
if (blitMat != null) DestroyImmediate(blitMat);
blitMat = new Material(Shader.Find("Hiddent/HDRP/Tests/TexCubeToTex2D"));
blitMat.SetFloat("_CorrectGamma", correctGamma ? 1 : 0);
RenderTexture dest = new RenderTexture(texture.width, texture.height, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default);
while (!targetProbe.IsFinishedRendering(renderID)) { };
probeTexture = targetProbe.texture;
Graphics.Blit(probeTexture, dest, blitMat);
// Readback the rendered texture
var oldActive = RenderTexture.active;
RenderTexture.active = dest;
texture.ReadPixels(new Rect(0, 0, texture.width, texture.height), 0, 0);
RenderTexture.active = oldActive;
texture.Apply();
GetComponent<RawImage>().texture = texture;
}
}
[ContextMenu("RenderProbe")]
public void RenderProbe()
{
if (targetProbe != null)
{
renderID = targetProbe.RenderProbe();
StartCoroutine(WaitForRenderRoutine());
}
}
IEnumerator WaitForRenderRoutine()
{
while (!targetProbe.IsFinishedRendering(renderID)) yield return null;
Convert();
}
}

11
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/ReflectionProbeToTexture.cs.meta


fileFormatVersion: 2
guid: 727681112d002dc4598a30f4a665e701
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

228
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/Tess_Displace.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Tess_Displace
m_Shader: {fileID: 4800000, guid: 756bac9090102564582875f4c7e30202, type: 3}
m_ShaderKeywords: _DISPLACEMENT_LOCK_TILING_SCALE _HEIGHTMAP _MASKMAP _NORMALMAP
_NORMALMAP_TANGENT_SPACE _VERTEX_DISPLACEMENT _VERTEX_DISPLACEMENT_LOCK_OBJECT_SCALE
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap: {}
disabledShaderPasses:
- DistortionVectors
- TransparentDepthPrepass
- TransparentDepthPostpass
- TransparentBackface
- TransparentBackfaceDebugDisplay
- MOTIONVECTORS
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: f23830c1beb532d4a8bf9a720ef56e25, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 2800000, guid: 3923df8ac3ccc9c438171dac7c7cc3b6, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: f23830c1beb532d4a8bf9a720ef56e25, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 2800000, guid: 9afbfdeb6447dc74089f286f49995089, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: 57fce5aa5865eaa4fbb2111399715db7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TransmittanceColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AORemapMax: 1
- _AORemapMin: 0
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _AlphaCutoffPostpass: 0.5
- _AlphaCutoffPrepass: 0.5
- _Anisotropy: 0
- _BlendMode: 0
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CoatMask: 1
- _CullMode: 2
- _CullModeForward: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 1
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DiffusionProfile: 0
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 1
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 1
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DistortionVectorBias: -1
- _DistortionVectorScale: 2
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableBlendModePreserveSpecularLighting: 1
- _EnableFogOnTransparent: 1
- _EnableMotionVectorForVertexAnimation: 0
- _EnableSpecularOcclusion: 0
- _EnableWind: 0
- _EnergyConservingSpecularColor: 1
- _HeightAmplitude: 0.14999999
- _HeightCenter: 0.3
- _HeightMapParametrization: 1
- _HeightMax: 3
- _HeightMin: -3
- _HeightOffset: 0
- _HeightPoMAmplitude: 6
- _HeightTessAmplitude: 15
- _HeightTessCenter: 0.3
- _IOR: 1
- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 1
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 64
- _PPDMinSamples: 6
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 0.99999994
- _SmoothnessRemapMin: 0
- _SrcBlend: 1
- _StencilRef: 2
- _StencilRefMV: 128
- _StencilWriteMask: 7
- _StencilWriteMaskMV: 128
- _Stiffness: 1
- _SubsurfaceMask: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SupportDBuffer: 1
- _SurfaceType: 0
- _TessellationBackFaceCullEpsilon: -0.675
- _TessellationFactor: 3
- _TessellationFactorMaxDistance: 100
- _TessellationFactorMinDistance: 99
- _TessellationFactorTriangleSize: 2
- _TessellationMode: 0
- _TessellationShapeFactor: 0.5
- _TexWorldScale: 1
- _TexWorldScaleEmissive: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _TransparentBackfaceEnable: 0
- _TransparentDepthPostpassEnable: 0
- _TransparentDepthPrepassEnable: 0
- _TransparentSortPriority: 0
- _UVBase: 0
- _UVDetail: 0
- _UVEmissive: 0
- _ZTestMode: 4
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0}

10
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/Tess_Displace.mat.meta


fileFormatVersion: 2
guid: 4fadbc1a681767747b77a6f8964a368e
timeCreated: 1509023461
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

129
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/TexCubeToTex2D.shader


Shader "Hiddent/HDRP/Tests/TexCubeToTex2D"
{
Properties
{
_MainTex ("Texture", Cube) = "white" {}
_CorrectGamma ("Correct Gamma", float ) = 0
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
samplerCUBE _MainTex;
bool _CorrectGamma;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float3 coords = float3(0,0,0);
coords.x = cos( i.uv.x * UNITY_PI * 2 );
coords.z = sin( i.uv.x * UNITY_PI * 2 );
coords.y = sin((i.uv.y * 2 - 1) * UNITY_PI * 0.5);
coords.xz *= 1 - abs(coords.y);
fixed4 col = fixed4(1,1,1,1);
if (i.uv.x < 0.25)
{
if (i.uv.y < 0.3333333)
col.a *= 0;
else if (i.uv.y < 0.6666666)
{
coords.x = saturate(i.uv.x * 4) * 2 - 1;
coords.y = clamp((i.uv.y * 2 - 1) * 3, -1, 1);
coords.z = 1;
}
else
col.a *= 0;
}
else if (i.uv.x < 0.5)
{
if (i.uv.y < 0.3333333)
{
coords.x = ((i.uv.y * 3) * 2 - 1);
coords.y = -1;
}
else if (i.uv.y < 0.6666666)
{
coords.x = 1;
coords.y = (i.uv.y * 2 - 1) * 3;
}
else
{
coords.x = -(((i.uv.y-.6666666) * 3) * 2 - 1);
coords.y = 1;
}
coords.z = -(saturate((i.uv.x - 0.25) * 4) * 2 - 1);
}
else if (i.uv.x < 0.75)
{
if (i.uv.y < 0.3333333)
col.a *= 0;
else if (i.uv.y < 0.6666666)
{
coords.x = -(saturate((i.uv.x-0.5) * 4) * 2 - 1);
coords.y = (i.uv.y * 2 - 1) * 3;
coords.z = -1;
}
else
col.a *= 0;
}
else
{
if (i.uv.y < 0.3333333)
col.a *= 0;
else if (i.uv.y < 0.6666666)
{
coords.x = -1;
coords.y = (i.uv.y * 2 - 1) * 3;
coords.z = saturate((i.uv.x - 0.75) * 4) * 2 - 1;
}
else
col.a *= 0;
}
coords = normalize(coords);
col.rgb *= texCUBE(_MainTex, coords).rgb;
if (_CorrectGamma == 1)
col.rgb = pow(col.rgb, 0.4545454545); // Gamma Correction
return col;
}
ENDCG
}
}
}

9
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation/TexCubeToTex2D.shader.meta


fileFormatVersion: 2
guid: b3f5dd5077c978948bdbf181c061319e
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存