mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-19 22:08:34 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
25 lines
772 B
C#
25 lines
772 B
C#
namespace Sandbox.Rendering;
|
|
|
|
internal class DepthOnlyPrepassLayer : RenderLayer
|
|
{
|
|
public DepthOnlyPrepassLayer( SceneViewRenderTargetHandle rtDepth )
|
|
{
|
|
Name = "Depth";
|
|
LayerType = SceneLayerType.DepthPrepass;
|
|
|
|
// Render all object shaders in Depth mode
|
|
ShaderMode = "Depth";
|
|
|
|
Flags |= LayerFlags.NeverRemove;
|
|
Flags |= LayerFlags.IsDepthRenderingPass;
|
|
|
|
DepthAttachment = rtDepth;
|
|
|
|
ObjectFlagsRequired = SceneObjectFlags.IsOpaque;
|
|
ObjectFlagsExcluded = SceneObjectFlags.IsLight | SceneObjectFlags.ExcludeGameLayer | SceneObjectFlags.NoZPrepass;
|
|
|
|
// Discard pixels conservatively, our depth prepass shader doesn't do the fancy a2c smoothing math. ( But shadows do, so don't remove me! )
|
|
Attributes.SetCombo( "D_ALPHA_TEST_CONSERVATIVE", 1 );
|
|
}
|
|
}
|