block improvements, autolock improvements and auto off, block button auto on/off, recoil anim improvement

This commit is contained in:
2025-08-20 11:03:40 +02:00
parent f1c59e80ae
commit 3b07a6f937
18 changed files with 784 additions and 628 deletions

View File

@@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: bc074d00982114f0388e9c98de91d44f
m_currentHash:
serializedVersion: 2
Hash: ef672e941747c2eb6b19db828d740a6a
Hash: 1efe8cf9686e6b90ba179faa51fb53d2
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0

View File

@@ -23,13 +23,13 @@ Material:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- MOTIONVECTORS
- SHADOWCASTER
- DepthOnly
- SHADOWCASTER
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
@@ -126,6 +126,7 @@ Material:
- USEFRESNEL: 1
- Vector1_473704f964214ae2bc68475022d1524b: 0.0432
- _AOStrength: 0.561
- _AddPrecomputedVelocity: 0
- _AlphaClip: 1
- _AlphaClipThreshold: 0.51
- _AlphaToMask: 0
@@ -136,6 +137,7 @@ Material:
- _BendMinHeight: 1
- _Blend: 0
- _BlendModePreserveSpecular: 0
- _BlendOp: 0
- _BumpScale: 1
- _CastShadows: 0
- _ClearCoatMask: 0
@@ -146,6 +148,7 @@ Material:
- _DetailNormalMapScale: 1
- _DissolveNoiseScale: 252.45
- _DstBlend: 10
- _DstBlendAlpha: 10
- _EffectStrenght: 3.63
- _EffectThreshold: 0
- _EnvironmentReflections: 1
@@ -168,6 +171,7 @@ Material:
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 5
- _SrcBlendAlpha: 1
- _Surface: 1
- _Threshold: 0
- _USEDISSOLVE: 1

View File

@@ -105638,7 +105638,7 @@ MonoBehaviour:
strafeRollBackwardAnim: Roll_Backward
strafeRollLeftAnim: Roll_Left
strafeRollRightAnim: Roll_Right
strafeRollLeftCorrectionAngle: 45
strafeRollLeftCorrectionAngle: 70.6
strafeRollRightCorrectionAngle: 70
--- !u!114 &9202663235077955828
MonoBehaviour:

View File

@@ -34076,7 +34076,7 @@ AnimatorState:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: recoil_low
m_Speed: 1
m_Speed: 0.1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101000012749382348}
@@ -39028,7 +39028,7 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102000010528555366}
m_Position: {x: 288, y: 12, z: 0}
m_Position: {x: 290, y: 10, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102000012545787238}
m_Position: {x: 290, y: 70, z: 0}

View File

@@ -19388,11 +19388,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9170089612332002602}
serializedVersion: 2
m_LocalRotation: {x: 0.05278538, y: -0.5895988, z: -0.56207395, w: 0.5776331}
m_LocalPosition: {x: -0.02, y: 0.078, z: 0}
m_LocalRotation: {x: -0.06726524, y: -0.6859155, z: -0.5509779, w: 0.47055146}
m_LocalPosition: {x: 0.032, y: 0.304, z: -0.157}
m_LocalScale: {x: 1.15, y: 1.4, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 9173563704982896226}
m_Father: {fileID: 129277641596131267}
m_LocalEulerAnglesHint: {x: -37, y: -68, z: -63}
m_LocalEulerAnglesHint: {x: -55, y: -85, z: -48}

View File

@@ -18974,6 +18974,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
maxTargetingDistance: 7
autoLockOnDistance: 3
unlockDistanceThreshold: 4
targetingInterval: 0.25
targetingAngleThreshold: 120
playerRotationSpeed: 300

View File

@@ -409,7 +409,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
m_IsActive: 0
--- !u!224 &7392023492043442918
RectTransform:
m_ObjectHideFlags: 0
@@ -2485,6 +2485,11 @@ PrefabInstance:
propertyPath: debugPrint
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8280102268978751132, guid: de3c1ae68c6ffa74a849f5dfd15e6fff,
type: 3}
propertyPath: BlockButton
value:
objectReference: {fileID: 7378049512233199252}
- target: {fileID: 8280102268978751132, guid: de3c1ae68c6ffa74a849f5dfd15e6fff,
type: 3}
propertyPath: SpellButton

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,15 @@ namespace Beyond
#region Fields & Properties
[Header("Targeting Parameters")]
[Tooltip("The maximum distance to highlight a potential target.")]
public float maxTargetingDistance = 20f;
[Tooltip("The distance within which the system will automatically lock on to the highlighted target.")]
public float autoLockOnDistance = 15f;
[Tooltip("The distance at which a locked-on target will be automatically unlocked.")]
public float unlockDistanceThreshold = 25f;
public float targetingInterval = 0.25f;
public float targetingAngleThreshold = 90f;
@@ -98,7 +106,7 @@ namespace Beyond
{
if (_gameStateManager != null) _gameStateManager.m_OnStateChanged.RemoveListener(HandleGameStateChanged);
StopAndClearAllFadeCoroutines(); // This call is correct
StopAndClearAllFadeCoroutines();
if (_targetingLoopCoroutine != null) StopCoroutine(_targetingLoopCoroutine);
@@ -113,7 +121,6 @@ namespace Beyond
#region Core Logic
// --- THIS IS THE MISSING METHOD THAT HAS BEEN RESTORED ---
private void StopAndClearAllFadeCoroutines()
{
foreach (var pair in _materialToFadeCoroutineMap)
@@ -125,7 +132,6 @@ namespace Beyond
}
_materialToFadeCoroutineMap.Clear();
}
// --- END OF RESTORED METHOD ---
private void HandleGameStateChanged(GameStateManager.State newState)
{
@@ -164,41 +170,83 @@ namespace Beyond
}
}
// REFACTORED: This method now has a clearer, more robust flow.
private void UpdateTarget()
{
if (_playerTransform == null || _gameStateManager == null || _manualSwitchCooldownActive) return;
// Step 1: Always find the absolute best candidate in range right now.
vFSMBehaviourController bestCandidate = null;
float minDistanceSqr = maxTargetingDistance * maxTargetingDistance;
HashSet<vFSMBehaviourController> combatControllers = _gameStateManager.GetActiveCombatcontrollers();
if (combatControllers == null || combatControllers.Count == 0)
if (combatControllers != null && combatControllers.Count > 0)
{
if (CurrentTarget != null) SetNewTarget(null);
return;
}
foreach (var controller in combatControllers)
{
if (controller == null || !controller.gameObject.activeInHierarchy || controller.aiController.currentHealth <= 0) continue;
if (!IsTargetInAngle(_playerTransform, controller, targetingAngleThreshold)) continue;
float distSqr = (controller.transform.position - _playerTransform.position).sqrMagnitude;
if (distSqr <= minDistanceSqr)
foreach (var controller in combatControllers)
{
minDistanceSqr = distSqr;
bestCandidate = controller;
if (controller == null || !controller.gameObject.activeInHierarchy || controller.aiController.currentHealth <= 0) continue;
if (!IsTargetInAngle(_playerTransform, controller, targetingAngleThreshold)) continue;
float distSqr = (controller.transform.position - _playerTransform.position).sqrMagnitude;
if (distSqr <= minDistanceSqr)
{
minDistanceSqr = distSqr;
bestCandidate = controller;
}
}
}
if (CurrentTarget != bestCandidate) SetNewTarget(bestCandidate);
else if (CurrentTarget != null && !IsTargetValid(CurrentTarget)) SetNewTarget(null);
// Step 2: If the best candidate is different from our current one, switch the highlight.
if (CurrentTarget != bestCandidate)
{
SetNewTarget(bestCandidate);
}
// Step 3: Every update, evaluate and apply the correct lock-on state for the current target.
UpdateLockOnState();
}
// NEW: This method exclusively handles the logic for locking on and off.
private void UpdateLockOnState()
{
if (targetLockSystem == null || _playerTransform == null) return;
// Determine if the target *should* be locked based on distance rules.
bool shouldBeLocked = false;
if (CurrentTarget != null && (autoLockSelectedTarget || alwaysLockOnInCombat))
{
float distanceToTarget = Vector3.Distance(_playerTransform.position, CurrentTarget.transform.position);
// This is a hysteresis check: use different distances for locking and unlocking to prevent flickering.
if (targetLockSystem.isLockingOn)
{
// If already locked, stay locked unless we are beyond the unlock threshold.
shouldBeLocked = distanceToTarget <= unlockDistanceThreshold;
}
else
{
// If not locked, we only engage the lock if we are within the auto-lock distance.
shouldBeLocked = distanceToTarget <= autoLockOnDistance;
}
}
// Synchronize the desired state with the lock-on system.
Transform desiredLockTarget = shouldBeLocked ? CurrentTarget.transform : null;
// The lock-on system should be smart enough to not do anything if the target hasn't changed.
// We send the desired target (or null) every update.
targetLockSystem.ManuallySetLockOnTarget(desiredLockTarget, true);
if (alwaysLockOnInCombat && desiredLockTarget != null && !targetLockSystem.isLockingOn)
{
targetLockSystem.SetLockOn(true);
}
}
// SIMPLIFIED: This method now only handles changing the CurrentTarget reference and its visual highlight.
private void SetNewTarget(vFSMBehaviourController newTarget, bool forceLockSystemUpdate = false)
{
if (_manualSwitchCooldownActive && !forceLockSystemUpdate) return;
if (CurrentTarget == newTarget && !forceLockSystemUpdate) return;
if (CurrentTarget == newTarget) return;
if (CurrentTarget != null)
{
@@ -208,16 +256,6 @@ namespace Beyond
CurrentTarget = newTarget;
if (targetLockSystem != null)
{
bool shouldLock = (autoLockSelectedTarget || alwaysLockOnInCombat) && CurrentTarget != null;
if (alwaysLockOnInCombat && CurrentTarget != null && !targetLockSystem.isLockingOn)
{
targetLockSystem.SetLockOn(true);
}
targetLockSystem.ManuallySetLockOnTarget(shouldLock ? CurrentTarget.transform : null, true);
}
if (CurrentTarget != null)
{
ApplyHighlight(CurrentTarget, true);
@@ -256,9 +294,14 @@ namespace Beyond
vFSMBehaviourController fsmTarget = lockedTargetTransform.GetComponentInParent<vFSMBehaviourController>();
if (fsmTarget == null) fsmTarget = lockedTargetTransform.GetComponentInChildren<vFSMBehaviourController>(true);
if (CurrentTarget != null && CurrentTarget.transform == lockedTargetTransform) return;
if (fsmTarget != null) SetNewTarget(fsmTarget, true);
else SetNewTarget(null, true);
if (fsmTarget != null && CurrentTarget != fsmTarget)
{
SetNewTarget(fsmTarget, true);
}
else if (fsmTarget == null && CurrentTarget != null)
{
SetNewTarget(null, true);
}
}
private void HandleLockOnSystemTargetUnlocked(Transform previouslyLockedTargetTransform)
@@ -266,10 +309,9 @@ namespace Beyond
if (targetLockSystem == null) return;
_manualSwitchCooldownActive = true;
_manualSwitchCooldownTimer = manualSwitchCooldownDuration;
if (CurrentTarget != null && previouslyLockedTargetTransform == CurrentTarget.transform)
{
SetNewTarget(null, true);
}
// After manually unlocking, we let the main UpdateTarget loop find the next best candidate.
// If the previously locked target is still the closest, it will be re-highlighted automatically.
}
#endregion

View File

@@ -12,6 +12,7 @@ namespace Beyond
public Button ActionButton;
public Button LadderButton;
public Button CrouchButton;
public Button BlockButton;
public GameObject AttackButton;
public GameObject SpellButton;
public GameObject ComsumableButton;
@@ -216,10 +217,12 @@ return left.CompareTo(right) >= 0;
if (state == GameStateManager.State.COMBAT)
{
DashButton.gameObject.SetActive(true);
BlockButton.gameObject.SetActive(true);
}
else if (state == GameStateManager.State.NORMAL)
{
DashButton.gameObject.SetActive(false);
BlockButton.gameObject.SetActive(false);
}
}

