2016-02-17 03:42:27 +00:00
|
|
|
#include "CElementGenShaders.hpp"
|
|
|
|
#include "CElementGen.hpp"
|
|
|
|
#include "CGenDescription.hpp"
|
2016-02-17 05:20:34 +00:00
|
|
|
#include "CElectricDescription.hpp"
|
|
|
|
#include "CSwooshDescription.hpp"
|
2016-03-04 23:04:53 +00:00
|
|
|
#include "Graphics/CModel.hpp"
|
2016-02-17 03:42:27 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2016-02-17 03:42:27 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
static const char* VS_HLSL_TEX =
|
|
|
|
"struct VertData\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 posIn[4] : POSITION;\n"
|
|
|
|
" float4 colorIn : COLOR;\n"
|
|
|
|
" float4 uvsIn[4] : UV;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"cbuffer ParticleUniform : register(b0)\n"
|
|
|
|
"{\n"
|
|
|
|
" float4x4 mvp;\n"
|
|
|
|
" float4 moduColor;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 position : SV_Position;\n"
|
|
|
|
" float4 color : COLOR;\n"
|
|
|
|
" float2 uv : UV;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"VertToFrag main(in VertData v, in uint vertId : SV_VertexID)\n"
|
|
|
|
"{\n"
|
|
|
|
" VertToFrag vtf;\n"
|
|
|
|
" vtf.color = v.colorIn * moduColor;\n"
|
|
|
|
" vtf.uv = v.uvsIn[vertId].xy;\n"
|
|
|
|
" vtf.position = mul(mvp, v.posIn[vertId]);\n"
|
|
|
|
" return vtf;\n"
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* FS_HLSL_TEX =
|
|
|
|
"SamplerState samp : register(s0);\n"
|
|
|
|
"Texture2D tex0 : register(t0);\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 position : SV_Position;\n"
|
|
|
|
" float4 color : COLOR;\n"
|
|
|
|
" float2 uv : UV;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"float4 main(in VertToFrag vtf) : SV_Target0\n"
|
|
|
|
"{\n"
|
|
|
|
" return vtf.color * tex0.Sample(samp, vtf.uv);\n"
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* FS_HLSL_TEX_REDTOALPHA =
|
|
|
|
"SamplerState samp : register(s0);\n"
|
|
|
|
"Texture2D tex0 : register(t0);\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 position : SV_Position;\n"
|
|
|
|
" float4 color : COLOR;\n"
|
|
|
|
" float2 uv : UV;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"float4 main(in VertToFrag vtf) : SV_Target0\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 colr = vtf.color * tex0.Sample(samp, vtf.uv);\n"
|
|
|
|
" return float4(colr.rgb, colr.r);"
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* VS_HLSL_INDTEX =
|
|
|
|
"struct VertData\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 posIn[4] : POSITION;\n"
|
|
|
|
" float4 colorIn : COLOR;\n"
|
|
|
|
" float4 uvsInTexrTind[4] : UV0;\n"
|
2016-02-26 00:12:52 +00:00
|
|
|
" float4 uvsInScene : UV4;\n"
|
2016-02-17 03:42:27 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"cbuffer ParticleUniform : register(b0)\n"
|
|
|
|
"{\n"
|
|
|
|
" float4x4 mvp;\n"
|
|
|
|
" float4 moduColor;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 position : SV_Position;\n"
|
|
|
|
" float4 color : COLOR;\n"
|
2016-02-26 00:12:52 +00:00
|
|
|
" float4 uvScene : UV0;\n"
|
|
|
|
" float2 uvTexr : UV1;\n"
|
2016-02-17 03:42:27 +00:00
|
|
|
" float2 uvTind : UV2;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"VertToFrag main(in VertData v, in uint vertId : SV_VertexID)\n"
|
|
|
|
"{\n"
|
|
|
|
" VertToFrag vtf;\n"
|
|
|
|
" vtf.color = v.colorIn * moduColor;\n"
|
2016-02-26 05:38:11 +00:00
|
|
|
" vtf.uvScene = v.uvsInScene * float4(1.0, -1.0, 1.0, -1.0);\n"
|
2016-02-17 03:42:27 +00:00
|
|
|
" vtf.uvTexr = v.uvsInTexrTind[vertId].xy;\n"
|
|
|
|
" vtf.uvTind = v.uvsInTexrTind[vertId].zw;\n"
|
|
|
|
" vtf.position = mul(mvp, v.posIn[vertId]);\n"
|
|
|
|
" return vtf;\n"
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* FS_HLSL_INDTEX =
|
|
|
|
"SamplerState samp : register(s0);\n"
|
|
|
|
"Texture2D tex0 : register(t0);\n"
|
|
|
|
"Texture2D tex1 : register(t1);\n"
|
|
|
|
"Texture2D tex2 : register(t2);\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 position : SV_Position;\n"
|
|
|
|
" float4 color : COLOR;\n"
|
2016-02-26 00:12:52 +00:00
|
|
|
" float4 uvScene : UV0;\n"
|
|
|
|
" float2 uvTexr : UV1;\n"
|
2016-02-17 03:42:27 +00:00
|
|
|
" float2 uvTind : UV2;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"float4 main(in VertToFrag vtf) : SV_Target0\n"
|
|
|
|
"{\n"
|
2016-02-26 00:12:52 +00:00
|
|
|
" float2 tindTexel = tex2.Sample(samp, vtf.uvTind).zw;\n"
|
|
|
|
" float4 sceneTexel = tex1.Sample(samp, lerp(vtf.uvScene.xy, vtf.uvScene.zw, tindTexel));\n"
|
2016-02-17 03:42:27 +00:00
|
|
|
" float4 texrTexel = tex0.Sample(samp, vtf.uvTexr);\n"
|
2016-02-26 00:12:52 +00:00
|
|
|
" float4 colorOut = vtf.color * sceneTexel + texrTexel;\n"
|
|
|
|
" colorOut.a = vtf.color.a * texrTexel.a;\n"
|
|
|
|
" return colorOut;\n"
|
2016-02-17 03:42:27 +00:00
|
|
|
"}\n";
|
|
|
|
|
2016-02-26 00:12:52 +00:00
|
|
|
static const char* FS_HLSL_CINDTEX =
|
2016-02-17 03:42:27 +00:00
|
|
|
"SamplerState samp : register(s0);\n"
|
|
|
|
"Texture2D tex0 : register(t0);\n"
|
|
|
|
"Texture2D tex1 : register(t1);\n"
|
|
|
|
"Texture2D tex2 : register(t2);\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 position : SV_Position;\n"
|
|
|
|
" float4 color : COLOR;\n"
|
2016-02-26 00:12:52 +00:00
|
|
|
" float4 uvScene : UV0;\n"
|
|
|
|
" float2 uvTexr : UV1;\n"
|
2016-02-17 03:42:27 +00:00
|
|
|
" float2 uvTind : UV2;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"float4 main(in VertToFrag vtf) : SV_Target0\n"
|
|
|
|
"{\n"
|
|
|
|
" float2 tindTexel = tex2.Sample(samp, vtf.uvTind).ba;\n"
|
2016-02-26 00:12:52 +00:00
|
|
|
" float4 sceneTexel = tex1.Sample(samp, lerp(vtf.uvScene.xy, vtf.uvScene.zw, tindTexel));\n"
|
2016-02-17 03:42:27 +00:00
|
|
|
" return vtf.color * sceneTexel * tex0.Sample(samp, vtf.uvTexr);\n"
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* VS_HLSL_NOTEX =
|
|
|
|
"struct VertData\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 posIn[4] : POSITION;\n"
|
|
|
|
" float4 colorIn : COLOR;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"cbuffer ParticleUniform : register(b0)\n"
|
|
|
|
"{\n"
|
|
|
|
" float4x4 mvp;\n"
|
|
|
|
" float4 moduColor;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 position : SV_Position;\n"
|
|
|
|
" float4 color : COLOR;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"VertToFrag main(in VertData v, in uint vertId : SV_VertexID)\n"
|
|
|
|
"{\n"
|
|
|
|
" VertToFrag vtf;\n"
|
|
|
|
" vtf.color = v.colorIn * moduColor;\n"
|
|
|
|
" vtf.position = mul(mvp, v.posIn[vertId]);\n"
|
|
|
|
" return vtf;\n"
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* FS_HLSL_NOTEX =
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 position : SV_Position;\n"
|
|
|
|
" float4 color : COLOR;\n"
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"float4 main(in VertToFrag vtf) : SV_Target0\n"
|
|
|
|
"{\n"
|
|
|
|
" return vtf.color;\n"
|
|
|
|
"}\n";
|
|
|
|
|
2016-02-18 02:42:32 +00:00
|
|
|
struct D3DElementDataBindingFactory : CElementGenShaders::IDataBindingFactory
|
2016-02-17 03:42:27 +00:00
|
|
|
{
|
2016-03-30 20:44:19 +00:00
|
|
|
void BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
|
|
|
CElementGen& gen,
|
2016-02-17 03:42:27 +00:00
|
|
|
boo::IShaderPipeline* regPipeline,
|
|
|
|
boo::IShaderPipeline* redToAlphaPipeline)
|
|
|
|
{
|
|
|
|
CGenDescription* desc = gen.GetDesc();
|
|
|
|
|
2016-03-03 01:06:42 +00:00
|
|
|
CUVElement* texr = desc->x54_x40_TEXR.get();
|
|
|
|
CUVElement* tind = desc->x58_x44_TIND.get();
|
2016-02-17 03:42:27 +00:00
|
|
|
int texCount = 0;
|
|
|
|
boo::ITexture* textures[3];
|
|
|
|
|
|
|
|
if (texr)
|
|
|
|
{
|
|
|
|
textures[0] = texr->GetValueTexture(0).GetObj()->GetBooTexture();
|
|
|
|
texCount = 1;
|
|
|
|
if (tind)
|
|
|
|
{
|
|
|
|
textures[1] = CGraphics::g_SpareTexture;
|
|
|
|
textures[2] = tind->GetValueTexture(0).GetObj()->GetBooTexture();
|
|
|
|
texCount = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
boo::IGraphicsBuffer* uniforms[] = {gen.m_uniformBuf};
|
|
|
|
|
|
|
|
if (regPipeline)
|
2016-03-30 20:44:19 +00:00
|
|
|
gen.m_normalDataBind = ctx.newShaderDataBinding(regPipeline, nullptr, nullptr,
|
|
|
|
gen.m_instBuf, nullptr, 1, uniforms,
|
2017-03-17 23:33:02 +00:00
|
|
|
nullptr, texCount, textures,
|
|
|
|
nullptr, nullptr);
|
2016-02-17 03:42:27 +00:00
|
|
|
if (redToAlphaPipeline)
|
2016-03-30 20:44:19 +00:00
|
|
|
gen.m_redToAlphaDataBind = ctx.newShaderDataBinding(redToAlphaPipeline, nullptr, nullptr,
|
|
|
|
gen.m_instBuf, nullptr, 1, uniforms,
|
2017-03-17 23:33:02 +00:00
|
|
|
nullptr, texCount, textures,
|
|
|
|
nullptr, nullptr);
|
2016-02-17 03:42:27 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-03-30 20:44:19 +00:00
|
|
|
CElementGenShaders::IDataBindingFactory* CElementGenShaders::Initialize(boo::ID3DDataFactory::Context& ctx)
|
2016-02-17 03:42:27 +00:00
|
|
|
{
|
|
|
|
static const boo::VertexElementDescriptor TexFmtTex[] =
|
|
|
|
{
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 1},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 2},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 3},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 0},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 1},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 2},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 3}
|
|
|
|
};
|
2016-03-30 20:44:19 +00:00
|
|
|
m_vtxFormatTex = ctx.newVertexFormat(9, TexFmtTex);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
|
|
|
static const boo::VertexElementDescriptor TexFmtIndTex[] =
|
|
|
|
{
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 1},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 2},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 3},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 0},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 1},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 2},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 3},
|
2016-02-26 00:12:52 +00:00
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 4}
|
2016-02-17 03:42:27 +00:00
|
|
|
};
|
2016-03-30 20:44:19 +00:00
|
|
|
m_vtxFormatIndTex = ctx.newVertexFormat(10, TexFmtIndTex);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
|
|
|
static const boo::VertexElementDescriptor TexFmtNoTex[] =
|
|
|
|
{
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 1},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 2},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 3},
|
|
|
|
{nullptr, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced}
|
|
|
|
};
|
2016-03-30 20:44:19 +00:00
|
|
|
m_vtxFormatNoTex = ctx.newVertexFormat(5, TexFmtNoTex);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
2017-03-05 23:03:23 +00:00
|
|
|
m_texZTestZWrite = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::LEqual, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_texNoZTestZWrite = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_texZTestNoZWrite = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::LEqual, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_texNoZTestNoZWrite = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
2017-03-05 23:03:23 +00:00
|
|
|
m_texAdditiveZTest = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::LEqual, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_texAdditiveNoZTest = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
2017-03-05 23:03:23 +00:00
|
|
|
m_texRedToAlphaZTest = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX_REDTOALPHA, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::LEqual, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_texRedToAlphaNoZTest = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX_REDTOALPHA, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
2017-03-05 23:03:23 +00:00
|
|
|
m_indTexZWrite = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_INDTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatIndTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_indTexNoZWrite = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_INDTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatIndTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_indTexAdditive = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_INDTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatIndTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
2017-03-05 23:03:23 +00:00
|
|
|
m_cindTexZWrite = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_CINDTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatIndTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_cindTexNoZWrite = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_CINDTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatIndTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_cindTexAdditive = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_CINDTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatIndTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
2017-03-05 23:03:23 +00:00
|
|
|
m_noTexZTestZWrite = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatNoTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::LEqual, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_noTexNoZTestZWrite = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatNoTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_noTexZTestNoZWrite = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatNoTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::LEqual, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_noTexNoZTestNoZWrite = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatNoTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, false,
|
|
|
|
true, false, boo::CullMode::None);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
2017-03-05 23:03:23 +00:00
|
|
|
m_noTexAdditiveZTest = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatNoTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::LEqual, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2017-03-05 23:03:23 +00:00
|
|
|
m_noTexAdditiveNoZTest = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr,
|
2017-03-10 20:52:53 +00:00
|
|
|
nullptr, m_vtxFormatNoTex,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2017-03-17 23:33:02 +00:00
|
|
|
boo::Primitive::TriStrips, boo::ZTest::None, true,
|
|
|
|
true, false, boo::CullMode::None);
|
2016-02-17 03:42:27 +00:00
|
|
|
|
2016-02-18 02:42:32 +00:00
|
|
|
return new struct D3DElementDataBindingFactory;
|
2016-02-17 03:42:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|