Skip to content

Fix custom pass graphic tests #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ NavMeshSettings:
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
Expand Down Expand Up @@ -368,6 +370,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
isGlobal: 1
fadeRadius: 0
priority: 0
customPasses:
- id: 0
injectionPoint: 4
Expand Down Expand Up @@ -529,6 +532,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
isGlobal: 1
fadeRadius: 0
priority: 0
customPasses:
- id: 0
injectionPoint: 3
Expand Down Expand Up @@ -595,6 +599,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
isGlobal: 1
fadeRadius: 0
priority: 0
customPasses:
- id: 0
- id: 1
Expand Down Expand Up @@ -825,6 +830,7 @@ MonoBehaviour:
captureRotationProxySpace: {x: 0, y: 0, z: 0, w: 1}
mirrorPositionProxySpace: {x: 0, y: 0, z: 0}
mirrorRotationProxySpace: {x: -0.70710677, y: 0, z: 0, w: 0.70710677}
resolution: 512
cameraSettings:
customRenderingSettings: 1
renderingPathCustomFrameSettings:
Expand All @@ -837,6 +843,9 @@ MonoBehaviour:
maximumLODLevel: 0
maximumLODLevelMode: 0
maximumLODLevelQualityLevel: 0
sssQualityMode: 0
sssQualityLevel: 0
sssCustomSampleBudget: 20
materialQuality: 0
renderingPathCustomFrameSettingsOverrideMask:
mask:
Expand All @@ -854,8 +863,8 @@ MonoBehaviour:
frustum:
mode: 0
aspect: 1
farClipPlane: 1000
nearClipPlane: 0.3
farClipPlaneRaw: 1000
nearClipPlaneRaw: 0.3
fieldOfView: 90
projectionMatrix:
e00: 1
Expand Down Expand Up @@ -1075,7 +1084,7 @@ MeshCollider:
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
Expand Down Expand Up @@ -1227,6 +1236,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
isGlobal: 1
fadeRadius: 0
priority: 0
customPasses:
- id: 0
injectionPoint: 2
Expand Down Expand Up @@ -1424,9 +1434,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Profile: {fileID: 11400000, guid: 864689173ea47a14399cb0eb9a1d6e0e, type: 2}
m_StaticLightingSkyUniqueID: 2
m_SkySettings: {fileID: 1871786828}
m_SkySettingsFromProfile: {fileID: 7974066123450201752, guid: 864689173ea47a14399cb0eb9a1d6e0e,
type: 2}
--- !u!114 &1551760952
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1482,13 +1489,14 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1609657390}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3}
m_Name:
m_EditorClassIdentifier:
isGlobal: 1
fadeRadius: 0
priority: 0
customPasses:
- id: 0
injectionPoint: 0
Expand Down Expand Up @@ -1547,34 +1555,30 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1675087327}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 26d6499a6bd256e47b859377446493a1, type: 3}
m_Name:
m_EditorClassIdentifier:
isGlobal: 1
fadeRadius: 0
priority: 0
customPasses:
- id: 0
injectionPoint: 5
references:
version: 1
00000000:
type: {class: FullScreenCustomPass, ns: UnityEngine.Rendering.HighDefinition,
asm: Unity.RenderPipelines.HighDefinition.Runtime}
type: {class: WriteNormals, ns: , asm: Assembly-CSharp}
data:
m_Name: After Opaque Depth And Normal
enabled: 1
targetColorBuffer: 2
targetColorBuffer: 0
targetDepthBuffer: 0
clearFlags: 0
passFoldout: 0
m_Version: 0
fullscreenPassMaterial: {fileID: 2100000, guid: f56c72923395ba545b9a9be6e132a1f9,
type: 2}
materialPassIndex: 0
materialPassName: Custom Pass 0
fetchColorBuffer: 0
material: {fileID: 2100000, guid: f56c72923395ba545b9a9be6e132a1f9, type: 2}
--- !u!4 &1675087329
Transform:
m_ObjectHideFlags: 0
Expand All @@ -1589,85 +1593,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1871786828
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3df29e7cc05fbec4aa43e06ea875565d, type: 3}
m_Name:
m_EditorClassIdentifier:
active: 1
m_AdvancedMode: 0
rotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
skyIntensityMode:
m_OverrideState: 0
m_Value: 0
exposure:
m_OverrideState: 0
m_Value: 0
multiplier:
m_OverrideState: 0
m_Value: 1
min: 0
upperHemisphereLuxValue:
m_OverrideState: 0
m_Value: 1
min: 0
upperHemisphereLuxColor:
m_OverrideState: 0
m_Value: {x: 0, y: 0, z: 0}
desiredLuxValue:
m_OverrideState: 0
m_Value: 20000
updateMode:
m_OverrideState: 0
m_Value: 0
updatePeriod:
m_OverrideState: 0
m_Value: 0
min: 0
includeSunInBaking:
m_OverrideState: 0
m_Value: 0
sunSize:
m_OverrideState: 0
m_Value: 0.04
min: 0
max: 1
sunSizeConvergence:
m_OverrideState: 0
m_Value: 5
min: 1
max: 10
atmosphereThickness:
m_OverrideState: 0
m_Value: 1
min: 0
max: 5
skyTint:
m_OverrideState: 0
m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
groundColor:
m_OverrideState: 0
m_Value: {r: 0.369, g: 0.349, b: 0.341, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
enableSunDisk:
m_OverrideState: 0
m_Value: 1
--- !u!1 &2130596026
GameObject:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,10 @@
// There are also a lot of utility function you can use inside Common.hlsl and Color.hlsl,
// you can check them out in the source code of the core SRP package.

float4 FullScreenPass(Varyings varyings, out float outputDepth : SV_Depth) : SV_Target
float4 FullScreenPass(Varyings varyings) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(varyings);
float depth = LoadCameraDepth(varyings.positionCS.xy);
PositionInputs posInput = GetPositionInput(varyings.positionCS.xy, _ScreenSize.zw, depth, UNITY_MATRIX_I_VP, UNITY_MATRIX_V);
float3 viewDirection = GetWorldSpaceNormalizeViewDir(posInput.positionWS);
float4 color = float4(0.0, 0.0, 0.0, 0.0);

// Load the camera color buffer at the mip 0 if we're not at the before rendering injection point
if (_CustomPassInjectionPoint != CUSTOMPASSINJECTIONPOINT_BEFORE_RENDERING)
color = float4(CustomPassLoadCameraColor(varyings.positionCS.xy, 0), 1);

// Add your custom pass code here
outputDepth = 0.063;

// Fade value allow you to increase the strength of the effect while the camera gets closer to the custom pass volume
float f = 1 - abs(_FadeValue * 2 - 1);
return float4(color.rgb + f, color.a);
return float4(1, 1, 0, 1);
}

ENDHLSL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ Material:
- _AlphaCutoffShadow: 0.5
- _AlphaDstBlend: 10
- _AlphaSrcBlend: 1
- _AlphaToMask: 0
- _Anisotropy: 0
- _BlendMode: 0
- _CoatMask: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;

class WriteNormals : CustomPass
{
public Material material = null;

protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd)
{
}

protected override void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult)
{
var normal = GetNormalBuffer();
HDUtils.DrawFullScreen(cmd, material, normal);
}

protected override void Cleanup()
{
// Cleanup code
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading