Hi there!
I'm trying to understand and reproduce wraiyth' tutorial on post process
shaders ( http://www.moddb.com/members/wraiyth ) with the Orangebox SDK.
I managed to compile the fxc-files and i got the compiled vcs files in
my <mymod>\shaders\fxc folder.
I had to make some changes to the shaderlib source to compile though.
(Seems like valve changed some stuff)
In post_sepia.cpp i changed:
pShaderShadow->EnableTexture( SHADER_TEXTURE_STAGE0, true );
to
pShaderShadow->EnableTexGen( SHADER_TEXTURE_STAGE0, true );
// correct? EnableTexture() takes a Sampler_t as a first argument...
.
And I changed:
pShaderShadow->VertexShaderVertexFormat( fmt, 1, 0, 0, 0 );
to
pShaderShadow->VertexShaderVertexFormat(fmt, 1, 0, 0);
And:
BindTexture( SHADER_TEXTURE_STAGE0, FBTEXTURE, -1 );
to:
BindTexture( SHADER_SAMPLER0, FBTEXTURE, -1 );
// correct? BindTexture() now takes Sampler_t
I compiled it. I got the game_shader_dx9.dll in <mymod>\bin
So I try to take a look at the postprocess shader using:
r_screenoverlay shaders/post_sepia
But I see nothing :(
No error message, no sepia.
Does anybody have an idea how I could get this postprocess shader to work?
[complete changed post_sepia.cpp]
#include "BaseVSShader.h"
#include "post_sepia_ps20.inc"
#include "post_screenspaceeffect_vs20.inc"
BEGIN_VS_SHADER( Post_Sepia, "Help for Post_Sepia" )
BEGIN_SHADER_PARAMS
SHADER_PARAM( FBTEXTURE, SHADER_PARAM_TYPE_TEXTURE,
"_rt_FullFrameFB", "" )
END_SHADER_PARAMS
// Set up anything that is necessary to make decisions in SHADER_FALLBACK.
SHADER_INIT_PARAMS()
{}
SHADER_FALLBACK
{ return 0; }
SHADER_INIT
{
if( params[FBTEXTURE]->IsDefined() )
{
LoadTexture( FBTEXTURE );
}
}
SHADER_DRAW
{
SHADOW_STATE
{
pShaderShadow->EnableDepthWrites( false );
//pShaderShadow->EnableTexture( SHADER_TEXTURE_STAGE0, true );
pShaderShadow->EnableTexGen( SHADER_TEXTURE_STAGE0, true );
int fmt = VERTEX_POSITION;
//pShaderShadow->VertexShaderVertexFormat( fmt, 1, 0, 0, 0 );
pShaderShadow->VertexShaderVertexFormat(fmt, 1, 0, 0);
DECLARE_STATIC_PIXEL_SHADER( post_sepia_ps20 );
SET_STATIC_PIXEL_SHADER( post_sepia_ps20 );
DECLARE_STATIC_VERTEX_SHADER( post_screenspaceeffect_vs20 );
SET_STATIC_VERTEX_SHADER( post_screenspaceeffect_vs20 );
}
DYNAMIC_STATE
{
//BindTexture( SHADER_TEXTURE_STAGE0, FBTEXTURE, -1 );
BindTexture( SHADER_SAMPLER0, FBTEXTURE, -1 );
DECLARE_DYNAMIC_PIXEL_SHADER( post_sepia_ps20 );
SET_DYNAMIC_PIXEL_SHADER( post_sepia_ps20 );
DECLARE_DYNAMIC_VERTEX_SHADER( post_screenspaceeffect_vs20 );
SET_DYNAMIC_VERTEX_SHADER( post_screenspaceeffect_vs20 );
}
Draw();
}
END_SHADER
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders