mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 15:47:46 +00:00
Lots of bug fixes (Windows still needs some fixes)
This commit is contained in:
@@ -28,7 +28,7 @@ static const char* VS =
|
||||
"{\n"
|
||||
" VertToFrag vtf;\n"
|
||||
" vtf.color = bu.color;\n"
|
||||
" vtf.pos = bu.xf * vec4(v.posIn.xyz, 1.0);\n"
|
||||
" vtf.pos = bu.xf * float4(v.posIn.xyz, 1.0);\n"
|
||||
" return vtf;\n"
|
||||
"}\n";
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ class CModelShaders
|
||||
{
|
||||
friend class CModel;
|
||||
hecl::Runtime::ShaderCacheManager m_shaderCache;
|
||||
static std::experimental::optional<CModelShaders> g_ModelShaders;
|
||||
static hecl::Runtime::ShaderCacheExtensions GetShaderExtensions(boo::IGraphicsDataFactory::Platform plat);
|
||||
static hecl::Runtime::ShaderCacheExtensions GetShaderExtensionsGLSL(boo::IGraphicsDataFactory::Platform plat);
|
||||
static hecl::Runtime::ShaderCacheExtensions GetShaderExtensionsHLSL(boo::IGraphicsDataFactory::Platform plat);
|
||||
@@ -42,6 +41,8 @@ class CModelShaders
|
||||
static const hecl::Backend::TextureInfo BallFadeTextures[];
|
||||
static const hecl::Backend::TextureInfo WorldShadowTextures[];
|
||||
public:
|
||||
static std::experimental::optional<CModelShaders> g_ModelShaders;
|
||||
|
||||
struct Light
|
||||
{
|
||||
zeus::CVector3f pos;
|
||||
|
||||
@@ -248,15 +248,7 @@ CModelShaders::GetShaderExtensionsGLSL(boo::IGraphicsDataFactory::Platform plat)
|
||||
hecl::Backend::BlendFactor::SrcAlpha,
|
||||
hecl::Backend::BlendFactor::InvSrcAlpha,
|
||||
hecl::Backend::ZTest::Equal,
|
||||
false, false, false, true);
|
||||
|
||||
/* MorphBall shadow shading */
|
||||
ext.registerExtensionSlot({}, {MBShadowPostGLSL, "MBShadowPostFunc"},
|
||||
3, MBShadowBlockNames, 3, BallFadeTextures,
|
||||
hecl::Backend::BlendFactor::SrcAlpha,
|
||||
hecl::Backend::BlendFactor::InvSrcAlpha,
|
||||
hecl::Backend::ZTest::Equal,
|
||||
false, false, false, true);
|
||||
false, false, false, true, true);
|
||||
|
||||
/* World shadow shading (modified lighting) */
|
||||
ext.registerExtensionSlot({LightingShadowGLSL, "LightingShadowFunc"}, {MainPostGLSL, "MainPostFunc"},
|
||||
|
||||
@@ -231,7 +231,7 @@ CModelShaders::GetShaderExtensionsHLSL(boo::IGraphicsDataFactory::Platform plat)
|
||||
hecl::Backend::BlendFactor::SrcAlpha,
|
||||
hecl::Backend::BlendFactor::InvSrcAlpha,
|
||||
hecl::Backend::ZTest::Equal,
|
||||
false, false, false, true);
|
||||
false, false, false, true, true);
|
||||
|
||||
/* World shadow shading (modified lighting) */
|
||||
ext.registerExtensionSlot({LightingShadowHLSL, "LightingShadowFunc"}, {MainPostHLSL, "MainPostFunc"},
|
||||
|
||||
@@ -126,7 +126,7 @@ static const char* ThermalPostMetal =
|
||||
" float4 tmulColor;\n"
|
||||
" float4 addColor;\n"
|
||||
"};\n"
|
||||
"static float4 ThermalPostFunc(thread VertToFrag& vtf, constant ThermalUniform& lu, texture2d<float> extTex7, float4 colorIn)\n"
|
||||
"static float4 EXTThermalPostFunc(thread VertToFrag& vtf, constant ThermalUniform& lu, texture2d<float> extTex7, float4 colorIn)\n"
|
||||
"{\n"
|
||||
" return float4(extTex7.sample(samp, vtf.extTcgs0).rrr * lu.tmulColor.rgb + lu.addColor.rgb, 1.0);\n"
|
||||
"}\n"
|
||||
@@ -149,8 +149,8 @@ static const char* MBShadowPostMetal =
|
||||
" float4 shadowUp;\n"
|
||||
" float shadowId;\n"
|
||||
"};\n"
|
||||
"static float4 MBShadowPostFunc(thread VertToFrag& vtf, constant MBShadowUniform& su,\n"
|
||||
" texture2d<float> extTex0, texture2d<float> extTex1, texture2d<float> extTex2, float4 colorIn)\n"
|
||||
"static float4 EXTMBShadowPostFunc(thread VertToFrag& vtf, constant MBShadowUniform& su,\n"
|
||||
" texture2d<float> extTex0, texture2d<float> extTex1, texture2d<float> extTex2, float4 colorIn)\n"
|
||||
"{\n"
|
||||
" float idTexel = extTex0.sample(samp, vtf.extTcgs0).a;\n"
|
||||
" float sphereTexel = extTex1.sample(samp, vtf.extTcgs1).a;\n"
|
||||
@@ -179,7 +179,7 @@ CModelShaders::GetShaderExtensionsMetal(boo::IGraphicsDataFactory::Platform plat
|
||||
false, false, false, true);
|
||||
|
||||
/* Thermal Visor shading */
|
||||
ext.registerExtensionSlot({}, {ThermalPostMetal, "ThermalPostFunc"}, 1, ThermalBlockNames,
|
||||
ext.registerExtensionSlot({}, {ThermalPostMetal, "EXTThermalPostFunc"}, 1, ThermalBlockNames,
|
||||
1, ThermalTextures, hecl::Backend::BlendFactor::One,
|
||||
hecl::Backend::BlendFactor::One, hecl::Backend::ZTest::Original,
|
||||
false, false, false, true);
|
||||
@@ -233,12 +233,12 @@ CModelShaders::GetShaderExtensionsMetal(boo::IGraphicsDataFactory::Platform plat
|
||||
false, true, true, false);
|
||||
|
||||
/* MorphBall shadow shading */
|
||||
ext.registerExtensionSlot({}, {MBShadowPostMetal, "MBShadowPostFunc"},
|
||||
ext.registerExtensionSlot({}, {MBShadowPostMetal, "EXTMBShadowPostFunc"},
|
||||
1, MBShadowBlockNames, 3, BallFadeTextures,
|
||||
hecl::Backend::BlendFactor::SrcAlpha,
|
||||
hecl::Backend::BlendFactor::InvSrcAlpha,
|
||||
hecl::Backend::ZTest::Equal,
|
||||
false, false, false, true);
|
||||
false, false, false, true, true);
|
||||
|
||||
/* World shadow shading (modified lighting) */
|
||||
ext.registerExtensionSlot({LightingShadowMetal, "EXTLightingShadowFunc"}, {MainPostMetal, "MainPostFunc"},
|
||||
|
||||
@@ -73,7 +73,7 @@ struct OGLParticleSwooshDataBindingFactory : TShader<CParticleSwooshShaders>::ID
|
||||
CSwooshDescription* desc = gen.GetDesc();
|
||||
|
||||
CUVElement* texr = desc->x3c_TEXR.get();
|
||||
boo::ITexture* textures[] = {texr->GetValueTexture(0).GetObj()->GetBooTexture()};
|
||||
boo::ITexture* textures[] = {texr ? texr->GetValueTexture(0).GetObj()->GetBooTexture() : nullptr};
|
||||
|
||||
const boo::VertexElementDescriptor VtxFmt[] =
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ struct D3DParticleSwooshDataBindingFactory : TShader<CParticleSwooshShaders>::ID
|
||||
CSwooshDescription* desc = gen.GetDesc();
|
||||
|
||||
CUVElement* texr = desc->x3c_TEXR.get();
|
||||
boo::ITexture* textures[] = {texr->GetValueTexture(0).GetObj()->GetBooTexture()};
|
||||
boo::ITexture* textures[] = {texr ? texr->GetValueTexture(0).GetObj()->GetBooTexture() : nullptr};
|
||||
|
||||
boo::IGraphicsBuffer* uniforms[] = {gen.m_uniformBuf};
|
||||
gen.m_dataBind = ctx.newShaderDataBinding(shaders.m_pipeline, CParticleSwooshShaders::m_vtxFormat,
|
||||
|
||||
@@ -77,7 +77,7 @@ struct MetalParticleSwooshDataBindingFactory : TShader<CParticleSwooshShaders>::
|
||||
CSwooshDescription* desc = gen.GetDesc();
|
||||
|
||||
CUVElement* texr = desc->x3c_TEXR.get();
|
||||
boo::ITexture* textures[] = {texr->GetValueTexture(0).GetObj()->GetBooTexture()};
|
||||
boo::ITexture* textures[] = {texr ? texr->GetValueTexture(0).GetObj()->GetBooTexture() : nullptr};
|
||||
|
||||
boo::IGraphicsBuffer* uniforms[] = {gen.m_uniformBuf};
|
||||
gen.m_dataBind = ctx.newShaderDataBinding(shaders.m_pipeline, CParticleSwooshShaders::m_vtxFormat,
|
||||
|
||||
@@ -116,9 +116,9 @@ static const char* BlurVS =
|
||||
"vertex VertToFrag vmain(VertData v [[ stage_in ]], constant PhazonSuitBlurUniform& psu [[ buffer(2) ]])\n"
|
||||
"{\n"
|
||||
" VertToFrag vtf;\n"
|
||||
" vtf.uv = uvIn.xy;\n"
|
||||
" vtf.blurDir = blurDir.xy;\n"
|
||||
" vtf.position = float4(posIn.xyz, 1.0);\n"
|
||||
" vtf.uv = v.uvIn.xy;\n"
|
||||
" vtf.blurDir = psu.blurDir.xy;\n"
|
||||
" vtf.position = float4(v.posIn.xyz, 1.0);\n"
|
||||
" return vtf;\n"
|
||||
"}\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user