summaryrefslogtreecommitdiff
path: root/materialsystem/stdshaders/yuv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'materialsystem/stdshaders/yuv.cpp')
-rw-r--r--materialsystem/stdshaders/yuv.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/yuv.cpp b/materialsystem/stdshaders/yuv.cpp
new file mode 100644
index 0000000..dba70dc
--- /dev/null
+++ b/materialsystem/stdshaders/yuv.cpp
@@ -0,0 +1,62 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#include "BaseVSShader.h"
+
+#include "screenspaceeffect.inc"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+BEGIN_VS_SHADER_FLAGS( YUV, "Help for YUV", SHADER_NOT_EDITABLE )
+ BEGIN_SHADER_PARAMS
+ END_SHADER_PARAMS
+
+ SHADER_INIT_PARAMS()
+ {
+ SET_FLAGS2( MATERIAL_VAR2_NEEDS_FULL_FRAME_BUFFER_TEXTURE );
+ }
+
+ SHADER_INIT
+ {
+ }
+
+ SHADER_FALLBACK
+ {
+ // Requires DX8 + above
+ if ( IsPC() && !g_pHardwareConfig->SupportsVertexAndPixelShaders())
+ {
+ Assert( 0 );
+ return "Wireframe";
+ }
+ return 0;
+ }
+
+ SHADER_DRAW
+ {
+ SHADOW_STATE
+ {
+ pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
+ pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 1, 0, 0 );
+
+ screenspaceeffect_Static_Index vshIndex;
+ pShaderShadow->SetVertexShader( "ScreenSpaceEffect", vshIndex.GetIndex() );
+
+ pShaderShadow->SetPixelShader( "YUV" );
+ }
+
+ DYNAMIC_STATE
+ {
+ pShaderAPI->BindStandardTexture( SHADER_SAMPLER0, TEXTURE_FRAME_BUFFER_FULL_TEXTURE_0 );
+
+ screenspaceeffect_Dynamic_Index vshIndex;
+ vshIndex.SetDOWATERFOG( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
+ pShaderAPI->SetVertexShaderIndex( vshIndex.GetIndex() );
+ }
+ Draw();
+ }
+END_SHADER