2016-02-16 08:52:22 +00:00
|
|
|
#include "CElementGenShaders.hpp"
|
|
|
|
#include "CElementGen.hpp"
|
|
|
|
#include "CGenDescription.hpp"
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2016-02-16 08:52:22 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
static const char* VS_METAL_TEX =
|
2016-02-16 22:25:17 +00:00
|
|
|
"#include <metal_stdlib>\n"
|
|
|
|
"using namespace metal;\n"
|
|
|
|
"struct VertData\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 posIn[4];\n"
|
|
|
|
" float4 colorIn;\n"
|
|
|
|
" float4 uvsIn[4];\n"
|
|
|
|
"};\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"struct ParticleUniform\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4x4 mvp;\n"
|
|
|
|
" float4 moduColor;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4 position [[ position ]];\n"
|
|
|
|
" float4 color;\n"
|
|
|
|
" float2 uv;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"vertex VertToFrag vmain(constant VertData* va [[ buffer(1) ]],\n"
|
|
|
|
" uint vertId [[ vertex_id ]], uint instId [[ instance_id ]],\n"
|
|
|
|
" constant ParticleUniform& particle [[ buffer(2) ]])\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" VertToFrag vtf;\n"
|
|
|
|
" constant VertData& v = va[instId];\n"
|
|
|
|
" vtf.color = v.colorIn * particle.moduColor;\n"
|
|
|
|
" vtf.uv = v.uvsIn[vertId].xy;\n"
|
|
|
|
" vtf.position = particle.mvp * v.posIn[vertId];\n"
|
|
|
|
" return vtf;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* FS_METAL_TEX =
|
2016-02-16 22:25:17 +00:00
|
|
|
"#include <metal_stdlib>\n"
|
|
|
|
"using namespace metal;\n"
|
|
|
|
"constexpr sampler samp(address::repeat, filter::linear, mip_filter::linear);\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4 position [[ position ]];\n"
|
|
|
|
" float4 color;\n"
|
|
|
|
" float2 uv;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]],\n"
|
|
|
|
" texture2d<float> tex0 [[ texture(0) ]])\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" return vtf.color * tex0.sample(samp, vtf.uv);\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* FS_METAL_TEX_REDTOALPHA =
|
2016-02-16 22:25:17 +00:00
|
|
|
"#include <metal_stdlib>\n"
|
|
|
|
"using namespace metal;\n"
|
|
|
|
"constexpr sampler samp(address::repeat, filter::linear, mip_filter::linear);\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4 position [[ position ]];\n"
|
|
|
|
" float4 color;\n"
|
|
|
|
" float2 uv;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]],\n"
|
|
|
|
" texture2d<float> tex0 [[ texture(0) ]])\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 colr = vtf.color * tex0.sample(samp, vtf.uv);\n"
|
|
|
|
" return float4(colr.rgb, colr.r);"
|
2016-02-16 08:52:22 +00:00
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* VS_METAL_INDTEX =
|
2016-02-16 22:25:17 +00:00
|
|
|
"#include <metal_stdlib>\n"
|
|
|
|
"using namespace metal;\n"
|
|
|
|
"struct VertData\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 posIn[4];\n"
|
|
|
|
" float4 colorIn;\n"
|
|
|
|
" float4 uvsInTexrTind[4];\n"
|
2016-02-26 08:03:20 +00:00
|
|
|
" float4 uvsInScene;\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"};\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"struct ParticleUniform\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4x4 mvp;\n"
|
|
|
|
" float4 moduColor;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4 position [[ position ]];\n"
|
|
|
|
" float4 color;\n"
|
2016-02-26 08:03:20 +00:00
|
|
|
" float4 uvScene;\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float2 uvTexr;\n"
|
|
|
|
" float2 uvTind;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"vertex VertToFrag vmain(constant VertData* va [[ buffer(1) ]],\n"
|
|
|
|
" uint vertId [[ vertex_id ]], uint instId [[ instance_id ]],\n"
|
|
|
|
" constant ParticleUniform& particle [[ buffer(2) ]])\n"
|
|
|
|
"{\n"
|
|
|
|
" VertToFrag vtf;\n"
|
|
|
|
" constant VertData& v = va[instId];\n"
|
|
|
|
" vtf.color = v.colorIn * particle.moduColor;\n"
|
2016-02-26 08:03:20 +00:00
|
|
|
" vtf.uvScene = v.uvsInScene * float4(1.0, -1.0, 1.0, -1.0);\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" vtf.uvTexr = v.uvsInTexrTind[vertId].xy;\n"
|
|
|
|
" vtf.uvTind = v.uvsInTexrTind[vertId].zw;\n"
|
|
|
|
" vtf.position = particle.mvp * v.posIn[vertId];\n"
|
|
|
|
" return vtf;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* FS_METAL_INDTEX =
|
2016-02-16 22:25:17 +00:00
|
|
|
"#include <metal_stdlib>\n"
|
|
|
|
"using namespace metal;\n"
|
|
|
|
"constexpr sampler samp(address::repeat, filter::linear, mip_filter::linear);\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4 position [[ position ]];\n"
|
|
|
|
" float4 color;\n"
|
2016-02-26 08:03:20 +00:00
|
|
|
" float4 uvScene;\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float2 uvTexr;\n"
|
|
|
|
" float2 uvTind;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]],\n"
|
|
|
|
" texture2d<float> tex0 [[ texture(0) ]],\n"
|
|
|
|
" texture2d<float> tex1 [[ texture(1) ]],\n"
|
|
|
|
" texture2d<float> tex2 [[ texture(2) ]])\n"
|
|
|
|
"{\n"
|
|
|
|
" float2 tindTexel = tex2.sample(samp, vtf.uvTind).ba;\n"
|
2016-02-26 08:03:20 +00:00
|
|
|
" float4 sceneTexel = tex1.sample(samp, mix(vtf.uvScene.xy, vtf.uvScene.zw, tindTexel));\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4 texrTexel = tex0.sample(samp, vtf.uvTexr);\n"
|
|
|
|
" float4 colr = vtf.color * sceneTexel + texrTexel;\n"
|
|
|
|
" return float4(colr.rgb, vtf.color.a * texrTexel.a);"
|
2016-02-16 08:52:22 +00:00
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* FS_METAL_CINDTEX =
|
2016-02-16 22:25:17 +00:00
|
|
|
"#include <metal_stdlib>\n"
|
|
|
|
"using namespace metal;\n"
|
|
|
|
"constexpr sampler samp(address::repeat, filter::linear, mip_filter::linear);\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4 position [[ position ]];\n"
|
|
|
|
" float4 color;\n"
|
2016-02-26 08:03:20 +00:00
|
|
|
" float4 uvScene;\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float2 uvTexr;\n"
|
|
|
|
" float2 uvTind;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]],\n"
|
|
|
|
" texture2d<float> tex0 [[ texture(0) ]],\n"
|
|
|
|
" texture2d<float> tex1 [[ texture(1) ]],\n"
|
|
|
|
" texture2d<float> tex2 [[ texture(2) ]])\n"
|
|
|
|
"{\n"
|
|
|
|
" float2 tindTexel = tex2.sample(samp, vtf.uvTind).ba;\n"
|
2016-02-26 08:03:20 +00:00
|
|
|
" float4 sceneTexel = tex1.sample(samp, mix(vtf.uvScene.xy, vtf.uvScene.zw, tindTexel));\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" return vtf.color * sceneTexel * tex0.sample(samp, vtf.uvTexr);\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* VS_METAL_NOTEX =
|
2016-02-16 22:25:17 +00:00
|
|
|
"#include <metal_stdlib>\n"
|
|
|
|
"using namespace metal;\n"
|
|
|
|
"struct VertData\n"
|
|
|
|
"{\n"
|
|
|
|
" float4 posIn[4];\n"
|
|
|
|
" float4 colorIn;\n"
|
|
|
|
"};\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"struct ParticleUniform\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4x4 mvp;\n"
|
|
|
|
" float4 moduColor;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4 position [[ position ]];\n"
|
|
|
|
" float4 color;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"vertex VertToFrag vmain(constant VertData* va [[ buffer(1) ]],\n"
|
|
|
|
" uint vertId [[ vertex_id ]], uint instId [[ instance_id ]],\n"
|
|
|
|
" constant ParticleUniform& particle [[ buffer(2) ]])\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" VertToFrag vtf;\n"
|
|
|
|
" constant VertData& v = va[instId];\n"
|
|
|
|
" vtf.color = v.colorIn * particle.moduColor;\n"
|
|
|
|
" vtf.position = particle.mvp * v.posIn[vertId];\n"
|
|
|
|
" return vtf;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"}\n";
|
|
|
|
|
|
|
|
static const char* FS_METAL_NOTEX =
|
2016-02-16 22:25:17 +00:00
|
|
|
"#include <metal_stdlib>\n"
|
|
|
|
"using namespace metal;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"struct VertToFrag\n"
|
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" float4 position [[ position ]];\n"
|
|
|
|
" float4 color;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"};\n"
|
|
|
|
"\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]])\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"{\n"
|
2016-02-16 22:25:17 +00:00
|
|
|
" return vtf.color;\n"
|
2016-02-16 08:52:22 +00:00
|
|
|
"}\n";
|
|
|
|
|
2016-02-18 02:42:32 +00:00
|
|
|
struct MetalElementDataBindingFactory : CElementGenShaders::IDataBindingFactory
|
2016-02-16 08:52:22 +00:00
|
|
|
{
|
2016-03-30 21:08:54 +00:00
|
|
|
void BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
|
|
|
CElementGen& gen,
|
2016-02-16 08:52:22 +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-16 08:52:22 +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 21:08:54 +00:00
|
|
|
gen.m_normalDataBind = ctx.newShaderDataBinding(regPipeline, nullptr, nullptr,
|
|
|
|
gen.m_instBuf, nullptr, 1, uniforms,
|
2016-04-04 06:16:03 +00:00
|
|
|
nullptr, texCount, textures);
|
2016-02-16 08:52:22 +00:00
|
|
|
if (redToAlphaPipeline)
|
2016-03-30 21:08:54 +00:00
|
|
|
gen.m_redToAlphaDataBind = ctx.newShaderDataBinding(redToAlphaPipeline, nullptr, nullptr,
|
|
|
|
gen.m_instBuf, nullptr, 1, uniforms,
|
2016-04-04 06:16:03 +00:00
|
|
|
nullptr, texCount, textures);
|
2016-02-16 08:52:22 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-03-30 21:08:54 +00:00
|
|
|
CElementGenShaders::IDataBindingFactory* CElementGenShaders::Initialize(boo::MetalDataFactory::Context& ctx)
|
2016-02-16 08:52:22 +00:00
|
|
|
{
|
2016-02-16 22:25:17 +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 21:08:54 +00:00
|
|
|
m_vtxFormatTex = ctx.newVertexFormat(9, TexFmtTex);
|
2016-02-16 22:25:17 +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 08:03:20 +00:00
|
|
|
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 4}
|
2016-02-16 22:25:17 +00:00
|
|
|
};
|
2016-03-30 21:08:54 +00:00
|
|
|
m_vtxFormatIndTex = ctx.newVertexFormat(10, TexFmtIndTex);
|
2016-02-16 22:25:17 +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 21:08:54 +00:00
|
|
|
m_vtxFormatNoTex = ctx.newVertexFormat(5, TexFmtNoTex);
|
2016-02-16 22:25:17 +00:00
|
|
|
|
2016-03-30 21:08:54 +00:00
|
|
|
m_texZTestZWrite = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX, m_vtxFormatTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, true, true, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_texNoZTestZWrite = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX, m_vtxFormatTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, true, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_texZTestNoZWrite = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX, m_vtxFormatTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, true, false, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_texNoZTestNoZWrite = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX, m_vtxFormatTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, false, false);
|
2016-02-16 08:52:22 +00:00
|
|
|
|
2016-03-30 21:08:54 +00:00
|
|
|
m_texAdditiveZTest = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX, m_vtxFormatTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, true, false, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_texAdditiveNoZTest = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX, m_vtxFormatTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, false, false);
|
2016-02-16 08:52:22 +00:00
|
|
|
|
2016-03-30 21:08:54 +00:00
|
|
|
m_texRedToAlphaZTest = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX_REDTOALPHA, m_vtxFormatTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, true, false, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_texRedToAlphaNoZTest = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX_REDTOALPHA, m_vtxFormatTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, false, false);
|
2016-02-16 08:52:22 +00:00
|
|
|
|
2016-03-30 21:08:54 +00:00
|
|
|
m_indTexZWrite = ctx.newShaderPipeline(VS_METAL_INDTEX, FS_METAL_INDTEX, m_vtxFormatIndTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, true, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_indTexNoZWrite = ctx.newShaderPipeline(VS_METAL_INDTEX, FS_METAL_INDTEX, m_vtxFormatIndTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, false, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_indTexAdditive = ctx.newShaderPipeline(VS_METAL_INDTEX, FS_METAL_INDTEX, m_vtxFormatIndTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, true, false);
|
2016-02-16 08:52:22 +00:00
|
|
|
|
2016-03-30 21:08:54 +00:00
|
|
|
m_cindTexZWrite = ctx.newShaderPipeline(VS_METAL_INDTEX, FS_METAL_CINDTEX, m_vtxFormatIndTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, true, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_cindTexNoZWrite = ctx.newShaderPipeline(VS_METAL_INDTEX, FS_METAL_CINDTEX, m_vtxFormatIndTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, false, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_cindTexAdditive = ctx.newShaderPipeline(VS_METAL_INDTEX, FS_METAL_CINDTEX, m_vtxFormatIndTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, true, false);
|
2016-02-16 08:52:22 +00:00
|
|
|
|
2016-03-30 21:08:54 +00:00
|
|
|
m_noTexZTestZWrite = ctx.newShaderPipeline(VS_METAL_NOTEX, FS_METAL_NOTEX, m_vtxFormatNoTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, true, true, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_noTexNoZTestZWrite = ctx.newShaderPipeline(VS_METAL_NOTEX, FS_METAL_NOTEX, m_vtxFormatNoTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, true, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_noTexZTestNoZWrite = ctx.newShaderPipeline(VS_METAL_NOTEX, FS_METAL_NOTEX, m_vtxFormatNoTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, true, false, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_noTexNoZTestNoZWrite = ctx.newShaderPipeline(VS_METAL_NOTEX, FS_METAL_NOTEX, m_vtxFormatNoTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, false, false);
|
2016-02-16 08:52:22 +00:00
|
|
|
|
2016-03-30 21:08:54 +00:00
|
|
|
m_noTexAdditiveZTest = ctx.newShaderPipeline(VS_METAL_NOTEX, FS_METAL_NOTEX, m_vtxFormatNoTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, true, false, false);
|
2016-03-30 21:08:54 +00:00
|
|
|
m_noTexAdditiveNoZTest = ctx.newShaderPipeline(VS_METAL_NOTEX, FS_METAL_NOTEX, m_vtxFormatNoTex,
|
2016-02-16 08:52:22 +00:00
|
|
|
CGraphics::g_ViewportSamples,
|
|
|
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
2016-03-24 08:07:22 +00:00
|
|
|
boo::Primitive::TriStrips, false, false, false);
|
2016-02-16 08:52:22 +00:00
|
|
|
|
2016-02-18 02:42:32 +00:00
|
|
|
return new struct MetalElementDataBindingFactory;
|
2016-02-16 08:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|