Skip to content

Commit

Permalink
Passthrough Hull Brush (#613)
Browse files Browse the repository at this point in the history
This is an MVP for a passthrough brush.

It's limited at present:

Only works when the environment is set to passthrough.
Punches through non-opaque brushes even when they are nearer to the camera (is this an issue with rendering queues or something else?
Punches through all brushes further from the camera so can't be used for "portal" style effects.
I think it still adds some value and it's low-hanging fruit.

* First stab at a passthrough brush

* Flip exclude logic

* Hull passthrough tweaks

* dotnet-format

* Build complains if there's no entry for Cull

* Dummy commit to test pre-commit check

* Need to define this in every file it's used in.

* Try and nudge pre-commit into working

---------

Co-authored-by: Mike Miller <[email protected]>
  • Loading branch information
andybak and mikeage authored May 3, 2024
1 parent 0f4d1a4 commit f5228c5
Show file tree
Hide file tree
Showing 16 changed files with 537 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Assets/Manifest_Experimental.asset
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ MonoBehaviour:
- {fileID: 11400000, guid: 2ac14128061517f47a61f3c85ce26dfa, type: 2}
- {fileID: 11400000, guid: 95219c84db13d7c49b0bae92b5f8dc9c, type: 2}
- {fileID: 11400000, guid: b9280b7e789abdd49bd5d85c5554afd3, type: 2}
- {fileID: 11400000, guid: d25091db0e878ba458b54227b23cad57, type: 2}
Environments:
- {fileID: 11400000, guid: c4b465a813a79c044874468d6e60f26c, type: 2}
Locales: []
CompatibilityBrushes: []
8 changes: 8 additions & 0 deletions Assets/Resources/X/Brushes/PassthroughHull.meta

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 400000}
- component: {fileID: 114000011676573980}
- component: {fileID: 2300000}
- component: {fileID: 3300000}
m_Layer: 0
m_Name: HullPrefabPassthrough
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114000011676573980
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 05481b74b9f47ad45a3f71a4890c7f63, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Faceted: 1
m_TrackInterior: 1
m_KnotConversion: 2
m_Simplification_PS: 0.001
m_SimplifyMode: 0
--- !u!23 &2300000
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: ce8b2be5f7b63f344ae603ba6f4b4aec, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 0}

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

90 changes: 90 additions & 0 deletions Assets/Resources/X/Brushes/PassthroughHull/PassthroughHull.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
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: c71b2ac88638c5c41a0a0681f70d2512, type: 3}
m_Name: PassthroughHull
m_EditorClassIdentifier:
m_Guid:
m_storage: cc131ff8-0d17-4677-93e0-d7cd19fea9ac
m_DurableName: PassthroughHull
m_CreationVersion:
m_ShaderVersion: 10.0
m_BrushPrefab: {fileID: 100000, guid: f04947adf1f654f4081f1f32deb5f6d4, type: 3}
m_Tags:
- experimental
- hull
- passthrough
m_Nondeterministic: 0
m_Supersedes: {fileID: 0}
m_LooksIdentical: 0
m_ButtonTexture: {fileID: 2800000, guid: 3206c9396267b1b4784c2c545300582c, type: 3}
m_LocalizedDescription:
m_TableReference:
m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86
m_TableEntryReference:
m_KeyId: 176764812224364544
m_Key:
m_FallbackState: 0
m_WaitForCompletion: 0
m_LocalVariables: []
m_DescriptionExtra:
m_BrushAudioLayers:
- {fileID: 8300000, guid: 15b5f6d2886398349b2f6221289deef0, type: 3}
- {fileID: 8300000, guid: 7f3c17c51669e2d48b29fd4056b713a4, type: 3}
- {fileID: 8300000, guid: 80f7380fb57f05b49bf3407ca40404fd, type: 3}
m_BrushAudioBasePitch: 1
m_BrushAudioMaxPitchShift: 0
m_BrushAudioMaxVolume: 1
m_BrushVolumeUpSpeed: 1.2
m_BrushVolumeDownSpeed: 1.2
m_VolumeVelocityRangeMultiplier: 1.5
m_AudioReactive: 0
m_ButtonAudio: {fileID: 0}
m_Material: {fileID: 2100000, guid: ce8b2be5f7b63f344ae603ba6f4b4aec, type: 2}
m_TextureAtlasV: 1
m_TileRate: 0.01
m_UseBloomSwatchOnColorPicker: 0
m_BrushSizeRange: {x: 0.005, y: 1}
m_PressureSizeRange: {x: 0.1, y: 1}
m_SizeVariance: 0
m_PreviewPressureSizeMin: 0.001
m_Opacity: 1
m_PressureOpacityRange: {x: 1, y: 1}
m_ColorLuminanceMin: 0
m_ColorSaturationMax: 1
m_ParticleSpeed: 0
m_ParticleRate: 1
m_ParticleInitialRotationRange: 0
m_RandomizeAlpha: 0
m_SprayRateMultiplier: 1
m_RotationVariance: 360
m_PositionVariance: 0
m_SizeRatio: {x: 1, y: 1}
m_M11Compatibility: 1
m_SolidMinLengthMeters_PS: 0.002
m_TubeStoreRadiusInTexcoord0Z: 0
m_RenderBackfaces: 0
m_BackIsInvisible: 0
m_BackfaceHueShift: 0
m_BoundsPadding: 0
m_PlayBackAtStrokeGranularity: 1
m_BlendMode: 0
m_EmissiveFactor: 0
m_AllowExport: 1
m_SupportsSimplification: 0
m_HeadMinPoints: 1
m_HeadPointStep: 1
m_TailMinPoints: 1
m_TailPointStep: 1
m_MiddlePointStep: 0
references:
version: 2
RefIds: []

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

98 changes: 98 additions & 0 deletions Assets/Resources/X/Brushes/PassthroughHull/PassthroughHull.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PassthroughHull
m_Shader: {fileID: 4800000, guid: 2e1da1285b95b584383074c95b23dc2e, type: 3}
m_ValidKeywords: []
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _Bottom:
m_Texture: {fileID: 2800000, guid: 36752f6114447a844a013406d30a3c29, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Side:
m_Texture: {fileID: 2800000, guid: 31a0dba64c25fa442a02171bc2131ccc, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Top:
m_Texture: {fileID: 2800000, guid: 36752f6114447a844a013406d30a3c29, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BottomScale: 0.3
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Shininess: 0.574
- _SideScale: 5.21
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _TopScale: 0.3
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.29411763, g: 0.29411763, b: 0.29411763, a: 0}
m_BuildTextureStacks: []

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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f5228c5

Please sign in to comment.