I've been trying to get even the simplest of shaders working with no success. 
I've tried many things, starting with some tutorials which were terribly 
outdated. This is where I'm at now. I set a break point in the .cpp in 
DYNAMIC_STATE and it gets hit, so the codes getting called when I set it as the 
overlay. The shader is getting loaded, since if I remove the .vcs, the game 
complains that it can't find it. Other overlays work, like the combine vision. 
So I'm at a loss. This started as a sepia overlay from a tut, but it's been 
trimmed down to this. I've tried a few variations of parameters and return 
types for the shader's main function. I also tried a vertex shader that just 
copies the values, also with a few variations of parameters and return types.

post_sepia.cpp:
#include "BaseVSShader.h"  
#include "SDK_screenspaceeffect_vs20.inc"
#include "post_sepia_ps20.inc" 

BEGIN_VS_SHADER( Post_Sepia, "Help for Post_Sepia" ) 

BEGIN_SHADER_PARAMS 
END_SHADER_PARAMS 

SHADER_FALLBACK 
{ 
    return 0; 
} 

SHADER_INIT 
{ 
} 

SHADER_DRAW
{
    SHADOW_STATE
    {
        int fmt = VERTEX_POSITION;
        pShaderShadow->VertexShaderVertexFormat( fmt, 1, 0, 0 );

        // Pre-cache shaders
        DECLARE_STATIC_VERTEX_SHADER( sdk_screenspaceeffect_vs20 );
        SET_STATIC_VERTEX_SHADER( sdk_screenspaceeffect_vs20 );

        DECLARE_STATIC_PIXEL_SHADER( post_sepia_ps20 );
        SET_STATIC_PIXEL_SHADER( post_sepia_ps20 );

    }

    DYNAMIC_STATE
    {
        DECLARE_DYNAMIC_VERTEX_SHADER( sdk_screenspaceeffect_vs20 );
        SET_DYNAMIC_VERTEX_SHADER( sdk_screenspaceeffect_vs20 );

        DECLARE_DYNAMIC_PIXEL_SHADER( post_sepia_ps20 );
        SET_DYNAMIC_PIXEL_SHADER( post_sepia_ps20 );
    }
    Draw();
}
END_SHADER

post_sepia_ps20.fxc:
float4 main( void ) : COLOR
{
    return float4(1, 0, 0, 1);
}
                                          
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to