View File

@@ -189,12 +189,28 @@ namespace Beyond
// base.isCharacterAlive() checks the base.currentTarget
if (isLockingOn && base.currentTarget != null && !base.isCharacterAlive())
{
// Debug.Log($"bLockOn: Locked target {base.currentTarget.name} died. Attempting to find new one or unlock.");
Transform oldDeadTarget = base.currentTarget;
AttemptLockOn(null, oldDeadTarget); // Try to find a new target, excluding the dead one for this attempt
// OLD CODE THAT CAUSED THE PROBLEM:
// This code made bLockOn find a new target using its own (incorrect) logic.
// Transform oldDeadTarget = base.currentTarget;
// AttemptLockOn(null, oldDeadTarget);
// ---
// NEW, CORRECTED CODE:
// Instead of finding a target itself, it now tells the AutoTargetting system
// to handle it. This ensures all your distance rules are always respected.
if (autoTargetingSystem != null)
{
// The 'true' parameter tells AutoTargetting to find a new target immediately.
autoTargetingSystem.ClearTarget(true);
}
else
{
// As a fallback, if the auto-targeting system isn't found, just unlock.
UnlockTarget();
}
}
}
/// <summary>
/// Attempts to lock onto a target. If preferredTarget is provided and valid, locks that.
/// Otherwise, finds the best available target.

