aboutsummaryrefslogtreecommitdiff
path: root/mp/src/materialsystem/stdshaders/debugsoftwarevertexshader.cpp
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-12-23 14:58:45 -0800
committerJoe Ludwig <[email protected]>2013-12-23 15:00:03 -0800
commit7309a5f13f63fdcc7b1e090f6c176113a9d95061 (patch)
treead65c7fbe46a3c70bdc0a1426e88247ce1b0d7f5 /mp/src/materialsystem/stdshaders/debugsoftwarevertexshader.cpp
parentMerge pull request #182 from ardneran/master (diff)
downloadsource-sdk-2013-7309a5f13f63fdcc7b1e090f6c176113a9d95061.tar.xz
source-sdk-2013-7309a5f13f63fdcc7b1e090f6c176113a9d95061.zip
Added many shader source files
This should include the latest version of every shader that was in the 2007 SDK. It also includes a smattering of debug shaders, both VR distortion shaders, and other assorted shaders that will hopefully be useful. None of these new files are included in the game shader DLL project. If you need to modify one of these shaders for use in your mod you will need to rename it so that you don't collide with the version of that shader that lives in stdshader_dx9.dll.
Diffstat (limited to 'mp/src/materialsystem/stdshaders/debugsoftwarevertexshader.cpp')
-rw-r--r--mp/src/materialsystem/stdshaders/debugsoftwarevertexshader.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/mp/src/materialsystem/stdshaders/debugsoftwarevertexshader.cpp b/mp/src/materialsystem/stdshaders/debugsoftwarevertexshader.cpp
new file mode 100644
index 00000000..be7cedf3
--- /dev/null
+++ b/mp/src/materialsystem/stdshaders/debugsoftwarevertexshader.cpp
@@ -0,0 +1,56 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#include "shaderlib/cshader.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+SOFTWARE_VERTEX_SHADER( myHappyLittleSoftwareVertexShader )
+{
+ float t = pShaderAPI->CurrentTime();
+ for( int i = 0; i < meshBuilder.NumVertices(); i++ )
+ {
+ const float *pPos = meshBuilder.Position();
+ meshBuilder.Position3f( pPos[0], pPos[1], pPos[2] + 10.0f * sin( t + pPos[0] ) );
+ meshBuilder.AdvanceVertex();
+ }
+}
+
+FORWARD_DECLARE_SOFTWARE_VERTEX_SHADER( myHappyLittleSoftwareVertexShader );
+
+BEGIN_SHADER_FLAGS( DebugSoftwareVertexShader, "blah", SHADER_NOT_EDITABLE )
+ BEGIN_SHADER_PARAMS
+ SHADER_PARAM_OVERRIDE( BASETEXTURE, SHADER_PARAM_TYPE_TEXTURE, "shadertest/basetexture", "unused", SHADER_PARAM_NOT_EDITABLE )
+ SHADER_PARAM_OVERRIDE( FRAME, SHADER_PARAM_TYPE_INTEGER, "0", "unused", SHADER_PARAM_NOT_EDITABLE )
+ SHADER_PARAM_OVERRIDE( BASETEXTURETRANSFORM, SHADER_PARAM_TYPE_MATRIX, "center .5 .5 scale 1 1 rotate 0 translate 0 0", "unused", SHADER_PARAM_NOT_EDITABLE )
+ SHADER_PARAM_OVERRIDE( COLOR, SHADER_PARAM_TYPE_COLOR, "{255 255 255}", "unused", SHADER_PARAM_NOT_EDITABLE )
+ SHADER_PARAM_OVERRIDE( ALPHA, SHADER_PARAM_TYPE_FLOAT, "1.0", "unused", SHADER_PARAM_NOT_EDITABLE )
+ END_SHADER_PARAMS
+
+ SHADER_INIT
+ {
+ if( g_pHardwareConfig->SupportsVertexAndPixelShaders() )
+ {
+ USE_SOFTWARE_VERTEX_SHADER( myHappyLittleSoftwareVertexShader );
+ }
+ else
+ {
+ USE_SOFTWARE_VERTEX_SHADER( myHappyLittleSoftwareVertexShader );
+ }
+ }
+ SHADER_DRAW
+ {
+ SHADOW_STATE
+ {
+ }
+ DYNAMIC_STATE
+ {
+ }
+ Draw();
+ }
+END_SHADER