00001 /*
00002 Muli3D - a software rendering library
00003 Copyright (C) 2004, 2005 Stephan Reiter <streiter@aon.at>
00004
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation; either
00008 version 2.1 of the License, or (at your option) any later version.
00009
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013 Lesser General Public License for more details.
00014
00015 You should have received a copy of the GNU Lesser General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00018 */
00019
00022
00023 #ifndef __M3DCORE_SHADERS_H__
00024 #define __M3DCORE_SHADERS_H__
00025
00026 #include "../m3dbase.h"
00027 #include "../m3dtypes.h"
00028
00029 #include "m3dcore_baseshader.h"
00030
00032class IMuli3DVertexShader : publicIMuli3DBaseShader
00033 {
00034 protected:
00035 friendclass CMuli3DDevice;
00041 virtualvoidExecute( constshaderreg *i_pInput, vector4 &o_vPosition,
00042 shaderreg *o_pOutput ) = 0;
00043
00046 virtualm3dshaderregtypeGetOutputRegisters( uint32 i_iRegister ) = 0;
00047 };
00048
00050class IMuli3DTriangleShader : publicIMuli3DBaseShader
00051 {
00052 protected:
00053 friendclass CMuli3DDevice;
00061 virtualboolbExecute( shaderreg *io_pShaderRegs0,
00062 shaderreg *io_pShaderRegs1, shaderreg *io_pShaderRegs2 ) = 0;
00063 };
00064
00066class IMuli3DPixelShader : publicIMuli3DBaseShader
00067 {
00068 protected:
00069 friendclass CMuli3DDevice;
00070virtualm3dpixelshaderoutputGetShaderOutput() { returnm3dpso_coloronly; }
00071virtualboolbMightKillPixels() { returntrue; }
00072
00076 voidSetInfo( const m3dshaderregtype *i_pVSOutputs, conststructm3dtriangleinfo *i_pTriangleInfo );
00077
00084 virtualboolbExecute( constshaderreg *i_pInput, vector4 &io_vColor,
00085 float32 &io_fDepth ) = 0;
00086
00091 voidGetDerivatives( uint32 i_iRegister, vector4 &o_vDdx, vector4 &o_vDdy ) const;
00092
00093 private:
00094 constm3dshaderregtype *m_pVSOutputs;
00095 conststruct m3dtriangleinfo *m_pTriangleInfo;
00096 };
00097
00098 #endif // __M3DCORE_SHADERS_H__