2019-12-12 17:32:41 +01:00
|
|
|
// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
|
|
|
#ifndef __I_BURNING_SHADER_H_INCLUDED__
|
|
|
|
#define __I_BURNING_SHADER_H_INCLUDED__
|
|
|
|
|
|
|
|
#include "SoftwareDriver2_compile_config.h"
|
|
|
|
#include "IReferenceCounted.h"
|
|
|
|
#include "irrMath.h"
|
2019-12-16 17:15:04 +01:00
|
|
|
#include "irrMathFastCompat.h"
|
2019-12-12 17:32:41 +01:00
|
|
|
#include "IImage.h"
|
|
|
|
#include "S2DVertex.h"
|
|
|
|
#include "rect.h"
|
|
|
|
#include "CDepthBuffer.h"
|
|
|
|
#include "S4DVertex.h"
|
|
|
|
#include "irrArray.h"
|
|
|
|
#include "SLight.h"
|
|
|
|
#include "SMaterial.h"
|
|
|
|
#include "os.h"
|
2020-02-22 21:48:12 +01:00
|
|
|
#include "IMaterialRenderer.h"
|
|
|
|
#include "IMaterialRendererServices.h"
|
|
|
|
#include "IGPUProgrammingServices.h"
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace video
|
|
|
|
{
|
|
|
|
|
|
|
|
struct SBurningShaderLight
|
|
|
|
{
|
|
|
|
//SLight org;
|
2020-02-22 21:48:12 +01:00
|
|
|
|
|
|
|
sVec4 pos; //light position input
|
|
|
|
sVec4 pos4; //light position Model*View (Identity*View)
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
E_LIGHT_TYPE Type;
|
|
|
|
f32 linearAttenuation;
|
|
|
|
f32 constantAttenuation;
|
|
|
|
f32 quadraticAttenuation;
|
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
sVec4 spotDirection;
|
|
|
|
sVec4 spotDirection4;
|
|
|
|
f32 spotCosCutoff;
|
|
|
|
f32 spotCosInnerCutoff;
|
|
|
|
f32 spotExponent;
|
|
|
|
bool LightIsOn;
|
|
|
|
|
|
|
|
sVec3Color AmbientColor;
|
|
|
|
sVec3Color DiffuseColor;
|
|
|
|
sVec3Color SpecularColor;
|
2019-12-12 17:32:41 +01:00
|
|
|
};
|
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
enum eTransformLightFlags
|
2019-12-12 17:32:41 +01:00
|
|
|
{
|
2020-02-22 21:48:12 +01:00
|
|
|
//ENABLED = 0x01,
|
|
|
|
TL_SCISSOR = 0x02,
|
|
|
|
TL_LIGHT = 0x04,
|
|
|
|
TL_SPECULAR = 0x08,
|
|
|
|
TL_FOG = 0x10,
|
|
|
|
TL_NORMALIZE_NORMALS = 0x20,
|
|
|
|
TL_TEXTURE_TRANSFORM = 0x40,
|
|
|
|
TL_LIGHT_LOCAL_VIEWER = 0x80,
|
|
|
|
TL_LIGHT0_IS_NORMAL_MAP = 0x100 //sVec4 Light Vector is used as normal or specular
|
2019-12-12 17:32:41 +01:00
|
|
|
};
|
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
struct SBurningShaderEyeSpace
|
2019-12-12 17:32:41 +01:00
|
|
|
{
|
2020-02-22 21:48:12 +01:00
|
|
|
SBurningShaderEyeSpace() {}
|
|
|
|
virtual ~SBurningShaderEyeSpace() {}
|
2019-12-12 17:32:41 +01:00
|
|
|
void reset ()
|
|
|
|
{
|
|
|
|
Light.set_used ( 0 );
|
2020-02-22 21:48:12 +01:00
|
|
|
Global_AmbientLight.set ( 0.f );
|
|
|
|
|
|
|
|
TL_Flag = TL_LIGHT_LOCAL_VIEWER;
|
|
|
|
}
|
|
|
|
void resetFog()
|
|
|
|
{
|
|
|
|
fog_scale = 0.f;
|
|
|
|
//cam_distance = 0.f;
|
2019-12-12 17:32:41 +01:00
|
|
|
}
|
2020-02-22 21:48:12 +01:00
|
|
|
|
2019-12-12 17:32:41 +01:00
|
|
|
core::array<SBurningShaderLight> Light;
|
2020-02-22 21:48:12 +01:00
|
|
|
sVec3Color Global_AmbientLight;
|
|
|
|
|
|
|
|
//sVec4 cam_eye_pos; //Camera Position in eye Space (0,0,-1)
|
|
|
|
//sVec4 cam_world_pos; //Camera Position in world Space
|
|
|
|
//sVec4 vertex4; //eye coordinate position of vertex
|
|
|
|
sVec4 normal; //transformed normal
|
|
|
|
sVec4 vertex; //eye coordinate position of vertex projected
|
|
|
|
|
|
|
|
//derivative of vertex
|
|
|
|
//f32 cam_distance; // vertex.length();
|
|
|
|
sVec4 cam_dir; //vertex.normalize();
|
|
|
|
|
|
|
|
f32 fog_scale; // 1 / (fog.end-fog.start)
|
|
|
|
|
|
|
|
size_t TL_Flag; // eTransformLightFlags
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eBurningCullFlag
|
|
|
|
{
|
|
|
|
CULL_FRONT = 1,
|
|
|
|
CULL_BACK = 2,
|
|
|
|
CULL_INVISIBLE = 4, //primitive smaller than a pixel (AreaMinDrawSize)
|
|
|
|
CULL_FRONT_AND_BACK = 8,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eBurningStencilOp
|
|
|
|
{
|
|
|
|
StencilOp_KEEP = 0x1E00,
|
|
|
|
StencilOp_INCR = 0x1E02,
|
|
|
|
StencilOp_DECR = 0x1E03
|
2019-12-12 17:32:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SBurningShaderMaterial
|
|
|
|
{
|
|
|
|
SMaterial org;
|
2020-02-22 21:48:12 +01:00
|
|
|
SMaterial lastMaterial;
|
|
|
|
bool resetRenderStates;
|
|
|
|
|
|
|
|
E_MATERIAL_TYPE Fallback_MaterialType;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
SMaterial mat2D;
|
|
|
|
//SMaterial save3D;
|
|
|
|
|
|
|
|
size_t CullFlag; //eCullFlag
|
|
|
|
u32 depth_write;
|
|
|
|
u32 depth_test;
|
|
|
|
|
|
|
|
sVec3Color AmbientColor;
|
|
|
|
sVec3Color DiffuseColor;
|
|
|
|
sVec3Color SpecularColor;
|
|
|
|
sVec3Color EmissiveColor;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
enum EBurningFFShader
|
|
|
|
{
|
|
|
|
ETR_FLAT = 0,
|
|
|
|
ETR_FLAT_WIRE,
|
|
|
|
ETR_GOURAUD,
|
|
|
|
ETR_GOURAUD_WIRE,
|
|
|
|
ETR_TEXTURE_FLAT,
|
|
|
|
ETR_TEXTURE_FLAT_WIRE,
|
|
|
|
ETR_TEXTURE_GOURAUD,
|
|
|
|
ETR_TEXTURE_GOURAUD_WIRE,
|
|
|
|
ETR_TEXTURE_GOURAUD_NOZ,
|
|
|
|
ETR_TEXTURE_GOURAUD_ADD,
|
|
|
|
ETR_TEXTURE_GOURAUD_ADD_NO_Z,
|
|
|
|
|
|
|
|
ETR_TEXTURE_GOURAUD_VERTEX_ALPHA,
|
|
|
|
|
|
|
|
ETR_TEXTURE_GOURAUD_LIGHTMAP_M1,
|
|
|
|
ETR_TEXTURE_GOURAUD_LIGHTMAP_M2,
|
|
|
|
ETR_TEXTURE_GOURAUD_LIGHTMAP_M4,
|
|
|
|
ETR_TEXTURE_LIGHTMAP_M4,
|
|
|
|
|
|
|
|
ETR_TEXTURE_GOURAUD_DETAIL_MAP,
|
|
|
|
ETR_TEXTURE_GOURAUD_LIGHTMAP_ADD,
|
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
ETR_GOURAUD_NOZ,
|
|
|
|
//ETR_GOURAUD_ALPHA,
|
2019-12-12 17:32:41 +01:00
|
|
|
ETR_GOURAUD_ALPHA_NOZ,
|
|
|
|
|
|
|
|
ETR_TEXTURE_GOURAUD_ALPHA,
|
|
|
|
ETR_TEXTURE_GOURAUD_ALPHA_NOZ,
|
2020-02-22 21:48:12 +01:00
|
|
|
ETR_TEXTURE_GOURAUD_ALPHA_NOZ_NOPERSPECTIVE_CORRECT,
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
ETR_NORMAL_MAP_SOLID,
|
|
|
|
ETR_STENCIL_SHADOW,
|
|
|
|
|
|
|
|
ETR_TEXTURE_BLEND,
|
2020-02-22 21:48:12 +01:00
|
|
|
ETR_TRANSPARENT_REFLECTION_2_LAYER,
|
|
|
|
|
|
|
|
ETR_COLOR,
|
|
|
|
|
|
|
|
//ETR_REFERENCE,
|
2019-12-12 17:32:41 +01:00
|
|
|
ETR_INVALID,
|
|
|
|
|
|
|
|
ETR2_COUNT
|
|
|
|
};
|
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
BL_VERTEX_PROGRAM = 1,
|
|
|
|
BL_FRAGMENT_PROGRAM = 2,
|
|
|
|
BL_TYPE_FLOAT = 4,
|
|
|
|
BL_TYPE_INT = 8,
|
|
|
|
BL_TYPE_UINT = 16,
|
|
|
|
|
|
|
|
BL_VERTEX_FLOAT = (BL_VERTEX_PROGRAM | BL_TYPE_FLOAT),
|
|
|
|
BL_VERTEX_INT = (BL_VERTEX_PROGRAM | BL_TYPE_INT),
|
|
|
|
BL_VERTEX_UINT = (BL_VERTEX_PROGRAM | BL_TYPE_UINT),
|
|
|
|
BL_FRAGMENT_FLOAT = (BL_FRAGMENT_PROGRAM | BL_TYPE_FLOAT),
|
|
|
|
BL_FRAGMENT_INT = (BL_FRAGMENT_PROGRAM | BL_TYPE_INT),
|
|
|
|
BL_FRAGMENT_UINT = (BL_FRAGMENT_PROGRAM | BL_TYPE_UINT),
|
|
|
|
|
|
|
|
BL_ACTIVE_UNIFORM_MAX_LENGTH = 28
|
|
|
|
} EBurningUniformFlags;
|
|
|
|
|
|
|
|
struct BurningUniform
|
|
|
|
{
|
|
|
|
c8 name[BL_ACTIVE_UNIFORM_MAX_LENGTH];
|
|
|
|
u32 type; //EBurningUniformFlags
|
|
|
|
//int location; // UniformLocation is index
|
|
|
|
f32 data[16]; // simple LocalParameter
|
|
|
|
|
|
|
|
bool operator==(const BurningUniform& other) const
|
|
|
|
{
|
|
|
|
return tiny_istoken(name, other.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-12-12 17:32:41 +01:00
|
|
|
class CBurningVideoDriver;
|
2020-02-22 21:48:12 +01:00
|
|
|
class IBurningShader : public IMaterialRenderer, public IMaterialRendererServices
|
2019-12-12 17:32:41 +01:00
|
|
|
{
|
|
|
|
public:
|
2020-02-22 21:48:12 +01:00
|
|
|
//! Constructor
|
2019-12-12 17:32:41 +01:00
|
|
|
IBurningShader(CBurningVideoDriver* driver);
|
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
//! Constructor
|
|
|
|
IBurningShader(
|
|
|
|
CBurningVideoDriver* driver,
|
|
|
|
s32& outMaterialTypeNr,
|
|
|
|
const c8* vertexShaderProgram = 0,
|
|
|
|
const c8* vertexShaderEntryPointName = 0,
|
|
|
|
E_VERTEX_SHADER_TYPE vsCompileTarget = video::EVST_VS_1_1,
|
|
|
|
const c8* pixelShaderProgram = 0,
|
|
|
|
const c8* pixelShaderEntryPointName = 0,
|
|
|
|
E_PIXEL_SHADER_TYPE psCompileTarget = video::EPST_PS_1_1,
|
|
|
|
const c8* geometryShaderProgram = 0,
|
|
|
|
const c8* geometryShaderEntryPointName = "main",
|
|
|
|
E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,
|
|
|
|
scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES,
|
|
|
|
scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP,
|
|
|
|
u32 verticesOut = 0,
|
|
|
|
IShaderConstantSetCallBack* callback = 0,
|
|
|
|
E_MATERIAL_TYPE baseMaterial = EMT_SOLID,
|
|
|
|
s32 userData = 0);
|
|
|
|
|
2019-12-12 17:32:41 +01:00
|
|
|
//! destructor
|
|
|
|
virtual ~IBurningShader();
|
|
|
|
|
|
|
|
//! sets a render target
|
2020-11-10 19:49:39 +01:00
|
|
|
virtual void setRenderTarget(video::IImage* surface, const core::rect<s32>& viewPort, const interlaced_control interlaced);
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! sets the Texture
|
2020-02-22 21:48:12 +01:00
|
|
|
virtual void setTextureParam( const size_t stage, video::CSoftwareTexture2* texture, s32 lodFactor);
|
|
|
|
virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) {};
|
|
|
|
virtual void drawLine ( const s4DVertex *a,const s4DVertex *b);
|
|
|
|
virtual void drawPoint(const s4DVertex *a);
|
|
|
|
|
|
|
|
void drawWireFrameTriangle ( const s4DVertex *a,const s4DVertex *b,const s4DVertex *c );
|
|
|
|
|
|
|
|
virtual void OnSetMaterial( const SBurningShaderMaterial& material ) {};
|
|
|
|
|
|
|
|
void pushEdgeTest(const int wireFrame,const int point,int save)
|
|
|
|
{
|
|
|
|
if ( save ) EdgeTestPass_stack = EdgeTestPass;
|
|
|
|
EdgeTestPass = point ? edge_test_point : wireFrame ? edge_test_left : edge_test_pass;
|
|
|
|
}
|
|
|
|
void popEdgeTest() { EdgeTestPass = EdgeTestPass_stack; }
|
|
|
|
virtual bool canWireFrame () { return false; }
|
|
|
|
virtual bool canPointCloud() { return false; }
|
|
|
|
|
|
|
|
void setStencilOp(eBurningStencilOp sfail, eBurningStencilOp dpfail, eBurningStencilOp dppass);
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
//IMaterialRenderer
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
|
2021-08-27 14:55:10 +02:00
|
|
|
bool resetAllRenderstates, IMaterialRendererServices* services) IRR_OVERRIDE;
|
2020-02-22 21:48:12 +01:00
|
|
|
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) IRR_OVERRIDE;
|
2020-02-22 21:48:12 +01:00
|
|
|
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void OnUnsetMaterial() IRR_OVERRIDE;
|
2020-02-22 21:48:12 +01:00
|
|
|
|
|
|
|
//! Returns if the material is transparent.
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual bool isTransparent() const IRR_OVERRIDE;
|
2020-02-22 21:48:12 +01:00
|
|
|
|
|
|
|
//! Access the callback provided by the users when creating shader materials
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual IShaderConstantSetCallBack* getShaderConstantSetCallBack() const IRR_OVERRIDE;
|
2020-02-22 21:48:12 +01:00
|
|
|
|
|
|
|
// implementations for the render services
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) IRR_OVERRIDE;
|
|
|
|
virtual s32 getVertexShaderConstantID(const c8* name) IRR_OVERRIDE;
|
|
|
|
virtual s32 getPixelShaderConstantID(const c8* name) IRR_OVERRIDE;
|
|
|
|
virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount = 1) IRR_OVERRIDE;
|
|
|
|
virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount = 1) IRR_OVERRIDE;
|
|
|
|
virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count) IRR_OVERRIDE;
|
|
|
|
virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) IRR_OVERRIDE;
|
|
|
|
virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) IRR_OVERRIDE;
|
|
|
|
virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) IRR_OVERRIDE;
|
|
|
|
virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) IRR_OVERRIDE;
|
|
|
|
virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) IRR_OVERRIDE;
|
|
|
|
virtual IVideoDriver* getVideoDriver() IRR_OVERRIDE;
|
2020-02-22 21:48:12 +01:00
|
|
|
|
2020-11-10 19:49:39 +01:00
|
|
|
#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
|
|
|
|
virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count)
|
|
|
|
{
|
|
|
|
return setVertexShaderConstant(getVertexShaderConstantID(name), floats, count);
|
|
|
|
}
|
|
|
|
virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count)
|
|
|
|
{
|
|
|
|
return setVertexShaderConstant(getVertexShaderConstantID(name), (const s32*)bools, count);
|
|
|
|
}
|
|
|
|
virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count)
|
|
|
|
{
|
|
|
|
return setVertexShaderConstant(getVertexShaderConstantID(name), ints, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count)
|
|
|
|
{
|
|
|
|
return setPixelShaderConstant(getPixelShaderConstantID(name), floats, count);
|
|
|
|
}
|
|
|
|
virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count)
|
|
|
|
{
|
|
|
|
return setPixelShaderConstant(getPixelShaderConstantID(name), (const s32*)bools, count);
|
|
|
|
}
|
|
|
|
virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count)
|
|
|
|
{
|
|
|
|
return setPixelShaderConstant(getPixelShaderConstantID(name), ints, count);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
//used if no color interpolation is defined
|
|
|
|
void setPrimitiveColor(const video::SColor& color)
|
|
|
|
{
|
2020-11-10 19:49:39 +01:00
|
|
|
PrimitiveColor = color_to_sample(color);
|
2020-02-22 21:48:12 +01:00
|
|
|
}
|
|
|
|
void setTLFlag(size_t in /*eTransformLightFlags*/)
|
|
|
|
{
|
|
|
|
TL_Flag = in;
|
|
|
|
}
|
|
|
|
void setFog(SColor color_fog)
|
|
|
|
{
|
2020-11-10 19:49:39 +01:00
|
|
|
fog_color_sample = color_to_sample(color_fog);
|
2020-02-22 21:48:12 +01:00
|
|
|
color_to_fix(fog_color, fog_color_sample);
|
|
|
|
}
|
|
|
|
void setScissor(const AbsRectangle& scissor)
|
|
|
|
{
|
|
|
|
Scissor = scissor;
|
|
|
|
}
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2020-02-22 23:54:23 +01:00
|
|
|
void constructor_IBurningShader(CBurningVideoDriver* driver);
|
|
|
|
|
2019-12-12 17:32:41 +01:00
|
|
|
CBurningVideoDriver *Driver;
|
2020-02-22 21:48:12 +01:00
|
|
|
IShaderConstantSetCallBack* CallBack;
|
|
|
|
E_MATERIAL_TYPE BaseMaterial;
|
|
|
|
s32 UserData;
|
|
|
|
|
|
|
|
core::array<BurningUniform> UniformInfo;
|
|
|
|
s32 getShaderConstantID(EBurningUniformFlags program, const c8* name);
|
|
|
|
bool setShaderConstantID(EBurningUniformFlags flags, s32 index, const void* data, size_t u32_count);
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
video::CImage* RenderTarget;
|
|
|
|
CDepthBuffer* DepthBuffer;
|
2020-02-22 21:48:12 +01:00
|
|
|
CStencilBuffer* Stencil;
|
2019-12-12 17:32:41 +01:00
|
|
|
tVideoSample ColorMask;
|
|
|
|
|
|
|
|
sInternalTexture IT[ BURNING_MATERIAL_MAX_TEXTURES ];
|
|
|
|
|
|
|
|
static const tFixPointu dithermask[ 4 * 4];
|
2020-02-22 21:48:12 +01:00
|
|
|
|
|
|
|
//draw degenerate triangle as line (left edge) drawTriangle -> holes,drawLine dda/bresenham
|
2020-11-10 19:49:39 +01:00
|
|
|
size_t EdgeTestPass; //edge_test_flag
|
|
|
|
size_t EdgeTestPass_stack;
|
|
|
|
interlaced_control Interlaced; // passed from driver
|
2020-02-22 21:48:12 +01:00
|
|
|
|
|
|
|
eBurningStencilOp stencilOp[4];
|
|
|
|
tFixPoint AlphaRef;
|
|
|
|
int RenderPass_ShaderIsTransparent;
|
|
|
|
|
2020-11-10 21:29:55 +01:00
|
|
|
sScanConvertData ALIGN(16) scan;
|
2020-02-22 21:48:12 +01:00
|
|
|
sScanLineData line;
|
|
|
|
tVideoSample PrimitiveColor; //used if no color interpolation is defined
|
|
|
|
|
|
|
|
size_t /*eTransformLightFlags*/ TL_Flag;
|
|
|
|
tFixPoint fog_color[4];
|
|
|
|
tVideoSample fog_color_sample;
|
|
|
|
|
|
|
|
AbsRectangle Scissor;
|
2020-11-10 19:49:39 +01:00
|
|
|
|
|
|
|
inline tVideoSample color_to_sample(const video::SColor& color) const
|
|
|
|
{
|
|
|
|
//RenderTarget->getColorFormat()
|
|
|
|
#if SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT == ECF_A8R8G8B8
|
|
|
|
return color.color;
|
|
|
|
#else
|
|
|
|
return color.toA1R5G5B5();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-12-12 17:32:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
IBurningShader* createTriangleRendererTextureGouraud2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererTextureLightMap2_M1(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererTextureLightMap2_M2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererTextureLightMap2_M4(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererGTextureLightMap2_M4(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererTextureLightMap2_Add(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererTextureDetailMap2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererTextureVertexAlpha2(CBurningVideoDriver* driver);
|
|
|
|
|
|
|
|
|
|
|
|
IBurningShader* createTriangleRendererTextureGouraudWire2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererGouraud2(CBurningVideoDriver* driver);
|
2020-02-22 21:48:12 +01:00
|
|
|
IBurningShader* createTriangleRendererGouraudNoZ2(CBurningVideoDriver* driver);
|
2019-12-12 17:32:41 +01:00
|
|
|
IBurningShader* createTriangleRendererGouraudAlpha2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRGouraudAlphaNoZ2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererGouraudWire2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererTextureFlat2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTriangleRendererTextureFlatWire2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRFlat2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRFlatWire2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRTextureGouraudNoZ2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRTextureGouraudAdd2(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRTextureGouraudAddNoZ2(CBurningVideoDriver* driver);
|
|
|
|
|
|
|
|
IBurningShader* createTRTextureGouraudAlpha(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRTextureBlend(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRTextureInverseAlphaBlend(CBurningVideoDriver* driver);
|
|
|
|
|
|
|
|
IBurningShader* createTRNormalMap(CBurningVideoDriver* driver);
|
|
|
|
IBurningShader* createTRStencilShadow(CBurningVideoDriver* driver);
|
|
|
|
|
|
|
|
IBurningShader* createTriangleRendererReference(CBurningVideoDriver* driver);
|
2020-02-22 21:48:12 +01:00
|
|
|
IBurningShader* createTriangleRendererTexture_transparent_reflection_2_layer(CBurningVideoDriver* driver);
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
IBurningShader* create_burning_shader_color(CBurningVideoDriver* driver);
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
} // end namespace video
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|