View File

@@ -108,7 +108,7 @@ MonoBehaviour:
m_PrefilteringModeScreenSpaceOcclusion: 0
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 0
m_PrefilterHDROutput: 1
m_PrefilterAlphaOutput: 1
m_PrefilterSSAODepthNormals: 1
m_PrefilterSSAOSourceDepthLow: 1

View File

@@ -15,7 +15,6 @@ Material:
m_ValidKeywords:
- USEDISSOLVE_WITHOUT_ALPHA_CUTOUT
- USEFRESNEL
- _ALPHAPREMULTIPLY_ON
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords:
- _USEDISSOLVE_WITHOUT_ALPHA_CUTOUT
@@ -139,7 +138,7 @@ Material:
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlend: 5
- _Surface: 1
- _Threshold: 0
- _USEDISSOLVE: 1

View File

@@ -8,30 +8,37 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ashes3
m_Shader: {fileID: 4800000, guid: 18cc8fe7d50c89741b56c1ae6a5baa66, type: 3}
m_Shader: {fileID: 4800000, guid: 8516d7a69675844a7a0b7095af7c46af, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _BLENDMODE_BLEND
- _FADING_ON
m_InvalidKeywords:
- _ALPHATEST_ON
- _SURFACE_TYPE_TRANSPARENT
m_LightmapFlags: 4
- _COLORADDSUBDIFF_ON
- _EMISSION
- _RECEIVE_SHADOWS_OFF
m_InvalidKeywords:
- _FLIPBOOKBLENDING_OFF
m_LightmapFlags: 2
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- DepthOnly
- SHADOWCASTER
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- Texture2D_CB054B04:
m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 846201ad15c9fea44bd92700047902d5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 8eed4849b39fb834eb66082fe0e29f36, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpTex:
@@ -124,13 +131,18 @@ Material:
- DstMode: 10
- SrcMode: 5
- _AlphaClip: 1
- _AlphaToMask: 1
- _Blend: 0
- _BlendMode: 1
- _BlendMode: 0
- _BlendOp: 0
- _BumpAmt: 20
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _ColorMode: 1
- _ConeWidth: 8
- _Cull: 0
- _CullMode: 2
@@ -140,10 +152,18 @@ Material:
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DetailStrength: 1
- _DstBlend: 10
- _DstMode: 10
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0
- _DstBlend: 0
- _DstBlendAlpha: 0
- _DstMode: 1
- _EmissionEnabled: 0
- _EnvironmentReflections: 1
- _FPOW: 1
- _FlipbookBlending: 0
- _FlipbookMode: 0
- _FresnelDistort: 200
- _FresnelFadeFactor: 3
- _FresnelPow: 5
@@ -155,12 +175,15 @@ Material:
- _GlossyReflections: 0
- _Height: 0
- _InvFade: 1
- _LightingEnabled: 0
- _LimitLength: 50
- _Metallic: 0.351
- _Mode: 0
- _OcclusionStrength: 1
- _Offset: 0
- _OrthoSpport: 0
- _Parallax: 0.005
- _QueueControl: 0
- _QueueOffset: 0
- _R0: 0
- _ReceiveShadows: 0
@@ -172,13 +195,17 @@ Material:
- _SmoothnessTextureChannel: 0
- _SoftFresnel: 1
- _SoftInverted: 0.142
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1
- _SoftParticlesNearFadeDistance: 0
- _SpecGlossEnabled: 0
- _SpecSource: 0
- _SpecularHighlights: 1
- _SpotFade: 0.6
- _SrcBlend: 5
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _SrcMode: 5
- _Surface: 1
- _Surface: 0
- _UseCutout: 0
- _UseCutoutTex: 0
- _UseCutoutThreshold: 0
@@ -189,29 +216,37 @@ Material:
- _UseParticlesAlphaCutout: 0
- _UseSoft: 1
- _UseSoftCutout: 0
- _UseVelocity: 0
- _UseVertexLight: 0
- _UseVertexStreamRandom: 0
- _WorkflowMode: 0
- _ZTest: 4
- _ZWrite: 0
- _ZWrite: 1
- _ZWriteMode: 0
- _far: 2
- _near: 0
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- Color_882B4FC: {r: 0, g: 0, b: 0, a: 0}
- _BaseColor: {r: 0, g: 0.35958624, b: 1, a: 1}
- _BaseColorAddSubDiff: {r: 1, g: 0, b: 0, a: 0}
- _CameraFadeDistances: {r: 0.3, g: 1, b: 0.3, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 0, g: 0.3595862, b: 1, a: 1}
- _ColorAddSubDiff: {r: 1, g: 0, b: 0, a: 0}
- _CutoutColor: {r: 0.91176486, g: 4, b: 1.1886411, a: 1}
- _DetailScrollSpeed: {r: 0, g: 0, b: 0, a: 0}
- _DistortSpeed: {r: 1, g: 0.1, b: 1, a: 0.1}
- _DistortionSpeedScale: {r: 1, g: -1, b: 0.15, a: 0.15}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0.22126484, b: 1, a: 1}
- _FogColorMultiplier: {r: 0, g: 0, b: 0, a: 0}
- _FresnelColor: {r: 0.06925258, g: 0.40499997, b: 0.041691188, a: 1}
- _FresnelDistort: {r: 8, g: 12, b: 1, a: 1500}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- _UVScrollDistort: {r: 8, g: 12, b: 1, a: 1500}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &8578215999217652463
MonoBehaviour:
m_ObjectHideFlags: 11
@@ -224,4 +259,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
version: 10

