dosbox-x/shaders/shader.code

163 lines
3.3 KiB
Plaintext

/*
Copyright (C) 2006 guest(r) - guest.r@gmail.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Needed by my shaders
// matrix definitions
float4x4 World : WORLD;
float4x4 View : VIEW;
float4x4 Projection : PROJECTION;
float4x4 WorldView : WORLDVIEW;
float4x4 ViewProjection : VIEWPROJECTION;
float4x4 WorldViewProjection : WORLDVIEWPROJECTION;
// useful variables
float2 ps : TEXELSIZE;
float3 dt = float3(1,1,1);
float4 d4 = float4(1,1,1,1);
// sampler init
texture s_tex : SOURCETEXTURE;
texture t_tex : WORKINGTEXTURE;
sampler s_p = sampler_state
{
Texture = (s_tex);
MinFilter = POINT;
MagFilter = POINT;
};
sampler s_l = sampler_state
{
Texture = (s_tex);
MinFilter = LINEAR;
MagFilter = LINEAR;
};
sampler s_w = sampler_state
{
Texture = (t_tex);
MinFilter = POINT;
MagFilter = POINT;
};
sampler w_l = sampler_state
{
Texture = (t_tex);
MinFilter = LINEAR;
MagFilter = LINEAR;
};
// Vertex struct definitions
// Standard 9 texel
struct VERTEX_STUFF0
{
float4 coord : POSITION;
float2 CT : TEXCOORD0;
float4 t1 : TEXCOORD1;
float4 t2 : TEXCOORD2;
float4 t3 : TEXCOORD3;
float4 t4 : TEXCOORD4;
};
//-------------------------------------------------------------------//
// GS2X vertex shader structure
struct VERTEX_STUFF1
{
float4 coord : POSITION;
float2 CT : TEXCOORD0;
float2 UL : TEXCOORD1;
float2 UR : TEXCOORD2;
float2 DL : TEXCOORD3;
float2 DR : TEXCOORD4;
};
//-------------------------------------------------------------------//
// GS4x vertex shader structures
struct VERTEX_STUFF2
{
float4 coord : POSITION;
float2 CT : TEXCOORD0;
float2 UL : TEXCOORD1;
float2 UR : TEXCOORD2;
float2 DL : TEXCOORD3;
float2 DR : TEXCOORD4;
float2 iUL : TEXCOORD5;
float2 iUR : TEXCOORD6;
float4 iDD : TEXCOORD7;
};
//-------------------------------------------------------------------//
// Working Color VS structure
struct VERTEX_STUFF_W // color
{
float4 coord : POSITION;
float2 CT : TEXCOORD0;
};
//-------------------------------------------------------------------//
// Hor-Vert vertex structure
struct VERTEX_STUFF3
{
float4 coord : POSITION;
float2 C : TEXCOORD0;
float2 L : TEXCOORD1;
float2 R : TEXCOORD2;
float2 U : TEXCOORD3;
float2 D : TEXCOORD4;
};
//-------------------------------------------------------------------//
// More Texel coordinates
struct VERTEX_STUFF4
{
float4 coord : POSITION;
float2 CT : TEXCOORD0;
float4 t1 : TEXCOORD1;
float4 t2 : TEXCOORD2;
float4 t3 : TEXCOORD3;
float4 t4 : TEXCOORD4;
float4 t5 : TEXCOORD5;
float4 t6 : TEXCOORD6;
};