mirror of https://github.com/AxioDL/metaforce.git
D3D CElementGen rendering
This commit is contained in:
parent
468db3b203
commit
13e3afa72f
|
@ -85,7 +85,7 @@ add_definitions(-DZE_ATHENA_TYPES=1)
|
|||
set(MATHLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libSpecter/MathLib/include)
|
||||
include_directories(${ATHENA_INCLUDE_DIR} ${LOG_VISOR_INCLUDE_DIR} ${HECL_INCLUDE_DIR}
|
||||
${NODLIB_INCLUDE_DIR} ${MATHLIB_INCLUDE_DIR} ${BOO_INCLUDE_DIR}
|
||||
${SPECTER_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
${SPECTER_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_subdirectory(DataSpec)
|
||||
add_subdirectory(Editor)
|
||||
add_subdirectory(Runtime)
|
||||
|
|
|
@ -43,10 +43,10 @@ Specter::View* Space::buildSpaceView(Specter::ViewResources& res)
|
|||
|
||||
std::vector<Space::SpaceMenuNode::SubNodeData> Space::SpaceMenuNode::s_subNodeDats =
|
||||
{
|
||||
{Class::ResourceBrowser, "resource_browser", "Resource Browser", GetIcon(SpaceIcon::ResourceBrowser), {0.0,1.0,0.0,1.0}},
|
||||
{Class::EffectEditor, "effect_editor", "Effect Editor", GetIcon(SpaceIcon::ParticleEditor), {1.0,0.5,0.0,1.0}},
|
||||
{Class::ModelViewer, "model_viewer", "Model Viewer", GetIcon(SpaceIcon::ModelViewer), {0.95, 0.95, 0.95, 1.0}},
|
||||
{Class::InformationCenter, "information_center", "Information Center", GetIcon(SpaceIcon::InformationCenter), {0.0, 1.0, 1.0, 1.0}}
|
||||
{Class::ResourceBrowser, "resource_browser", "Resource Browser", GetIcon(SpaceIcon::ResourceBrowser), {0.0f, 1.0f, 0.0f, 1.0f}},
|
||||
{Class::EffectEditor, "effect_editor", "Effect Editor", GetIcon(SpaceIcon::ParticleEditor), {1.0f, 0.5f, 0.0f, 1.0f}},
|
||||
{Class::ModelViewer, "model_viewer", "Model Viewer", GetIcon(SpaceIcon::ModelViewer), {0.95f, 0.95f, 0.95f, 1.0f}},
|
||||
{Class::InformationCenter, "information_center", "Information Center", GetIcon(SpaceIcon::InformationCenter), {0.0f, 1.0f, 1.0f, 1.0f}}
|
||||
};
|
||||
std::string Space::SpaceMenuNode::s_text = "Space Types";
|
||||
|
||||
|
|
|
@ -51,10 +51,8 @@ struct Application : boo::IApplicationCallback
|
|||
Zeus::detectCPU();
|
||||
|
||||
const Zeus::CPUInfo& cpuInf = Zeus::cpuFeatures();
|
||||
HECL::SystemString cpuName{reinterpret_cast<const char*>(cpuInf.cpuBrand)};
|
||||
HECL::SystemString cpuVendor{reinterpret_cast<const char*>(cpuInf.cpuVendor)};
|
||||
Log.report(LogVisor::Info, _S("CPU Name: %s"), cpuName.c_str());
|
||||
Log.report(LogVisor::Info, _S("CPU Vendor: %s"), cpuVendor.c_str());
|
||||
Log.report(LogVisor::Info, "CPU Name: %s", cpuInf.cpuBrand);
|
||||
Log.report(LogVisor::Info, "CPU Vendor: %s", cpuInf.cpuVendor);
|
||||
HECL::SystemString features;
|
||||
if (cpuInf.AESNI)
|
||||
features += _S("AES-NI");
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace pshag
|
||||
{
|
||||
class SObjectTag;
|
||||
struct SObjectTag;
|
||||
class CVParamTransfer;
|
||||
class IObj;
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#include "CGraphics.hpp"
|
||||
#include <Math.hpp>
|
||||
|
||||
#undef near
|
||||
#undef far
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
|
||||
|
|
|
@ -0,0 +1,359 @@
|
|||
#include "CElementGenShaders.hpp"
|
||||
#include "CElementGen.hpp"
|
||||
#include "CGenDescription.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
|
||||
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"
|
||||
" float4 uvsInScene[4] : UV4;\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 uvTexr : UV0;\n"
|
||||
" float2 uvScene : UV1;\n"
|
||||
" 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"
|
||||
" vtf.uvTexr = v.uvsInTexrTind[vertId].xy;\n"
|
||||
" vtf.uvScene = v.uvsInScene[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"
|
||||
" float2 uvTexr : UV0;\n"
|
||||
" float2 uvScene : UV1;\n"
|
||||
" float2 uvTind : UV2;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"float4 main(in VertToFrag vtf) : SV_Target0\n"
|
||||
"{\n"
|
||||
" float2 tindTexel = tex2.Sample(samp, vtf.uvTind).ba;\n"
|
||||
" float4 sceneTexel = tex1.Sample(samp, vtf.uvScene + tindTexel);\n"
|
||||
" float4 texrTexel = tex0.Sample(samp, vtf.uvTexr);\n"
|
||||
" float4 colr = vtf.color * sceneTexel + texrTexel;\n"
|
||||
" return float4(colr.rgb, vtf.color.a * texrTexel.a);"
|
||||
"}\n";
|
||||
|
||||
static const char* FS_METAL_CINDTEX =
|
||||
"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"
|
||||
" float2 uvTexr : UV0;\n"
|
||||
" float2 uvScene : UV1;\n"
|
||||
" float2 uvTind : UV2;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"float4 main(in VertToFrag vtf) : SV_Target0\n"
|
||||
"{\n"
|
||||
" float2 tindTexel = tex2.Sample(samp, vtf.uvTind).ba;\n"
|
||||
" float4 sceneTexel = tex1.Sample(samp, vtf.uvScene + tindTexel);\n"
|
||||
" 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";
|
||||
|
||||
struct D3DDataBindingFactory : CElementGenShaders::IDataBindingFactory
|
||||
{
|
||||
void BuildShaderDataBinding(CElementGen& gen,
|
||||
boo::IShaderPipeline* regPipeline,
|
||||
boo::IShaderPipeline* redToAlphaPipeline)
|
||||
{
|
||||
CGenDescription* desc = gen.GetDesc();
|
||||
|
||||
CUVElement* texr = desc->x54_TEXR.get();
|
||||
CUVElement* tind = desc->x58_TIND.get();
|
||||
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)
|
||||
gen.m_normalDataBind = CGraphics::g_BooFactory->newShaderDataBinding(regPipeline, nullptr, nullptr,
|
||||
gen.m_instBuf, nullptr, 1, uniforms,
|
||||
texCount, textures);
|
||||
if (redToAlphaPipeline)
|
||||
gen.m_redToAlphaDataBind = CGraphics::g_BooFactory->newShaderDataBinding(redToAlphaPipeline, nullptr, nullptr,
|
||||
gen.m_instBuf, nullptr, 1, uniforms,
|
||||
texCount, textures);
|
||||
}
|
||||
};
|
||||
|
||||
CElementGenShaders::IDataBindingFactory* CElementGenShaders::Initialize(boo::ID3DDataFactory& factory)
|
||||
{
|
||||
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}
|
||||
};
|
||||
m_vtxFormatTex = factory.newVertexFormat(9, TexFmtTex);
|
||||
|
||||
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},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 4},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 5},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 6},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 7}
|
||||
};
|
||||
m_vtxFormatIndTex = CGraphics::g_BooFactory->newVertexFormat(13, TexFmtIndTex);
|
||||
|
||||
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}
|
||||
};
|
||||
m_vtxFormatNoTex = CGraphics::g_BooFactory->newVertexFormat(5, TexFmtNoTex);
|
||||
|
||||
m_texZTestZWrite = factory.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
true, true, false);
|
||||
m_texNoZTestZWrite = factory.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
false, true, false);
|
||||
m_texZTestNoZWrite = factory.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
true, false, false);
|
||||
m_texNoZTestNoZWrite = factory.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
false, false, false);
|
||||
|
||||
m_texAdditiveZTest = factory.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
||||
true, false, false);
|
||||
m_texAdditiveNoZTest = factory.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
||||
false, false, false);
|
||||
|
||||
m_texRedToAlphaZTest = factory.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX_REDTOALPHA, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
true, false, false);
|
||||
m_texRedToAlphaNoZTest = factory.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX_REDTOALPHA, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
false, false, false);
|
||||
|
||||
m_indTexZWrite = factory.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_INDTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatIndTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
true, true, false);
|
||||
m_indTexNoZWrite = factory.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_INDTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatIndTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
true, false, false);
|
||||
m_indTexAdditive = factory.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_INDTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatIndTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
||||
true, true, false);
|
||||
|
||||
m_cindTexZWrite = factory.newShaderPipeline(VS_HLSL_INDTEX, FS_METAL_CINDTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatIndTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
true, true, false);
|
||||
m_cindTexNoZWrite = factory.newShaderPipeline(VS_HLSL_INDTEX, FS_METAL_CINDTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatIndTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
true, false, false);
|
||||
m_cindTexAdditive = factory.newShaderPipeline(VS_HLSL_INDTEX, FS_METAL_CINDTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatIndTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
||||
true, true, false);
|
||||
|
||||
m_noTexZTestZWrite = factory.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatNoTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
true, true, false);
|
||||
m_noTexNoZTestZWrite = factory.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatNoTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
false, true, false);
|
||||
m_noTexZTestNoZWrite = factory.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatNoTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
true, false, false);
|
||||
m_noTexNoZTestNoZWrite = factory.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatNoTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||
false, false, false);
|
||||
|
||||
m_noTexAdditiveZTest = factory.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatNoTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
||||
true, false, false);
|
||||
m_noTexAdditiveNoZTest = factory.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
|
||||
ComPtr<ID3DBlob>(), m_vtxFormatNoTex,
|
||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
|
||||
false, false, false);
|
||||
|
||||
return new struct D3DDataBindingFactory;
|
||||
}
|
||||
|
||||
}
|
|
@ -41,13 +41,13 @@ SParticleModel CParticleDataFactory::GetModel(CInputStream& in, CSimplePool* res
|
|||
TResId id = in.readUint32Big();
|
||||
if (!id)
|
||||
return {};
|
||||
return {resPool->GetObj({FOURCC('CMDL'), id}), true};
|
||||
return {std::move(resPool->GetObj({FOURCC('CMDL'), id})), true};
|
||||
}
|
||||
|
||||
SChildGeneratorDesc CParticleDataFactory::GetChildGeneratorDesc(TResId res, CSimplePool* resPool, const std::vector<TResId>& tracker)
|
||||
{
|
||||
if (std::count(tracker.cbegin(), tracker.cend(), res) == 0)
|
||||
return {resPool->GetObj({FOURCC('PART'), res}), true};
|
||||
return {std::move(resPool->GetObj({FOURCC('PART'), res})), true};
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ SSwooshGeneratorDesc CParticleDataFactory::GetSwooshGeneratorDesc(CInputStream&
|
|||
TResId id = in.readUint32Big();
|
||||
if (!id)
|
||||
return {};
|
||||
return {resPool->GetObj({FOURCC('SWHC'), id}), true};
|
||||
return {std::move(resPool->GetObj({FOURCC('SWHC'), id})), true};
|
||||
}
|
||||
|
||||
SElectricGeneratorDesc CParticleDataFactory::GetElectricGeneratorDesc(CInputStream& in, CSimplePool* resPool)
|
||||
|
@ -81,7 +81,7 @@ SElectricGeneratorDesc CParticleDataFactory::GetElectricGeneratorDesc(CInputStre
|
|||
TResId id = in.readUint32Big();
|
||||
if (!id)
|
||||
return {};
|
||||
return {resPool->GetObj({FOURCC('ELSC'), id}), true};
|
||||
return {std::move(resPool->GetObj({FOURCC('ELSC'), id})), true};
|
||||
}
|
||||
|
||||
CUVElement* CParticleDataFactory::GetTextureElement(CInputStream& in, CSimplePool* resPool)
|
||||
|
|
|
@ -27,6 +27,9 @@ struct SParticleModel
|
|||
TLockedToken<CModel> m_token;
|
||||
bool m_found = false;
|
||||
CModel* m_model = nullptr;
|
||||
SParticleModel() = default;
|
||||
SParticleModel(CToken&& tok, bool found)
|
||||
: m_token(std::move(tok)), m_found(found) {}
|
||||
};
|
||||
|
||||
struct SChildGeneratorDesc
|
||||
|
@ -34,6 +37,9 @@ struct SChildGeneratorDesc
|
|||
TLockedToken<CGenDescription> m_token;
|
||||
bool m_found = false;
|
||||
CGenDescription* m_gen = nullptr;
|
||||
SChildGeneratorDesc() = default;
|
||||
SChildGeneratorDesc(CToken&& tok, bool found)
|
||||
: m_token(std::move(tok)), m_found(found) {}
|
||||
};
|
||||
|
||||
struct SSwooshGeneratorDesc
|
||||
|
@ -41,6 +47,9 @@ struct SSwooshGeneratorDesc
|
|||
TLockedToken<CSwooshDescription> m_token;
|
||||
bool m_found = false;
|
||||
CSwooshDescription* m_swoosh = nullptr;
|
||||
SSwooshGeneratorDesc() = default;
|
||||
SSwooshGeneratorDesc(CToken&& tok, bool found)
|
||||
: m_token(std::move(tok)), m_found(found) {}
|
||||
};
|
||||
|
||||
struct SElectricGeneratorDesc
|
||||
|
@ -48,6 +57,9 @@ struct SElectricGeneratorDesc
|
|||
TLockedToken<CElectricDescription> m_token;
|
||||
bool m_found = false;
|
||||
CElectricDescription* m_electric = nullptr;
|
||||
SElectricGeneratorDesc() = default;
|
||||
SElectricGeneratorDesc(CToken&& tok, bool found)
|
||||
: m_token(std::move(tok)), m_found(found) {}
|
||||
};
|
||||
|
||||
class CParticleDataFactory
|
||||
|
|
|
@ -49,50 +49,68 @@ void CParticleElectric::SetModulationColor(const Zeus::CColor&)
|
|||
|
||||
const Zeus::CTransform& CParticleElectric::GetOrientation() const
|
||||
{
|
||||
static Zeus::CTransform dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CVector3f& CParticleElectric::GetTranslation() const
|
||||
{
|
||||
static Zeus::CVector3f dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CTransform& CParticleElectric::GetGlobalOrientation() const
|
||||
{
|
||||
static Zeus::CTransform dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CVector3f& CParticleElectric::GetGlobalTranslation() const
|
||||
{
|
||||
static Zeus::CVector3f dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CVector3f& CParticleElectric::GetGlobalScale() const
|
||||
{
|
||||
static Zeus::CVector3f dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CColor& CParticleElectric::GetModulationColor() const
|
||||
{
|
||||
static Zeus::CColor dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
bool CParticleElectric::IsSystemDeletable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<Zeus::CAABox, bool> CParticleElectric::GetBounds() const
|
||||
{
|
||||
return std::make_pair(Zeus::CAABox(), false);
|
||||
}
|
||||
|
||||
u32 CParticleElectric::GetParticleCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CParticleElectric::SystemHasLight() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
CLight CParticleElectric::GetLight() const
|
||||
{
|
||||
return CLight();
|
||||
}
|
||||
|
||||
bool CParticleElectric::GetParticleEmission() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CParticleElectric::DestroyParticles()
|
||||
|
|
|
@ -49,50 +49,68 @@ void CParticleSwoosh::SetModulationColor(const Zeus::CColor&)
|
|||
|
||||
const Zeus::CTransform& CParticleSwoosh::GetOrientation() const
|
||||
{
|
||||
static Zeus::CTransform dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CVector3f& CParticleSwoosh::GetTranslation() const
|
||||
{
|
||||
static Zeus::CVector3f dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CTransform& CParticleSwoosh::GetGlobalOrientation() const
|
||||
{
|
||||
static Zeus::CTransform dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CVector3f& CParticleSwoosh::GetGlobalTranslation() const
|
||||
{
|
||||
static Zeus::CVector3f dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CVector3f& CParticleSwoosh::GetGlobalScale() const
|
||||
{
|
||||
static Zeus::CVector3f dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
const Zeus::CColor& CParticleSwoosh::GetModulationColor() const
|
||||
{
|
||||
static Zeus::CColor dummy;
|
||||
return dummy;
|
||||
}
|
||||
|
||||
bool CParticleSwoosh::IsSystemDeletable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<Zeus::CAABox, bool> CParticleSwoosh::GetBounds() const
|
||||
{
|
||||
return std::make_pair(Zeus::CAABox(), false);
|
||||
}
|
||||
|
||||
u32 CParticleSwoosh::GetParticleCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CParticleSwoosh::SystemHasLight() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
CLight CParticleSwoosh::GetLight() const
|
||||
{
|
||||
return CLight();
|
||||
}
|
||||
|
||||
bool CParticleSwoosh::GetParticleEmission() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CParticleSwoosh::DestroyParticles()
|
||||
|
|
|
@ -16,6 +16,9 @@ struct SCollisionResponseData
|
|||
{
|
||||
TToken<CCollisionResponseData> m_res;
|
||||
bool m_found = false;
|
||||
SCollisionResponseData() = default;
|
||||
SCollisionResponseData(CToken&& tok, bool found)
|
||||
: m_res(std::move(tok)), m_found(found) {}
|
||||
};
|
||||
|
||||
class CWeaponDescription
|
||||
|
|
|
@ -20,6 +20,8 @@ struct SObjectTag
|
|||
TResId id = -1;
|
||||
bool operator!=(const SObjectTag& other) const {return id != other.id;}
|
||||
bool operator==(const SObjectTag& other) const {return id == other.id;}
|
||||
SObjectTag() = default;
|
||||
SObjectTag(FourCC tp, TResId rid) : type(tp), id(rid) {}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
|||
Subproject commit 82a0c26fd7c1f2acda42c73f4bf4bafbf3281b59
|
||||
Subproject commit 92604d9ce5c32aa9a7c58603683b43f2064850b5
|
|
@ -1 +1 @@
|
|||
Subproject commit 0d22ed8d625a58d8eac7a63d09c80c490d581db2
|
||||
Subproject commit a5d6f9f2624d86a92f1438dda89695f47789995c
|
Loading…
Reference in New Issue