View File

@@ -1,20 +1,79 @@
Shader "Unlit/DepthPrepassTransparent"
{
Properties
{
// This property is necessary to receive the texture from the main material
_MainTex("Texture", 2D) = "white" {}
// This property is necessary to receive the alpha cutoff value from the main material
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
}
SubShader
{
Tags {
"Queue" = "Transparent"
"RenderType" = "Transparent"
"RenderPipeline" = "UniversalPipeline"
}
// This pass is for the depth pre-pass.
// It writes depth for transparent objects that need it.
Tags { "RenderType" = "TransparentCutout" "RenderPipeline" = "UniversalPipeline" }
Pass
{
// Use the "DepthOnly" LightMode for URP to identify this as a depth pass.
Name "DepthOnly"
Tags { "LightMode" = "DepthOnly" }
// Write to the depth buffer
ZWrite On
// Do not write to any color channels
ColorMask 0
}
// Standard back-face culling
Cull Back
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
// Includes for URP core functionality
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
// Match the properties block
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
half _Cutoff;
struct Attributes
{
float4 positionOS : POSITION;
float2 uv : TEXCOORD0;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
};
Varyings vert(Attributes input)
{
Varyings output;
// Standard vertex transformation
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
output.uv = input.uv;
return output;
}
half4 frag(Varyings input) : SV_TARGET
{
// Sample the texture to get the alpha value
half alpha = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv).a;
// Perform alpha clipping. Discard the fragment if its alpha is below the cutoff.
// This ensures the depth shape matches the visible shape.
clip(alpha - _Cutoff);
// We don't need to return a color as ColorMask is 0,
// but the function must return something.
return 0;
}
ENDHLSL
}
}
}

View File

@@ -377,12 +377,3 @@ MonoBehaviour:
BlurQuality: 2
Falloff: 30
SampleCount: -1
m_BlueNoise256Textures:
- {fileID: 2800000, guid: 36f118343fc974119bee3d09e2111500, type: 3}
- {fileID: 2800000, guid: 4b7b083e6b6734e8bb2838b0b50a0bc8, type: 3}
- {fileID: 2800000, guid: c06cc21c692f94f5fb5206247191eeee, type: 3}
- {fileID: 2800000, guid: cb76dd40fa7654f9587f6a344f125c9a, type: 3}
- {fileID: 2800000, guid: e32226222ff144b24bf3a5a451de54bc, type: 3}
- {fileID: 2800000, guid: 3302065f671a8450b82c9ddf07426f3a, type: 3}
- {fileID: 2800000, guid: 56a77a3e8d64f47b6afe9e3c95cb57d5, type: 3}
m_Shader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3}