Professional Documents
Culture Documents
Making Shaders
Making Shaders
FX.
I thought I'd share my reply with you guys too as there might be someone here th
at wanted to try their hand at making a shader.
Quote:
The way SweetFX work is the dlls each call their own .fx file which sets up code
specific to them , then the main.h file is called which loads each shader if it
has been enabled in the settings, and then later in the file calls it if it's b
een enabled.
I suggest that you start by going into the SweetFX/Shaders/ folder and make a co
py of another shader .h file like splitscreen.h and name your copy what you will
.
Then go to the main.h file and copy the code that loads splitscreen.h and paste
it in again and change the USE_SPLITSCREEN to USE_YOURSHADERNAME and point it to
your shader file.
Next find the section that runs the splitscreen pass and change it to run your s
hader.
Code:
// Splitscreen
#if (USE_CADERSHADER == 1)
FinalColor = CaderShaderPass(FinalColor,tex);
#endif
Then open the SweetFX_settings.txt file and create a new option to enable or dis
able your shader at the top and create a new section later in the file to set it
's settings (you can copy the section for another shader again - just make sure
you don't use the same #define constant names.
You now have a copy of the splitscreen shader.
Now edit the new shader so the function name matches the name you called earlier
in main.h and remove the body of the shader function and write your own code he
re.
Code:
/*-----------------------------------------------------------.
/
CaderShader
/
'-----------------------------------------------------------*/
/*
Awesome shader by cassycade
- Does this and a little bit of that.
*/
float4 CaderShaderPass( float4 colorInput, float2 tex )
{
//your code here