mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-21 06:48:11 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
61 lines
1.6 KiB
HLSL
61 lines
1.6 KiB
HLSL
HEADER
|
|
{
|
|
DevShader = true;
|
|
Version = 1;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
MODES
|
|
{
|
|
Default();
|
|
Forward();
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
FEATURES
|
|
{
|
|
#include "ui/features.hlsl"
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
COMMON
|
|
{
|
|
#include "ui/common.hlsl"
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
VS
|
|
{
|
|
#include "ui/vertex.hlsl"
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
PS
|
|
{
|
|
#include "ui/pixel.hlsl"
|
|
|
|
float4 g_vViewport < Source( Viewport ); >;
|
|
float4 g_vInvTextureDim < Source( InvTextureDim ); SourceArg( g_tColor ); >;
|
|
Texture2D g_tColor < Attribute( "Texture" ); SrgbRead( true ); >;
|
|
|
|
RenderState( SrgbWriteEnable0, true );
|
|
RenderState( ColorWriteEnable0, RGBA );
|
|
RenderState( FillMode, SOLID );
|
|
RenderState( CullMode, NONE );
|
|
|
|
// No depth
|
|
RenderState( DepthWriteEnable, false );
|
|
|
|
#define SUBPIXEL_AA_MAGIC 0.5
|
|
|
|
PS_OUTPUT MainPs( PS_INPUT i )
|
|
{
|
|
PS_OUTPUT o;
|
|
UI_CommonProcessing_Pre( i );
|
|
|
|
float4 vImage = g_tColor.Sample( g_sAniso, i.vTexCoord.xy );
|
|
o.vColor = vImage * i.vColor.rgba;
|
|
return UI_CommonProcessing_Post( i, o );
|
|
}
|
|
}
|