2020-06-12 22:41:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
class burning_shader_class : public IBurningShader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! constructor
|
|
|
|
burning_shader_class(CBurningVideoDriver* driver);
|
|
|
|
|
|
|
|
//! draws an indexed triangle list
|
2021-08-27 21:14:39 +02:00
|
|
|
virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) IRR_OVERRIDE;
|
|
|
|
virtual bool canWireFrame() IRR_OVERRIDE { return true; }
|
2020-06-12 22:41:49 +02:00
|
|
|
|
2022-05-04 23:38:12 +02:00
|
|
|
virtual void OnSetMaterialBurning(const SBurningShaderMaterial& material) IRR_OVERRIDE;
|
2020-06-12 22:41:49 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
// fragment shader
|
|
|
|
typedef void (burning_shader_class::*tFragmentShader) ();
|
|
|
|
void fragment_depth_less_equal_depth_write_blend_one_zero();
|
|
|
|
void fragment_depth_less_equal_no_depth_write_blend_one_zero();
|
|
|
|
void fragment_nodepth_perspective_blend_one_zero();
|
|
|
|
void fragment_nodepth_noperspective_blend_one_zero(); // 2D Gradient
|
|
|
|
|
|
|
|
void fragment_depth_less_equal_depth_write_blend_src_alpha_one_minus_src_alpha();
|
|
|
|
void fragment_depth_less_equal_no_depth_write_blend_src_alpha_one_minus_src_alpha();
|
|
|
|
void fragment_nodepth_perspective_blend_src_alpha_one_minus_src_alpha();
|
|
|
|
void fragment_nodepth_noperspective_blend_src_alpha_one_minus_src_alpha();
|
|
|
|
|
2022-05-04 23:38:12 +02:00
|
|
|
void fragment_depth_less_equal_no_depth_write_colormask_none();
|
2020-06-12 22:41:49 +02:00
|
|
|
|
|
|
|
tFragmentShader fragmentShader;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//! constructor
|
2020-06-12 22:47:40 +02:00
|
|
|
burning_shader_class::burning_shader_class(CBurningVideoDriver* driver)
|
2022-05-04 23:38:12 +02:00
|
|
|
: IBurningShader(driver,EMT_SOLID)
|
2020-06-12 22:41:49 +02:00
|
|
|
{
|
|
|
|
#ifdef _DEBUG
|
|
|
|
setDebugName(burning_stringify(burning_shader_class) );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
fragmentShader = &burning_shader_class::fragment_depth_less_equal_depth_write_blend_one_zero;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IBurningShader* burning_create(burning_shader_class)(CBurningVideoDriver* driver)
|
|
|
|
{
|
|
|
|
return new burning_shader_class(driver);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// compile flag for this triangle
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define SUBTEXEL
|
|
|
|
#define IPOL_W
|
|
|
|
#define IPOL_C0
|
|
|
|
#define USE_ZBUFFER
|
|
|
|
#define CMP_W
|
|
|
|
#include "burning_shader_compile_triangle.h"
|
|
|
|
|
|
|
|
// compile flag for this scanline fragment
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define burning_shader_fragment fragment_nodepth_noperspective_blend_one_zero
|
|
|
|
#define SUBTEXEL
|
|
|
|
#define IPOL_C0
|
2022-05-04 23:38:12 +02:00
|
|
|
#define INVERSE_W_RANGE FIX_POINT_COLOR_MAX_CENTER
|
2020-06-12 22:41:49 +02:00
|
|
|
#include "burning_shader_compile_fragment_start.h"
|
|
|
|
#include burning_shader_frag
|
|
|
|
#include "burning_shader_compile_fragment_end.h"
|
|
|
|
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define burning_shader_fragment fragment_nodepth_perspective_blend_one_zero
|
|
|
|
#define SUBTEXEL
|
|
|
|
#define INVERSE_W
|
|
|
|
#define IPOL_W
|
|
|
|
#define IPOL_C0
|
2022-05-04 23:38:12 +02:00
|
|
|
#define INVERSE_W_RANGE FIX_POINT_COLOR_MAX_CENTER
|
2020-06-12 22:41:49 +02:00
|
|
|
#include "burning_shader_compile_fragment_start.h"
|
|
|
|
#include burning_shader_frag
|
|
|
|
#include "burning_shader_compile_fragment_end.h"
|
|
|
|
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define burning_shader_fragment fragment_depth_less_equal_no_depth_write_blend_one_zero
|
|
|
|
#define SUBTEXEL
|
|
|
|
#define INVERSE_W
|
|
|
|
#define IPOL_W
|
|
|
|
#define IPOL_C0
|
|
|
|
#define USE_ZBUFFER
|
|
|
|
#define CMP_W
|
2022-05-04 23:38:12 +02:00
|
|
|
#define INVERSE_W_RANGE FIX_POINT_COLOR_MAX_CENTER
|
2020-06-12 22:41:49 +02:00
|
|
|
#include "burning_shader_compile_fragment_start.h"
|
|
|
|
#include burning_shader_frag
|
|
|
|
#include "burning_shader_compile_fragment_end.h"
|
|
|
|
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define burning_shader_fragment fragment_depth_less_equal_depth_write_blend_one_zero
|
|
|
|
#define SUBTEXEL
|
|
|
|
#define INVERSE_W
|
|
|
|
#define IPOL_W
|
|
|
|
#define IPOL_C0
|
|
|
|
#define USE_ZBUFFER
|
|
|
|
#define CMP_W
|
|
|
|
#define WRITE_W
|
2022-05-04 23:38:12 +02:00
|
|
|
#define INVERSE_W_RANGE FIX_POINT_COLOR_MAX_CENTER
|
2020-06-12 22:41:49 +02:00
|
|
|
#include "burning_shader_compile_fragment_start.h"
|
|
|
|
#include burning_shader_frag
|
|
|
|
#include "burning_shader_compile_fragment_end.h"
|
|
|
|
|
|
|
|
|
|
|
|
// compile flag for this scanline fragment
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define burning_shader_fragment fragment_nodepth_noperspective_blend_src_alpha_one_minus_src_alpha
|
|
|
|
#define SUBTEXEL
|
|
|
|
#define IPOL_C0
|
|
|
|
#define IPOL_A0
|
2022-05-04 23:38:12 +02:00
|
|
|
#define INVERSE_W_RANGE FIX_POINT_COLOR_MAX_CENTER
|
2020-06-12 22:41:49 +02:00
|
|
|
#include "burning_shader_compile_fragment_start.h"
|
|
|
|
#include burning_shader_frag
|
|
|
|
#include "burning_shader_compile_fragment_end.h"
|
|
|
|
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define burning_shader_fragment fragment_nodepth_perspective_blend_src_alpha_one_minus_src_alpha
|
|
|
|
#define SUBTEXEL
|
|
|
|
#define INVERSE_W
|
|
|
|
#define IPOL_W
|
|
|
|
#define IPOL_C0
|
|
|
|
#define IPOL_A0
|
2022-05-04 23:38:12 +02:00
|
|
|
#define INVERSE_W_RANGE FIX_POINT_COLOR_MAX_CENTER
|
2020-06-12 22:41:49 +02:00
|
|
|
#include "burning_shader_compile_fragment_start.h"
|
|
|
|
#include burning_shader_frag
|
|
|
|
#include "burning_shader_compile_fragment_end.h"
|
|
|
|
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define burning_shader_fragment fragment_depth_less_equal_no_depth_write_blend_src_alpha_one_minus_src_alpha
|
|
|
|
#define SUBTEXEL
|
|
|
|
#define INVERSE_W
|
|
|
|
#define IPOL_W
|
|
|
|
#define IPOL_C0
|
|
|
|
#define IPOL_A0
|
|
|
|
#define USE_ZBUFFER
|
|
|
|
#define CMP_W
|
2022-05-04 23:38:12 +02:00
|
|
|
#define INVERSE_W_RANGE FIX_POINT_COLOR_MAX_CENTER
|
2020-06-12 22:41:49 +02:00
|
|
|
#include "burning_shader_compile_fragment_start.h"
|
|
|
|
#include burning_shader_frag
|
|
|
|
#include "burning_shader_compile_fragment_end.h"
|
|
|
|
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define burning_shader_fragment fragment_depth_less_equal_depth_write_blend_src_alpha_one_minus_src_alpha
|
|
|
|
#define SUBTEXEL
|
|
|
|
#define INVERSE_W
|
|
|
|
#define IPOL_W
|
|
|
|
#define IPOL_C0
|
|
|
|
#define IPOL_A0
|
|
|
|
#define USE_ZBUFFER
|
|
|
|
#define CMP_W
|
|
|
|
#define WRITE_W
|
2022-05-04 23:38:12 +02:00
|
|
|
#define INVERSE_W_RANGE FIX_POINT_COLOR_MAX_CENTER
|
|
|
|
#include "burning_shader_compile_fragment_start.h"
|
|
|
|
#include burning_shader_frag
|
|
|
|
#include "burning_shader_compile_fragment_end.h"
|
|
|
|
|
|
|
|
//occlusion query
|
|
|
|
#include "burning_shader_compile_start.h"
|
|
|
|
#define burning_shader_fragment fragment_depth_less_equal_no_depth_write_colormask_none
|
|
|
|
#define IPOL_W
|
|
|
|
#define USE_ZBUFFER
|
|
|
|
#define CMP_W
|
|
|
|
#define burning_shader_colormask
|
2020-06-12 22:41:49 +02:00
|
|
|
#include "burning_shader_compile_fragment_start.h"
|
|
|
|
#include burning_shader_frag
|
|
|
|
#include "burning_shader_compile_fragment_end.h"
|