mirror of https://github.com/AxioDL/metaforce.git
Tons of refactors and bug fixes
This commit is contained in:
parent
d0d11eb700
commit
d5c7efce58
|
@ -368,7 +368,7 @@ bool FRME::Extract(const SpecBase &dataSpec,
|
||||||
for (const FRME::Widget& w : frme.widgets)
|
for (const FRME::Widget& w : frme.widgets)
|
||||||
{
|
{
|
||||||
os << "binding = None\n"
|
os << "binding = None\n"
|
||||||
"angle = Quaternion((0.0, 0.0, 0.0), 0)\n";
|
"angle = Quaternion((1.0, 0.0, 0.0), 0)\n";
|
||||||
if (w.type == SBIG('CAMR'))
|
if (w.type == SBIG('CAMR'))
|
||||||
{
|
{
|
||||||
using CAMRInfo = Widget::CAMRInfo;
|
using CAMRInfo = Widget::CAMRInfo;
|
||||||
|
|
|
@ -93,15 +93,11 @@ static std::u16string::const_iterator CookTextureList(std::u16string& ret,
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
auto end = str.find(u',', it - str.begin());
|
auto end = str.find_first_of(u",;", it - str.begin());
|
||||||
if (end == std::u16string::npos)
|
if (end == std::u16string::npos)
|
||||||
{
|
Log.report(logvisor::Fatal,
|
||||||
end = str.find(u';', it - str.begin());
|
"Missing comma/semicolon token while pasing font tag");
|
||||||
if (end == std::u16string::npos)
|
auto endIt = str.begin() + end;
|
||||||
Log.report(logvisor::Fatal,
|
|
||||||
"Missing comma/semicolon token while pasing font tag");
|
|
||||||
}
|
|
||||||
auto endIt = str.begin() + end + 1;
|
|
||||||
hecl::ProjectPath path =
|
hecl::ProjectPath path =
|
||||||
UniqueIDBridge::MakePathFromString<UniqueID32>(
|
UniqueIDBridge::MakePathFromString<UniqueID32>(
|
||||||
hecl::Char16ToUTF8(std::u16string(it, endIt)));
|
hecl::Char16ToUTF8(std::u16string(it, endIt)));
|
||||||
|
|
|
@ -125,7 +125,7 @@ void CPersistentOptions::PutTo(CBitStreamWriter& w) const
|
||||||
for (const auto& world : memWorlds)
|
for (const auto& world : memWorlds)
|
||||||
{
|
{
|
||||||
TLockedToken<CSaveWorld> saveWorld =
|
TLockedToken<CSaveWorld> saveWorld =
|
||||||
g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), world.first});
|
g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), world.second.GetSaveWorldAssetId()});
|
||||||
|
|
||||||
for (TEditorId cineId : saveWorld->GetCinematics())
|
for (TEditorId cineId : saveWorld->GetCinematics())
|
||||||
w.WriteEncoded(GetCinematicState(world.first, cineId), 1);
|
w.WriteEncoded(GetCinematicState(world.first, cineId), 1);
|
||||||
|
|
|
@ -152,7 +152,11 @@ CToken::CToken(const CToken& other)
|
||||||
: x0_objRef(other.x0_objRef)
|
: x0_objRef(other.x0_objRef)
|
||||||
{
|
{
|
||||||
if (x0_objRef)
|
if (x0_objRef)
|
||||||
|
{
|
||||||
++x0_objRef->x0_refCount;
|
++x0_objRef->x0_refCount;
|
||||||
|
if (other.x4_lockHeld)
|
||||||
|
Lock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CToken::CToken(CToken&& other)
|
CToken::CToken(CToken&& other)
|
||||||
: x0_objRef(other.x0_objRef), x4_lockHeld(other.x4_lockHeld)
|
: x0_objRef(other.x0_objRef), x4_lockHeld(other.x4_lockHeld)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "Graphics/CLight.hpp"
|
#include "Graphics/CLight.hpp"
|
||||||
#include "zeus/Math.hpp"
|
#include "zeus/Math.hpp"
|
||||||
#include "CTimeProvider.hpp"
|
#include "CTimeProvider.hpp"
|
||||||
|
#include "Shaders/CTextSupportShader.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
@ -114,6 +115,9 @@ void CGraphics::EndScene()
|
||||||
* so simulate field-flipping with XOR instead */
|
* so simulate field-flipping with XOR instead */
|
||||||
g_InterruptLastFrameUsedAbove ^= 1;
|
g_InterruptLastFrameUsedAbove ^= 1;
|
||||||
g_LastFrameUsedAbove = g_InterruptLastFrameUsedAbove;
|
g_LastFrameUsedAbove = g_InterruptLastFrameUsedAbove;
|
||||||
|
|
||||||
|
/* Flush text instance buffers just before GPU command list submission */
|
||||||
|
CTextSupportShader::UpdateBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGraphics::SetAlphaCompare(ERglAlphaFunc comp0, u8 ref0, ERglAlphaOp op, ERglAlphaFunc comp1, u8 ref1)
|
void CGraphics::SetAlphaCompare(ERglAlphaFunc comp0, u8 ref0, ERglAlphaOp op, ERglAlphaFunc comp1, u8 ref1)
|
||||||
|
@ -222,49 +226,99 @@ zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
|
||||||
|
|
||||||
zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix(bool forRenderer)
|
zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix(bool forRenderer)
|
||||||
{
|
{
|
||||||
float rml = g_Proj.x8_right - g_Proj.x4_left;
|
if (g_Proj.x0_persp)
|
||||||
float rpl = g_Proj.x8_right + g_Proj.x4_left;
|
{
|
||||||
float tmb = g_Proj.xc_top - g_Proj.x10_bottom;
|
float rml = g_Proj.x8_right - g_Proj.x4_left;
|
||||||
float tpb = g_Proj.xc_top + g_Proj.x10_bottom;
|
float rpl = g_Proj.x8_right + g_Proj.x4_left;
|
||||||
float fpn = g_Proj.x18_far + g_Proj.x14_near;
|
float tmb = g_Proj.xc_top - g_Proj.x10_bottom;
|
||||||
float fmn = g_Proj.x18_far - g_Proj.x14_near;
|
float tpb = g_Proj.xc_top + g_Proj.x10_bottom;
|
||||||
|
float fpn = g_Proj.x18_far + g_Proj.x14_near;
|
||||||
|
float fmn = g_Proj.x18_far - g_Proj.x14_near;
|
||||||
|
|
||||||
if (!forRenderer)
|
if (!forRenderer)
|
||||||
{
|
{
|
||||||
return zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
return zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn,
|
0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn,
|
||||||
0.f, 0.f, -1.f, 0.f);
|
0.f, 0.f, -1.f, 0.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (g_BooPlatform)
|
switch (g_BooPlatform)
|
||||||
{
|
{
|
||||||
case boo::IGraphicsDataFactory::Platform::OpenGL:
|
case boo::IGraphicsDataFactory::Platform::OpenGL:
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
return zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
return zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn,
|
0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn,
|
||||||
0.f, 0.f, -1.f, 0.f);
|
0.f, 0.f, -1.f, 0.f);
|
||||||
|
}
|
||||||
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
|
case boo::IGraphicsDataFactory::Platform::D3D12:
|
||||||
|
case boo::IGraphicsDataFactory::Platform::Metal:
|
||||||
|
{
|
||||||
|
zeus::CMatrix4f mat2(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
|
0.f, 0.f, g_Proj.x18_far / fmn, g_Proj.x14_near * g_Proj.x18_far / fmn,
|
||||||
|
0.f, 0.f, -1.f, 0.f);
|
||||||
|
return PlusOneZ * mat2;
|
||||||
|
}
|
||||||
|
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
||||||
|
{
|
||||||
|
zeus::CMatrix4f mat2(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
|
0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn,
|
||||||
|
0.f, 0.f, -1.f, 0.f);
|
||||||
|
return PlusOneZFlip * mat2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
else
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
|
||||||
case boo::IGraphicsDataFactory::Platform::Metal:
|
|
||||||
{
|
{
|
||||||
zeus::CMatrix4f mat2(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
float rml = g_Proj.x8_right - g_Proj.x4_left;
|
||||||
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
float rpl = g_Proj.x8_right + g_Proj.x4_left;
|
||||||
0.f, 0.f, g_Proj.x18_far / fmn, g_Proj.x14_near * g_Proj.x18_far / fmn,
|
float tmb = g_Proj.xc_top - g_Proj.x10_bottom;
|
||||||
0.f, 0.f, -1.f, 0.f);
|
float tpb = g_Proj.xc_top + g_Proj.x10_bottom;
|
||||||
return PlusOneZ * mat2;
|
float fpn = g_Proj.x18_far + g_Proj.x14_near;
|
||||||
}
|
float fmn = g_Proj.x18_far - g_Proj.x14_near;
|
||||||
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
|
||||||
{
|
if (!forRenderer)
|
||||||
zeus::CMatrix4f mat2(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
{
|
||||||
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
return zeus::CMatrix4f(2.f / rml, 0.f, 0.f, -rpl / rml,
|
||||||
0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn,
|
0.f, 2.f / tmb, 0.f, -tpb / tmb,
|
||||||
0.f, 0.f, -1.f, 0.f);
|
0.f, 0.f, -2.f / fmn, -fpn / fmn,
|
||||||
return PlusOneZFlip * mat2;
|
0.f, 0.f, 0.f, 1.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (g_BooPlatform)
|
||||||
|
{
|
||||||
|
case boo::IGraphicsDataFactory::Platform::OpenGL:
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return zeus::CMatrix4f(2.f / rml, 0.f, 0.f, -rpl / rml,
|
||||||
|
0.f, 2.f / tmb, 0.f, -tpb / tmb,
|
||||||
|
0.f, 0.f, -2.f / fmn, -fpn / fmn,
|
||||||
|
0.f, 0.f, 0.f, 1.f);
|
||||||
|
}
|
||||||
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
|
case boo::IGraphicsDataFactory::Platform::D3D12:
|
||||||
|
case boo::IGraphicsDataFactory::Platform::Metal:
|
||||||
|
{
|
||||||
|
zeus::CMatrix4f mat2(2.f / rml, 0.f, 0.f, -rpl / rml,
|
||||||
|
0.f, 2.f / tmb, 0.f, -tpb / tmb,
|
||||||
|
0.f, 0.f, 1.f / fmn, -g_Proj.x14_near / fmn,
|
||||||
|
0.f, 0.f, 0.f, 1.f);
|
||||||
|
return PlusOneZ * mat2;
|
||||||
|
}
|
||||||
|
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
||||||
|
{
|
||||||
|
zeus::CMatrix4f mat2(2.f / rml, 0.f, 0.f, -rpl / rml,
|
||||||
|
0.f, 2.f / tmb, 0.f, -tpb / tmb,
|
||||||
|
0.f, 0.f, 1.f / fmn, -g_Proj.x14_near / fmn,
|
||||||
|
0.f, 0.f, 0.f, 1.f);
|
||||||
|
return PlusOneZFlip * mat2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ if(WIN32)
|
||||||
Shaders/CThermalHotFilterHLSL.cpp
|
Shaders/CThermalHotFilterHLSL.cpp
|
||||||
Shaders/CSpaceWarpFilterHLSL.cpp
|
Shaders/CSpaceWarpFilterHLSL.cpp
|
||||||
Shaders/CCameraBlurFilterHLSL.cpp
|
Shaders/CCameraBlurFilterHLSL.cpp
|
||||||
Shaders/CXRayBlurFilterHLSL.cpp)
|
Shaders/CXRayBlurFilterHLSL.cpp
|
||||||
|
Shaders/CTextSupportShaderHLSL.cpp)
|
||||||
elseif(BOO_HAS_METAL)
|
elseif(BOO_HAS_METAL)
|
||||||
set(PLAT_SRCS
|
set(PLAT_SRCS
|
||||||
Shaders/CLineRendererShadersMetal.cpp
|
Shaders/CLineRendererShadersMetal.cpp
|
||||||
|
@ -19,7 +20,8 @@ elseif(BOO_HAS_METAL)
|
||||||
Shaders/CThermalHotFilterMetal.cpp
|
Shaders/CThermalHotFilterMetal.cpp
|
||||||
Shaders/CSpaceWarpFilterMetal.cpp
|
Shaders/CSpaceWarpFilterMetal.cpp
|
||||||
Shaders/CCameraBlurFilterMetal.cpp
|
Shaders/CCameraBlurFilterMetal.cpp
|
||||||
Shaders/CXRayBlurFilterMetal.cpp)
|
Shaders/CXRayBlurFilterMetal.cpp
|
||||||
|
Shaders/CTextSupportShaderMetal.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(GRAPHICS_SOURCES
|
set(GRAPHICS_SOURCES
|
||||||
|
@ -48,12 +50,12 @@ set(GRAPHICS_SOURCES
|
||||||
Shaders/CTexturedQuadFilter.hpp Shaders/CTexturedQuadFilter.cpp Shaders/CTexturedQuadFilterGLSL.cpp
|
Shaders/CTexturedQuadFilter.hpp Shaders/CTexturedQuadFilter.cpp Shaders/CTexturedQuadFilterGLSL.cpp
|
||||||
Shaders/CColoredQuadFilter.hpp Shaders/CColoredQuadFilter.cpp Shaders/CColoredQuadFilterGLSL.cpp
|
Shaders/CColoredQuadFilter.hpp Shaders/CColoredQuadFilter.cpp Shaders/CColoredQuadFilterGLSL.cpp
|
||||||
Shaders/CModelShaders.hpp Shaders/CModelShaders.cpp Shaders/CModelShadersGLSL.cpp
|
Shaders/CModelShaders.hpp Shaders/CModelShaders.cpp Shaders/CModelShadersGLSL.cpp
|
||||||
Shaders/CXrayOutlineFilter.hpp Shaders/CXrayOutlineFilter.cpp Shaders/CXrayOutlineFilterGLSL.cpp
|
|
||||||
Shaders/CThermalColdFilter.hpp Shaders/CThermalColdFilter.cpp Shaders/CThermalColdFilterGLSL.cpp
|
Shaders/CThermalColdFilter.hpp Shaders/CThermalColdFilter.cpp Shaders/CThermalColdFilterGLSL.cpp
|
||||||
Shaders/CThermalHotFilter.hpp Shaders/CThermalHotFilter.cpp Shaders/CThermalHotFilterGLSL.cpp
|
Shaders/CThermalHotFilter.hpp Shaders/CThermalHotFilter.cpp Shaders/CThermalHotFilterGLSL.cpp
|
||||||
Shaders/CSpaceWarpFilter.hpp Shaders/CSpaceWarpFilter.cpp Shaders/CSpaceWarpFilterGLSL.cpp
|
Shaders/CSpaceWarpFilter.hpp Shaders/CSpaceWarpFilter.cpp Shaders/CSpaceWarpFilterGLSL.cpp
|
||||||
Shaders/CCameraBlurFilter.hpp Shaders/CCameraBlurFilter.cpp Shaders/CCameraBlurFilterGLSL.cpp
|
Shaders/CCameraBlurFilter.hpp Shaders/CCameraBlurFilter.cpp Shaders/CCameraBlurFilterGLSL.cpp
|
||||||
Shaders/CXRayBlurFilter.hpp Shaders/CXRayBlurFilter.cpp Shaders/CXRayBlurFilterGLSL.cpp
|
Shaders/CXRayBlurFilter.hpp Shaders/CXRayBlurFilter.cpp Shaders/CXRayBlurFilterGLSL.cpp
|
||||||
|
Shaders/CTextSupportShader.hpp Shaders/CTextSupportShader.cpp Shaders/CTextSupportShaderGLSL.cpp
|
||||||
${PLAT_SRCS})
|
${PLAT_SRCS})
|
||||||
|
|
||||||
runtime_add_list(Graphics GRAPHICS_SOURCES)
|
runtime_add_list(Graphics GRAPHICS_SOURCES)
|
||||||
|
|
|
@ -14,6 +14,19 @@ class CVParamTransfer;
|
||||||
|
|
||||||
class CTexture
|
class CTexture
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
enum class EFontType
|
||||||
|
{
|
||||||
|
None = -1,
|
||||||
|
OneLayer = 0, /* Fill bit0 */
|
||||||
|
OneLayerOutline = 1, /* Fill bit0, Outline bit1 */
|
||||||
|
FourLayers = 2,
|
||||||
|
TwoLayersOutlines = 3, /* Fill bit0/2, Outline bit1/3 */
|
||||||
|
TwoLayers = 4, /* Fill bit0/1 and copied to bit2/3 */
|
||||||
|
TwoLayersOutlines2 = 8 /* Fill bit2/3, Outline bit0/1 */
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
ETexelFormat x0_fmt;
|
ETexelFormat x0_fmt;
|
||||||
u16 x4_w;
|
u16 x4_w;
|
||||||
u16 x6_h;
|
u16 x6_h;
|
||||||
|
@ -22,6 +35,7 @@ class CTexture
|
||||||
boo::ITexture* m_booTex;
|
boo::ITexture* m_booTex;
|
||||||
boo::ITexture* m_paletteTex;
|
boo::ITexture* m_paletteTex;
|
||||||
std::unique_ptr<u8[]> m_otex;
|
std::unique_ptr<u8[]> m_otex;
|
||||||
|
EFontType m_ftype = EFontType::None;
|
||||||
|
|
||||||
size_t ComputeMippedTexelCount();
|
size_t ComputeMippedTexelCount();
|
||||||
size_t ComputeMippedBlockCountDXT1();
|
size_t ComputeMippedBlockCountDXT1();
|
||||||
|
@ -38,6 +52,7 @@ class CTexture
|
||||||
void BuildDXT1FromGCN(CInputStream& in);
|
void BuildDXT1FromGCN(CInputStream& in);
|
||||||
void BuildRGBA8(const void* data, size_t length);
|
void BuildRGBA8(const void* data, size_t length);
|
||||||
void BuildC8(const void* data, size_t length);
|
void BuildC8(const void* data, size_t length);
|
||||||
|
void BuildC8Font(const void* data, EFontType ftype);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTexture(ETexelFormat, s16, s16, s32);
|
CTexture(ETexelFormat, s16, s16, s32);
|
||||||
|
@ -57,6 +72,7 @@ public:
|
||||||
boo::ITexture* GetPaletteTexture() {return m_paletteTex;}
|
boo::ITexture* GetPaletteTexture() {return m_paletteTex;}
|
||||||
std::unique_ptr<u8[]> BuildMemoryCardTex(u32& sizeOut, ETexelFormat& fmtOut,
|
std::unique_ptr<u8[]> BuildMemoryCardTex(u32& sizeOut, ETexelFormat& fmtOut,
|
||||||
std::unique_ptr<u8[]>& paletteOut) const;
|
std::unique_ptr<u8[]>& paletteOut) const;
|
||||||
|
boo::ITexture* GetFontTexture(EFontType tp);
|
||||||
};
|
};
|
||||||
|
|
||||||
CFactoryFnReturn FTextureFactory(const urde::SObjectTag& tag,
|
CFactoryFnReturn FTextureFactory(const urde::SObjectTag& tag,
|
||||||
|
|
|
@ -684,6 +684,108 @@ void CTexture::BuildC8(const void* data, size_t length)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CTexture::BuildC8Font(const void* data, EFontType ftype)
|
||||||
|
{
|
||||||
|
size_t texelCount = ComputeMippedTexelCount();
|
||||||
|
|
||||||
|
size_t layerCount;
|
||||||
|
switch (ftype)
|
||||||
|
{
|
||||||
|
case EFontType::OneLayer:
|
||||||
|
case EFontType::OneLayerOutline:
|
||||||
|
layerCount = 1;
|
||||||
|
break;
|
||||||
|
case EFontType::FourLayers:
|
||||||
|
layerCount = 4;
|
||||||
|
break;
|
||||||
|
case EFontType::TwoLayersOutlines:
|
||||||
|
case EFontType::TwoLayers:
|
||||||
|
case EFontType::TwoLayersOutlines2:
|
||||||
|
layerCount = 2;
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t nentries = hecl::SBig(*reinterpret_cast<const uint32_t*>(data));
|
||||||
|
const u8* texels = reinterpret_cast<const u8*>(data) + 4 + nentries * 4;
|
||||||
|
std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount * layerCount]);
|
||||||
|
memset(buf.get(), 0, texelCount * layerCount * 4);
|
||||||
|
|
||||||
|
size_t w = x4_w;
|
||||||
|
size_t h = x6_h;
|
||||||
|
RGBA8* bufCur = buf.get();
|
||||||
|
for (size_t i=0 ; i<x8_mips ; ++i)
|
||||||
|
{
|
||||||
|
size_t tCount = w * h;
|
||||||
|
RGBA8* l0 = bufCur;
|
||||||
|
RGBA8* l1 = bufCur + tCount;
|
||||||
|
RGBA8* l2 = bufCur + tCount * 2;
|
||||||
|
RGBA8* l3 = bufCur + tCount * 3;
|
||||||
|
for (size_t j=0 ; j<tCount ; ++j)
|
||||||
|
{
|
||||||
|
u8 texel = texels[j];
|
||||||
|
switch (ftype)
|
||||||
|
{
|
||||||
|
case EFontType::OneLayer:
|
||||||
|
l0[j].r = (texel & 0x1) ? 0xff : 0;
|
||||||
|
l0[j].a = 0xff;
|
||||||
|
break;
|
||||||
|
case EFontType::OneLayerOutline:
|
||||||
|
l0[j].r = (texel & 0x1) ? 0xff : 0;
|
||||||
|
l0[j].g = (texel & 0x2) ? 0xff : 0;
|
||||||
|
l0[j].a = 0xff;
|
||||||
|
break;
|
||||||
|
case EFontType::FourLayers:
|
||||||
|
l0[j].r = (texel & 0x1) ? 0xff : 0;
|
||||||
|
l0[j].a = 0xff;
|
||||||
|
l1[j].r = (texel & 0x2) ? 0xff : 0;
|
||||||
|
l1[j].a = 0xff;
|
||||||
|
l2[j].r = (texel & 0x4) ? 0xff : 0;
|
||||||
|
l2[j].a = 0xff;
|
||||||
|
l3[j].r = (texel & 0x8) ? 0xff : 0;
|
||||||
|
l3[j].a = 0xff;
|
||||||
|
break;
|
||||||
|
case EFontType::TwoLayersOutlines:
|
||||||
|
l0[j].r = (texel & 0x1) ? 0xff : 0;
|
||||||
|
l0[j].g = (texel & 0x2) ? 0xff : 0;
|
||||||
|
l0[j].a = 0xff;
|
||||||
|
l1[j].r = (texel & 0x4) ? 0xff : 0;
|
||||||
|
l1[j].g = (texel & 0x8) ? 0xff : 0;
|
||||||
|
l1[j].a = 0xff;
|
||||||
|
break;
|
||||||
|
case EFontType::TwoLayers:
|
||||||
|
l0[j].r = (texel & 0x1) ? 0xff : 0;
|
||||||
|
l0[j].a = 0xff;
|
||||||
|
l1[j].r = (texel & 0x2) ? 0xff : 0;
|
||||||
|
l1[j].a = 0xff;
|
||||||
|
break;
|
||||||
|
case EFontType::TwoLayersOutlines2:
|
||||||
|
l0[j].r = (texel & 0x4) ? 0xff : 0;
|
||||||
|
l0[j].g = (texel & 0x1) ? 0xff : 0;
|
||||||
|
l0[j].a = 0xff;
|
||||||
|
l1[j].r = (texel & 0x8) ? 0xff : 0;
|
||||||
|
l1[j].g = (texel & 0x2) ? 0xff : 0;
|
||||||
|
l1[j].a = 0xff;
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
texels += tCount;
|
||||||
|
bufCur += tCount * layerCount;
|
||||||
|
if (w > 1)
|
||||||
|
w /= 2;
|
||||||
|
if (h > 1)
|
||||||
|
h /= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_booToken = CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) -> bool
|
||||||
|
{
|
||||||
|
m_booTex = ctx.newStaticArrayTexture(x4_w, x6_h, layerCount, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
|
buf.get(), texelCount * layerCount * 4);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
CTexture::CTexture(ETexelFormat fmt, s16 w, s16 h, s32 mips)
|
CTexture::CTexture(ETexelFormat fmt, s16 w, s16 h, s32 mips)
|
||||||
: x0_fmt(fmt)
|
: x0_fmt(fmt)
|
||||||
, x4_w(w)
|
, x4_w(w)
|
||||||
|
@ -746,6 +848,7 @@ CTexture::CTexture(std::unique_ptr<u8[]>&& in, u32 length, bool otex)
|
||||||
break;
|
break;
|
||||||
case ETexelFormat::C8PC:
|
case ETexelFormat::C8PC:
|
||||||
BuildC8(owned.get() + 12, length - 12);
|
BuildC8(owned.get() + 12, length - 12);
|
||||||
|
otex = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Log.report(logvisor::Fatal, "invalid texture type %d for boo", int(x0_fmt));
|
Log.report(logvisor::Fatal, "invalid texture type %d for boo", int(x0_fmt));
|
||||||
|
@ -872,13 +975,24 @@ std::unique_ptr<u8[]> CTexture::BuildMemoryCardTex(u32& sizeOut, ETexelFormat& f
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boo::ITexture* CTexture::GetFontTexture(EFontType tp)
|
||||||
|
{
|
||||||
|
if (m_ftype != tp && x0_fmt == ETexelFormat::C8PC)
|
||||||
|
{
|
||||||
|
m_ftype = tp;
|
||||||
|
BuildC8Font(m_otex.get() + 12, m_ftype);
|
||||||
|
}
|
||||||
|
return m_booTex;
|
||||||
|
}
|
||||||
|
|
||||||
CFactoryFnReturn FTextureFactory(const urde::SObjectTag& tag,
|
CFactoryFnReturn FTextureFactory(const urde::SObjectTag& tag,
|
||||||
std::unique_ptr<u8[]>&& in, u32 len,
|
std::unique_ptr<u8[]>&& in, u32 len,
|
||||||
const urde::CVParamTransfer& vparms,
|
const urde::CVParamTransfer& vparms,
|
||||||
CObjectReference* selfRef)
|
CObjectReference* selfRef)
|
||||||
{
|
{
|
||||||
|
u32 u32Owned = vparms.GetOwnedObj<u32>();
|
||||||
return TToken<CTexture>::GetIObjObjectFor(std::make_unique<CTexture>(std::move(in), len,
|
return TToken<CTexture>::GetIObjObjectFor(std::make_unique<CTexture>(std::move(in), len,
|
||||||
vparms.GetOwnedObj<u32>() == SBIG('OTEX')));
|
u32Owned == SBIG('OTEX')));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,8 @@ void CCameraBlurFilter::draw(float amount)
|
||||||
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCameraBlurFilter::Shutdown() {}
|
||||||
|
|
||||||
URDE_SPECIALIZE_SHADER(CCameraBlurFilter)
|
URDE_SPECIALIZE_SHADER(CCameraBlurFilter)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,11 +80,11 @@ BOO_GLSL_BINDING_HEAD
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CCameraBlurFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CCameraBlurFilter)
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CCameraBlurFilterGLDataBindingFactory : TShader<CCameraBlurFilter>::IDataBindingFactory
|
struct CCameraBlurFilterGLDataBindingFactory : TShader<CCameraBlurFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat*,
|
|
||||||
CCameraBlurFilter& filter)
|
CCameraBlurFilter& filter)
|
||||||
{
|
{
|
||||||
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
||||||
|
@ -97,7 +97,7 @@ struct CCameraBlurFilterGLDataBindingFactory : TShader<CCameraBlurFilter>::IData
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture};
|
||||||
return cctx.newShaderDataBinding(pipeline,
|
return cctx.newShaderDataBinding(s_Pipeline,
|
||||||
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
||||||
1, bufs, stages, nullptr, nullptr, 1, texs);
|
1, bufs, stages, nullptr, nullptr, 1, texs);
|
||||||
}
|
}
|
||||||
|
@ -107,35 +107,30 @@ struct CCameraBlurFilterGLDataBindingFactory : TShader<CCameraBlurFilter>::IData
|
||||||
struct CCameraBlurFilterVulkanDataBindingFactory : TShader<CCameraBlurFilter>::IDataBindingFactory
|
struct CCameraBlurFilterVulkanDataBindingFactory : TShader<CCameraBlurFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CCameraBlurFilter& filter)
|
CCameraBlurFilter& filter)
|
||||||
{
|
{
|
||||||
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(s_Pipeline, vtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 1, texs);
|
nullptr, nullptr, nullptr, 1, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::GLDataFactory::Context& ctx,
|
TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::GLDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut)
|
|
||||||
{
|
{
|
||||||
const char* texNames[] = {"sceneTex"};
|
const char* texNames[] = {"sceneTex"};
|
||||||
const char* uniNames[] = {"CameraBlurUniform"};
|
const char* uniNames[] = {"CameraBlurUniform"};
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CCameraBlurFilterGLDataBindingFactory;
|
return new CCameraBlurFilterGLDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::VulkanDataFactory::Context& ctx,
|
TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -143,8 +138,8 @@ TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(b
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CCameraBlurFilterVulkanDataBindingFactory;
|
return new CCameraBlurFilterVulkanDataBindingFactory;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -91,35 +91,34 @@ static const char* FS =
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CCameraBlurFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CCameraBlurFilter)
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CCameraBlurFilterMetalDataBindingFactory : TShader<CCameraBlurFilter>::IDataBindingFactory
|
struct CCameraBlurFilterMetalDataBindingFactory : TShader<CCameraBlurFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CCameraBlurFilter& filter)
|
CCameraBlurFilter& filter)
|
||||||
{
|
{
|
||||||
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 1, texs);
|
nullptr, nullptr, nullptr, 1, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::MetalDataFactory::Context& ctx,
|
TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CCameraBlurFilterMetalDataBindingFactory;
|
return new CCameraBlurFilterMetalDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,8 @@ void CWideScreenFilter::SetViewportToFull()
|
||||||
CGraphics::g_BooMainCommandQueue->setViewport(rect);
|
CGraphics::g_BooMainCommandQueue->setViewport(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CColoredQuadFilter::Shutdown() {}
|
||||||
|
|
||||||
const zeus::CRectangle CColoredQuadFilter::DefaultRect = {0.f, 0.f, 1.f, 1.f};
|
const zeus::CRectangle CColoredQuadFilter::DefaultRect = {0.f, 0.f, 1.f, 1.f};
|
||||||
|
|
||||||
URDE_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
|
URDE_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
|
||||||
|
|
|
@ -45,11 +45,29 @@ BOO_GLSL_BINDING_HEAD
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
|
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* s_AlphaPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_AddPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_MultPipeline = nullptr;
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* SelectPipeline(CCameraFilterPass::EFilterType type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case CCameraFilterPass::EFilterType::Blend:
|
||||||
|
return s_AlphaPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Add:
|
||||||
|
return s_AddPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Multiply:
|
||||||
|
return s_MultPipeline;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct CColoredQuadFilterGLDataBindingFactory : TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory
|
struct CColoredQuadFilterGLDataBindingFactory : TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
CCameraFilterPass::EFilterType type,
|
||||||
boo::IVertexFormat*,
|
|
||||||
CColoredQuadFilter& filter)
|
CColoredQuadFilter& filter)
|
||||||
{
|
{
|
||||||
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
||||||
|
@ -60,7 +78,7 @@ struct CColoredQuadFilterGLDataBindingFactory : TMultiBlendShader<CColoredQuadFi
|
||||||
};
|
};
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||||
return cctx.newShaderDataBinding(pipeline,
|
return cctx.newShaderDataBinding(SelectPipeline(type),
|
||||||
ctx.newVertexFormat(1, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
ctx.newVertexFormat(1, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
||||||
1, bufs, stages, nullptr, nullptr, 0, nullptr);
|
1, bufs, stages, nullptr, nullptr, 0, nullptr);
|
||||||
}
|
}
|
||||||
|
@ -70,14 +88,12 @@ struct CColoredQuadFilterGLDataBindingFactory : TMultiBlendShader<CColoredQuadFi
|
||||||
struct CColoredQuadFilterVulkanDataBindingFactory : TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory
|
struct CColoredQuadFilterVulkanDataBindingFactory : TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CColoredQuadFilter& filter)
|
CColoredQuadFilter& filter)
|
||||||
{
|
{
|
||||||
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(SelectPipeline(type), vtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 0, nullptr);
|
nullptr, nullptr, nullptr, 0, nullptr);
|
||||||
}
|
}
|
||||||
|
@ -85,40 +101,33 @@ struct CColoredQuadFilterVulkanDataBindingFactory : TMultiBlendShader<CColoredQu
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory*
|
TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory*
|
||||||
CColoredQuadFilter::Initialize(boo::GLDataFactory::Context& ctx,
|
CColoredQuadFilter::Initialize(boo::GLDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut)
|
|
||||||
{
|
{
|
||||||
const char* uniNames[] = {"ColoredQuadUniform"};
|
const char* uniNames[] = {"ColoredQuadUniform"};
|
||||||
alphaPipeOut = ctx.newShaderPipeline(VS, FS, 0, nullptr, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
s_AlphaPipeline = ctx.newShaderPipeline(VS, FS, 0, nullptr, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
additivePipeOut = ctx.newShaderPipeline(VS, FS, 0, nullptr, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
s_AddPipeline = ctx.newShaderPipeline(VS, FS, 0, nullptr, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
colorMultiplyPipeOut = ctx.newShaderPipeline(VS, FS, 0, nullptr, 1, uniNames, boo::BlendFactor::SrcColor,
|
s_MultPipeline = ctx.newShaderPipeline(VS, FS, 0, nullptr, 1, uniNames, boo::BlendFactor::SrcColor,
|
||||||
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CColoredQuadFilterGLDataBindingFactory;
|
return new CColoredQuadFilterGLDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory*
|
TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory*
|
||||||
CColoredQuadFilter::Initialize(boo::VulkanDataFactory::Context& ctx,
|
CColoredQuadFilter::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4}
|
{nullptr, nullptr, boo::VertexSemantic::Position4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(1, VtxVmt);
|
vtxFmtOut = ctx.newVertexFormat(1, VtxVmt);
|
||||||
alphaPipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
s_AlphaPipeline = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
additivePipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
s_AddPipeline = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
colorMultiplyPipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::SrcColor,
|
s_MultPipeline = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::SrcColor,
|
||||||
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CColoredQuadFilterVulkanDataBindingFactory;
|
return new CColoredQuadFilterVulkanDataBindingFactory;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -49,40 +49,55 @@ static const char* FS =
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
|
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_AlphaPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_AddPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_MultPipeline = nullptr;
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* SelectPipeline(CCameraFilterPass::EFilterType type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case CCameraFilterPass::EFilterType::Blend:
|
||||||
|
return s_AlphaPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Add:
|
||||||
|
return s_AddPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Multiply:
|
||||||
|
return s_MultPipeline;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct CColoredQuadFilterMetalDataBindingFactory : TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory
|
struct CColoredQuadFilterMetalDataBindingFactory : TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
CCameraFilterPass::EFilterType type,
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CColoredQuadFilter& filter)
|
CColoredQuadFilter& filter)
|
||||||
{
|
{
|
||||||
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(SelectPipeline(type), s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 0, nullptr);
|
nullptr, nullptr, nullptr, 0, nullptr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory*
|
TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory*
|
||||||
CColoredQuadFilter::Initialize(boo::MetalDataFactory::Context& ctx,
|
CColoredQuadFilter::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4}
|
{nullptr, nullptr, boo::VertexSemantic::Position4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(1, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(1, VtxVmt);
|
||||||
alphaPipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
s_AlphaPipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
additivePipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
s_AddPipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
colorMultiplyPipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcColor,
|
s_MultPipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcColor,
|
||||||
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CColoredQuadFilterMetalDataBindingFactory;
|
return new CColoredQuadFilterMetalDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,8 @@ void CSpaceWarpFilter::draw(const zeus::CVector3f& pt)
|
||||||
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSpaceWarpFilter::Shutdown() {}
|
||||||
|
|
||||||
URDE_SPECIALIZE_SHADER(CSpaceWarpFilter)
|
URDE_SPECIALIZE_SHADER(CSpaceWarpFilter)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,11 +53,11 @@ BOO_GLSL_BINDING_HEAD
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CSpaceWarpFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CSpaceWarpFilter)
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CSpaceWarpFilterGLDataBindingFactory : TShader<CSpaceWarpFilter>::IDataBindingFactory
|
struct CSpaceWarpFilterGLDataBindingFactory : TShader<CSpaceWarpFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat*,
|
|
||||||
CSpaceWarpFilter& filter)
|
CSpaceWarpFilter& filter)
|
||||||
{
|
{
|
||||||
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
||||||
|
@ -70,7 +70,7 @@ struct CSpaceWarpFilterGLDataBindingFactory : TShader<CSpaceWarpFilter>::IDataBi
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_warpTex};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_warpTex};
|
||||||
return cctx.newShaderDataBinding(pipeline,
|
return cctx.newShaderDataBinding(s_Pipeline,
|
||||||
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
||||||
1, bufs, stages, nullptr, nullptr, 2, texs);
|
1, bufs, stages, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,6 @@ struct CSpaceWarpFilterGLDataBindingFactory : TShader<CSpaceWarpFilter>::IDataBi
|
||||||
struct CSpaceWarpFilterVulkanDataBindingFactory : TShader<CSpaceWarpFilter>::IDataBindingFactory
|
struct CSpaceWarpFilterVulkanDataBindingFactory : TShader<CSpaceWarpFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CSpaceWarpFilter& filter)
|
CSpaceWarpFilter& filter)
|
||||||
{
|
{
|
||||||
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
||||||
|
@ -95,20 +93,17 @@ struct CSpaceWarpFilterVulkanDataBindingFactory : TShader<CSpaceWarpFilter>::IDa
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TShader<CSpaceWarpFilter>::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo::GLDataFactory::Context& ctx,
|
TShader<CSpaceWarpFilter>::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo::GLDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut)
|
|
||||||
{
|
{
|
||||||
const char* texNames[] = {"sceneTex", "indTex"};
|
const char* texNames[] = {"sceneTex", "indTex"};
|
||||||
const char* uniNames[] = {"SpaceWarpUniform"};
|
const char* uniNames[] = {"SpaceWarpUniform"};
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, 2, texNames, 1, uniNames, boo::BlendFactor::One,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, 2, texNames, 1, uniNames, boo::BlendFactor::One,
|
||||||
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CSpaceWarpFilterGLDataBindingFactory;
|
return new CSpaceWarpFilterGLDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
TShader<CSpaceWarpFilter>::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo::VulkanDataFactory::Context& ctx,
|
TShader<CSpaceWarpFilter>::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -116,8 +111,8 @@ TShader<CSpaceWarpFilter>::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::One,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::One,
|
||||||
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CSpaceWarpFilterVulkanDataBindingFactory;
|
return new CSpaceWarpFilterVulkanDataBindingFactory;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -57,35 +57,34 @@ static const char* FS =
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CSpaceWarpFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CSpaceWarpFilter)
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CSpaceWarpFilterMetalDataBindingFactory : TShader<CSpaceWarpFilter>::IDataBindingFactory
|
struct CSpaceWarpFilterMetalDataBindingFactory : TShader<CSpaceWarpFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CSpaceWarpFilter& filter)
|
CSpaceWarpFilter& filter)
|
||||||
{
|
{
|
||||||
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_warpTex};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_warpTex};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 2, texs);
|
nullptr, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CSpaceWarpFilter>::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo::MetalDataFactory::Context& ctx,
|
TShader<CSpaceWarpFilter>::IDataBindingFactory* CSpaceWarpFilter::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::One,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::One,
|
||||||
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CSpaceWarpFilterMetalDataBindingFactory;
|
return new CSpaceWarpFilterMetalDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
#include "CTextSupportShader.hpp"
|
||||||
|
#include "GuiSys/CRasterFont.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
|
||||||
|
boo::IVertexFormat* CTextSupportShader::s_TextVtxFmt = nullptr;
|
||||||
|
boo::IShaderPipeline* CTextSupportShader::s_TextAlphaPipeline = nullptr;
|
||||||
|
boo::IShaderPipeline* CTextSupportShader::s_TextAddPipeline = nullptr;
|
||||||
|
|
||||||
|
boo::IVertexFormat* CTextSupportShader::s_ImageVtxFmt = nullptr;
|
||||||
|
boo::IShaderPipeline* CTextSupportShader::s_ImageAlphaPipeline = nullptr;
|
||||||
|
boo::IShaderPipeline* CTextSupportShader::s_ImageAddPipeline = nullptr;
|
||||||
|
|
||||||
|
hecl::VertexBufferPool<CTextSupportShader::CharacterInstance> CTextSupportShader::s_CharInsts;
|
||||||
|
hecl::VertexBufferPool<CTextSupportShader::ImageInstance> CTextSupportShader::s_ImgInsts;
|
||||||
|
hecl::UniformBufferPool<CTextSupportShader::Uniform> CTextSupportShader::s_Uniforms;
|
||||||
|
|
||||||
|
void CTextSupportShader::CharacterInstance::SetMetrics(const CGlyph& glyph,
|
||||||
|
const zeus::CVector2i& offset)
|
||||||
|
{
|
||||||
|
float layer = glyph.GetLayer();
|
||||||
|
|
||||||
|
m_pos[0].assign(offset.x, 0.f, offset.y);
|
||||||
|
m_uv[0].assign(glyph.GetStartU(), 1.f - glyph.GetStartV(), layer);
|
||||||
|
|
||||||
|
m_pos[1].assign(offset.x + glyph.GetCellWidth(), 0.f, offset.y);
|
||||||
|
m_uv[1].assign(glyph.GetEndU(), 1.f - glyph.GetStartV(), layer);
|
||||||
|
|
||||||
|
m_pos[2].assign(offset.x, 0.f, offset.y + glyph.GetCellHeight());
|
||||||
|
m_uv[2].assign(glyph.GetStartU(), 1.f - glyph.GetEndV(), layer);
|
||||||
|
|
||||||
|
m_pos[3].assign(offset.x + glyph.GetCellWidth(), 0.f, offset.y + glyph.GetCellHeight());
|
||||||
|
m_uv[3].assign(glyph.GetEndU(), 1.f - glyph.GetEndV(), layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CTextSupportShader::ImageInstance::SetMetrics(const zeus::CVector2f& imgSize,
|
||||||
|
const zeus::CVector2i& offset)
|
||||||
|
{
|
||||||
|
m_pos[0].assign(offset.x, 0.f, offset.y);
|
||||||
|
m_uv[0].assign(0.f, 1.f);
|
||||||
|
|
||||||
|
m_pos[1].assign(offset.x + imgSize.x, 0.f, offset.y);
|
||||||
|
m_uv[1].assign(1.f, 1.f);
|
||||||
|
|
||||||
|
m_pos[2].assign(offset.x, 0.f, offset.y + imgSize.y);
|
||||||
|
m_uv[2].assign(0.f, 0.f);
|
||||||
|
|
||||||
|
m_pos[3].assign(offset.x + imgSize.x, 0.f, offset.y + imgSize.y);
|
||||||
|
m_uv[3].assign(1.f, 0.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CTextSupportShader::Shutdown()
|
||||||
|
{
|
||||||
|
s_CharInsts.doDestroy();
|
||||||
|
s_ImgInsts.doDestroy();
|
||||||
|
s_Uniforms.doDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
URDE_SPECIALIZE_MULTI_BLEND_SHADER(CTextSupportShader)
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,103 @@
|
||||||
|
#ifndef __URDE_CTEXTSUPPORTSHADER_HPP__
|
||||||
|
#define __URDE_CTEXTSUPPORTSHADER_HPP__
|
||||||
|
|
||||||
|
#include "TMultiBlendShader.hpp"
|
||||||
|
#include "GuiSys/CGuiWidget.hpp"
|
||||||
|
#include "hecl/VertexBufferPool.hpp"
|
||||||
|
#include "hecl/UniformBufferPool.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
class CGlyph;
|
||||||
|
class CTextRenderBuffer;
|
||||||
|
|
||||||
|
class CTextSupportShader
|
||||||
|
{
|
||||||
|
friend struct CTextSupportShaderGLDataBindingFactory;
|
||||||
|
friend struct CTextSupportShaderVulkanDataBindingFactory;
|
||||||
|
friend struct CTextSupportShaderMetalDataBindingFactory;
|
||||||
|
friend struct CTextSupportShaderD3DDataBindingFactory;
|
||||||
|
friend class CTextRenderBuffer;
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_TextVtxFmt;
|
||||||
|
static boo::IShaderPipeline* s_TextAlphaPipeline;
|
||||||
|
static boo::IShaderPipeline* s_TextAddPipeline;
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_ImageVtxFmt;
|
||||||
|
static boo::IShaderPipeline* s_ImageAlphaPipeline;
|
||||||
|
static boo::IShaderPipeline* s_ImageAddPipeline;
|
||||||
|
|
||||||
|
struct Uniform
|
||||||
|
{
|
||||||
|
zeus::CMatrix4f m_mvp;
|
||||||
|
zeus::CColor m_uniformColor;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CharacterInstance
|
||||||
|
{
|
||||||
|
zeus::CVector3f m_pos[4];
|
||||||
|
zeus::CVector3f m_uv[4];
|
||||||
|
zeus::CColor m_fontColor;
|
||||||
|
zeus::CColor m_outlineColor;
|
||||||
|
void SetMetrics(const CGlyph& glyph, const zeus::CVector2i& offset);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ImageInstance
|
||||||
|
{
|
||||||
|
zeus::CVector3f m_pos[4];
|
||||||
|
zeus::CVector2f m_uv[4];
|
||||||
|
zeus::CColor m_color;
|
||||||
|
void SetMetrics(const zeus::CVector2f& imgSize, const zeus::CVector2i& offset);
|
||||||
|
};
|
||||||
|
|
||||||
|
static hecl::VertexBufferPool<CharacterInstance> s_CharInsts;
|
||||||
|
static hecl::VertexBufferPool<ImageInstance> s_ImgInsts;
|
||||||
|
static hecl::UniformBufferPool<Uniform> s_Uniforms;
|
||||||
|
|
||||||
|
public:
|
||||||
|
using _CLS = CTextSupportShader;
|
||||||
|
#include "TMultiBlendShaderDecl.hpp"
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* SelectTextPipeline(CGuiWidget::EGuiModelDrawFlags df)
|
||||||
|
{
|
||||||
|
switch (df)
|
||||||
|
{
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::Shadeless:
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::Opaque:
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::Alpha:
|
||||||
|
return s_TextAlphaPipeline;
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::Additive:
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::AlphaAdditiveOverdraw:
|
||||||
|
return s_TextAddPipeline;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* SelectImagePipeline(CGuiWidget::EGuiModelDrawFlags df)
|
||||||
|
{
|
||||||
|
switch (df)
|
||||||
|
{
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::Shadeless:
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::Opaque:
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::Alpha:
|
||||||
|
return s_ImageAlphaPipeline;
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::Additive:
|
||||||
|
case CGuiWidget::EGuiModelDrawFlags::AlphaAdditiveOverdraw:
|
||||||
|
return s_ImageAddPipeline;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void UpdateBuffers()
|
||||||
|
{
|
||||||
|
s_CharInsts.updateBuffers();
|
||||||
|
s_ImgInsts.updateBuffers();
|
||||||
|
s_Uniforms.updateBuffers();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __URDE_CTEXTSUPPORTSHADER_HPP__
|
|
@ -0,0 +1,169 @@
|
||||||
|
#include "CTextSupportShader.hpp"
|
||||||
|
#include "GuiSys/CTextRenderBuffer.hpp"
|
||||||
|
#include "TMultiBlendShader.hpp"
|
||||||
|
#include "Graphics/CTexture.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
|
||||||
|
static const char* TextVS =
|
||||||
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
|
"layout(location=0) in vec4 posIn[4];\n"
|
||||||
|
"layout(location=4) in vec4 uvIn[4];\n"
|
||||||
|
"layout(location=8) in vec4 fontColorIn;\n"
|
||||||
|
"layout(location=9) in vec4 outlineColorIn;\n"
|
||||||
|
"\n"
|
||||||
|
"UBINDING0 uniform TextSupportUniform\n"
|
||||||
|
"{\n"
|
||||||
|
" mat4 mtx;\n"
|
||||||
|
" vec4 color;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct VertToFrag\n"
|
||||||
|
"{\n"
|
||||||
|
" vec4 fontColor;\n"
|
||||||
|
" vec4 outlineColor;\n"
|
||||||
|
" vec3 uv;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"SBINDING(0) out VertToFrag vtf;\n"
|
||||||
|
"void main()\n"
|
||||||
|
"{\n"
|
||||||
|
" vtf.fontColor = color * fontColorIn;\n"
|
||||||
|
" vtf.outlineColor = color * outlineColorIn;\n"
|
||||||
|
" vtf.uv = uvIn[gl_VertexID].xyz;\n"
|
||||||
|
" gl_Position = mtx * vec4(posIn[gl_VertexID].xyz, 1.0);\n"
|
||||||
|
" gl_Position = FLIPFROMGL(gl_Position);\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
static const char* TextFS =
|
||||||
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
|
"struct VertToFrag\n"
|
||||||
|
"{\n"
|
||||||
|
" vec4 fontColor;\n"
|
||||||
|
" vec4 outlineColor;\n"
|
||||||
|
" vec3 uv;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"SBINDING(0) in VertToFrag vtf;\n"
|
||||||
|
"layout(location=0) out vec4 colorOut;\n"
|
||||||
|
"TBINDING0 uniform sampler2DArray tex;\n"
|
||||||
|
"void main()\n"
|
||||||
|
"{\n"
|
||||||
|
" vec4 texel = texture(tex, vtf.uv);\n"
|
||||||
|
" colorOut = vtf.fontColor * texel.r + vtf.outlineColor * texel.g;\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
static const char* ImgVS =
|
||||||
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
|
"layout(location=0) in vec3 posIn[4];\n"
|
||||||
|
"layout(location=4) in vec2 uvIn[4];\n"
|
||||||
|
"layout(location=8) in vec4 colorIn;\n"
|
||||||
|
"\n"
|
||||||
|
"UBINDING0 uniform TextSupportUniform\n"
|
||||||
|
"{\n"
|
||||||
|
" mat4 mtx;\n"
|
||||||
|
" vec4 color;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct VertToFrag\n"
|
||||||
|
"{\n"
|
||||||
|
" vec4 color;\n"
|
||||||
|
" vec2 uv;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"SBINDING(0) out VertToFrag vtf;\n"
|
||||||
|
"void main()\n"
|
||||||
|
"{\n"
|
||||||
|
" vtf.color = color * colorIn;\n"
|
||||||
|
" vtf.uv = uvIn[gl_VertexID];\n"
|
||||||
|
" gl_Position = mtx * vec4(posIn[gl_VertexID].xyz, 1.0);\n"
|
||||||
|
" gl_Position = FLIPFROMGL(gl_Position);\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
static const char* ImgFS =
|
||||||
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
|
"struct VertToFrag\n"
|
||||||
|
"{\n"
|
||||||
|
" vec4 color;\n"
|
||||||
|
" vec2 uv;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"SBINDING(0) in VertToFrag vtf;\n"
|
||||||
|
"layout(location=0) out vec4 colorOut;\n"
|
||||||
|
"TBINDING0 uniform sampler2D tex;\n"
|
||||||
|
"void main()\n"
|
||||||
|
"{\n"
|
||||||
|
" vec4 texel = texture(tex, vtf.uv);\n"
|
||||||
|
" colorOut = vtf.color * texel;\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
TMultiBlendShader<CTextSupportShader>::IDataBindingFactory*
|
||||||
|
CTextSupportShader::Initialize(boo::GLDataFactory::Context& ctx)
|
||||||
|
{
|
||||||
|
const char* texNames[] = {"tex"};
|
||||||
|
const char* uniNames[] = {"TextSupportUniform"};
|
||||||
|
|
||||||
|
s_TextAlphaPipeline = ctx.newShaderPipeline(TextVS, TextFS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
s_TextAddPipeline = ctx.newShaderPipeline(TextVS, TextFS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
|
||||||
|
s_ImageAlphaPipeline = ctx.newShaderPipeline(ImgVS, ImgFS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
s_ImageAddPipeline = ctx.newShaderPipeline(ImgVS, ImgFS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if BOO_HAS_VULKAN
|
||||||
|
TMultiBlendShader<CTextSupportShader>::IDataBindingFactory*
|
||||||
|
CTextSupportShader::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||||
|
{
|
||||||
|
boo::VertexElementDescriptor TextVtxVmt[] =
|
||||||
|
{
|
||||||
|
{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::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::Color | boo::VertexSemantic::Instanced, 0},
|
||||||
|
{nullptr, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced, 1},
|
||||||
|
};
|
||||||
|
s_TextVtxFmt = ctx.newVertexFormat(10, TextVtxVmt);
|
||||||
|
s_TextAlphaPipeline = ctx.newShaderPipeline(TextVS, TextFS, s_TextVtxFmt, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
s_TextAddPipeline = ctx.newShaderPipeline(TextVS, TextFS, s_TextVtxFmt, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
|
||||||
|
boo::VertexElementDescriptor ImageVtxVmt[] =
|
||||||
|
{
|
||||||
|
{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::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::Color | boo::VertexSemantic::Instanced, 0},
|
||||||
|
};
|
||||||
|
s_ImageVtxFmt = ctx.newVertexFormat(9, ImageVtxVmt);
|
||||||
|
s_ImageAlphaPipeline = ctx.newShaderPipeline(ImgVS, ImgFS, s_ImageVtxFmt, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
s_ImageAddPipeline = ctx.newShaderPipeline(ImgVS, ImgFS, s_ImageVtxFmt, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,162 @@
|
||||||
|
#include "CTextSupportShader.hpp"
|
||||||
|
#include "GuiSys/CTextRenderBuffer.hpp"
|
||||||
|
#include "TMultiBlendShader.hpp"
|
||||||
|
#include "Graphics/CTexture.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
|
||||||
|
static const char* TextVS =
|
||||||
|
"#include <metal_stdlib>\n"
|
||||||
|
"using namespace metal;\n"
|
||||||
|
"struct InstData\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 posIn[4];\n"
|
||||||
|
" float4 uvIn[4];\n"
|
||||||
|
" float4 fontColorIn;\n"
|
||||||
|
" float4 outlineColorIn;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct TextSupportUniform\n"
|
||||||
|
"{\n"
|
||||||
|
" float4x4 mtx;\n"
|
||||||
|
" float4 color;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct VertToFrag\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 pos [[ position ]];\n"
|
||||||
|
" float4 fontColor;\n"
|
||||||
|
" float4 outlineColor;\n"
|
||||||
|
" float3 uv;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"vertex VertToFrag vmain(constant InstData* instArr [[ buffer(1) ]],\n"
|
||||||
|
" uint vertId [[ vertex_id ]], uint instId [[ instance_id ]],\n"
|
||||||
|
" constant TextSupportUniform& uData [[ buffer(2) ]])\n"
|
||||||
|
"{\n"
|
||||||
|
" VertToFrag vtf;\n"
|
||||||
|
" constant InstData& inst = instArr[instId];\n"
|
||||||
|
" vtf.fontColor = uData.color * inst.fontColorIn;\n"
|
||||||
|
" vtf.outlineColor = uData.color * inst.outlineColorIn;\n"
|
||||||
|
" vtf.uv = inst.uvIn[vertId].xyz;\n"
|
||||||
|
" vtf.pos = uData.mtx * float4(inst.posIn[vertId].xyz, 1.0);\n"
|
||||||
|
" return vtf;\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
static const char* TextFS =
|
||||||
|
"#include <metal_stdlib>\n"
|
||||||
|
"using namespace metal;\n"
|
||||||
|
"constexpr sampler samp(address::repeat);\n"
|
||||||
|
"struct VertToFrag\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 pos [[ position ]];\n"
|
||||||
|
" float4 fontColor;\n"
|
||||||
|
" float4 outlineColor;\n"
|
||||||
|
" float3 uv;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]],\n"
|
||||||
|
" texture2d_array<float> tex [[ texture(0) ]])\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 texel = tex.sample(samp, vtf.uv.xy, vtf.uv.z);\n"
|
||||||
|
" return vtf.fontColor * texel.r + vtf.outlineColor * texel.g;\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
static const char* ImgVS =
|
||||||
|
"#include <metal_stdlib>\n"
|
||||||
|
"using namespace metal;\n"
|
||||||
|
"struct InstData\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 posIn[4];\n"
|
||||||
|
" float4 uvIn[4];\n"
|
||||||
|
" float4 colorIn;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct TextSupportUniform\n"
|
||||||
|
"{\n"
|
||||||
|
" float4x4 mtx;\n"
|
||||||
|
" float4 color;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct VertToFrag\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 pos [[ position ]];\n"
|
||||||
|
" float4 color;\n"
|
||||||
|
" float2 uv;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"vertex VertToFrag vmain(constant InstData* instArr [[ buffer(1) ]],\n"
|
||||||
|
" uint vertId [[ vertex_id ]], uint instId [[ instance_id ]],\n"
|
||||||
|
" constant TextSupportUniform& uData [[ buffer(2) ]])\n"
|
||||||
|
"{\n"
|
||||||
|
" VertToFrag vtf;\n"
|
||||||
|
" constant InstData& inst = instArr[instId];\n"
|
||||||
|
" vtf.color = uData.color * inst.colorIn;\n"
|
||||||
|
" vtf.uv = inst.uvIn[vertId].xy;\n"
|
||||||
|
" vtf.pos = uData.mtx * float4(inst.posIn[vertId].xyz, 1.0);\n"
|
||||||
|
" return vtf;\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
static const char* ImgFS =
|
||||||
|
"#include <metal_stdlib>\n"
|
||||||
|
"using namespace metal;\n"
|
||||||
|
"constexpr sampler samp(address::repeat);\n"
|
||||||
|
"struct VertToFrag\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 pos [[ position ]];\n"
|
||||||
|
" float4 color;\n"
|
||||||
|
" float2 uv;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]],\n"
|
||||||
|
" texture2d<float> tex [[ texture(0) ]])\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 texel = tex.sample(samp, vtf.uv);\n"
|
||||||
|
" return vtf.color * texel;\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
TMultiBlendShader<CTextSupportShader>::IDataBindingFactory*
|
||||||
|
CTextSupportShader::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||||
|
{
|
||||||
|
boo::VertexElementDescriptor TextVtxVmt[] =
|
||||||
|
{
|
||||||
|
{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::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::Color | boo::VertexSemantic::Instanced, 0},
|
||||||
|
{nullptr, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced, 1},
|
||||||
|
};
|
||||||
|
s_TextVtxFmt = ctx.newVertexFormat(10, TextVtxVmt);
|
||||||
|
s_TextAlphaPipeline = ctx.newShaderPipeline(TextVS, TextFS, s_TextVtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
s_TextAddPipeline = ctx.newShaderPipeline(TextVS, TextFS, s_TextVtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
|
||||||
|
boo::VertexElementDescriptor ImageVtxVmt[] =
|
||||||
|
{
|
||||||
|
{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::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::Color | boo::VertexSemantic::Instanced, 0},
|
||||||
|
};
|
||||||
|
s_ImageVtxFmt = ctx.newVertexFormat(9, ImageVtxVmt);
|
||||||
|
s_ImageAlphaPipeline = ctx.newShaderPipeline(ImgVS, ImgFS, s_ImageVtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
s_ImageAddPipeline = ctx.newShaderPipeline(ImgVS, ImgFS, s_ImageVtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -77,6 +77,8 @@ void CTexturedQuadFilter::drawCropped(const zeus::CColor& color, float uvScale)
|
||||||
|
|
||||||
const zeus::CRectangle CTexturedQuadFilter::DefaultRect = {0.f, 0.f, 1.f, 1.f};
|
const zeus::CRectangle CTexturedQuadFilter::DefaultRect = {0.f, 0.f, 1.f, 1.f};
|
||||||
|
|
||||||
|
void CTexturedQuadFilter::Shutdown() {}
|
||||||
|
|
||||||
URDE_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
|
URDE_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
|
||||||
|
|
||||||
CTexturedQuadFilterAlpha::CTexturedQuadFilterAlpha(CCameraFilterPass::EFilterType type, boo::ITexture* tex)
|
CTexturedQuadFilterAlpha::CTexturedQuadFilterAlpha(CCameraFilterPass::EFilterType type, boo::ITexture* tex)
|
||||||
|
@ -98,6 +100,8 @@ CTexturedQuadFilterAlpha::CTexturedQuadFilterAlpha(CCameraFilterPass::EFilterTyp
|
||||||
m_tex = tex;
|
m_tex = tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CTexturedQuadFilterAlpha::Shutdown() {}
|
||||||
|
|
||||||
URDE_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilterAlpha)
|
URDE_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilterAlpha)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,11 +97,48 @@ BOO_GLSL_BINDING_HEAD
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
|
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* s_AlphaPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_AddPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_MultPipeline = nullptr;
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* SelectPipeline(CCameraFilterPass::EFilterType type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case CCameraFilterPass::EFilterType::Blend:
|
||||||
|
return s_AlphaPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Add:
|
||||||
|
return s_AddPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Multiply:
|
||||||
|
return s_MultPipeline;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* s_AAlphaPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_AAddPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_AMultPipeline = nullptr;
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* SelectAlphaPipeline(CCameraFilterPass::EFilterType type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case CCameraFilterPass::EFilterType::Blend:
|
||||||
|
return s_AAlphaPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Add:
|
||||||
|
return s_AAddPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Multiply:
|
||||||
|
return s_AMultPipeline;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct CTexturedQuadFilterGLDataBindingFactory : TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory
|
struct CTexturedQuadFilterGLDataBindingFactory : TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
CCameraFilterPass::EFilterType type,
|
||||||
boo::IVertexFormat*,
|
|
||||||
CTexturedQuadFilter& filter)
|
CTexturedQuadFilter& filter)
|
||||||
{
|
{
|
||||||
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
||||||
|
@ -114,7 +151,7 @@ struct CTexturedQuadFilterGLDataBindingFactory : TMultiBlendShader<CTexturedQuad
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||||
boo::ITexture* texs[] = {filter.m_booTex};
|
boo::ITexture* texs[] = {filter.m_booTex};
|
||||||
return cctx.newShaderDataBinding(pipeline,
|
return cctx.newShaderDataBinding(SelectPipeline(type),
|
||||||
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
||||||
1, bufs, stages, nullptr, nullptr, 1, texs);
|
1, bufs, stages, nullptr, nullptr, 1, texs);
|
||||||
}
|
}
|
||||||
|
@ -124,15 +161,14 @@ struct CTexturedQuadFilterGLDataBindingFactory : TMultiBlendShader<CTexturedQuad
|
||||||
struct CTexturedQuadFilterVulkanDataBindingFactory : TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory
|
struct CTexturedQuadFilterVulkanDataBindingFactory : TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
CCameraFilterPass::EFilterType type,
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CTexturedQuadFilter& filter)
|
CTexturedQuadFilter& filter)
|
||||||
{
|
{
|
||||||
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {filter.m_booTex};
|
boo::ITexture* texs[] = {filter.m_booTex};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(SelectPipeline(type), vtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 1, texs);
|
nullptr, nullptr, nullptr, 1, texs);
|
||||||
}
|
}
|
||||||
|
@ -140,29 +176,22 @@ struct CTexturedQuadFilterVulkanDataBindingFactory : TMultiBlendShader<CTextured
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory*
|
TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory*
|
||||||
CTexturedQuadFilter::Initialize(boo::GLDataFactory::Context& ctx,
|
CTexturedQuadFilter::Initialize(boo::GLDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut)
|
|
||||||
{
|
{
|
||||||
const char* texNames[] = {"tex"};
|
const char* texNames[] = {"tex"};
|
||||||
const char* uniNames[] = {"TexuredQuadUniform"};
|
const char* uniNames[] = {"TexuredQuadUniform"};
|
||||||
alphaPipeOut = ctx.newShaderPipeline(VSNoFlip, FS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
s_AlphaPipeline = ctx.newShaderPipeline(VSNoFlip, FS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
additivePipeOut = ctx.newShaderPipeline(VSNoFlip, FS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
s_AddPipeline = ctx.newShaderPipeline(VSNoFlip, FS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
colorMultiplyPipeOut = ctx.newShaderPipeline(VSNoFlip, FS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcColor,
|
s_MultPipeline = ctx.newShaderPipeline(VSNoFlip, FS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcColor,
|
||||||
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CTexturedQuadFilterGLDataBindingFactory;
|
return new CTexturedQuadFilterGLDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory*
|
TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory*
|
||||||
CTexturedQuadFilter::Initialize(boo::VulkanDataFactory::Context& ctx,
|
CTexturedQuadFilter::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -170,12 +199,12 @@ CTexturedQuadFilter::Initialize(boo::VulkanDataFactory::Context& ctx,
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
||||||
alphaPipeOut = ctx.newShaderPipeline(VSNoFlip, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
s_AlphaPipeline = ctx.newShaderPipeline(VSNoFlip, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
additivePipeOut = ctx.newShaderPipeline(VSNoFlip, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
s_AddPipeline = ctx.newShaderPipeline(VSNoFlip, FS, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
colorMultiplyPipeOut = ctx.newShaderPipeline(VSNoFlip, FS, vtxFmtOut, boo::BlendFactor::SrcColor,
|
s_MultPipeline = ctx.newShaderPipeline(VSNoFlip, FS, vtxFmtOut, boo::BlendFactor::SrcColor,
|
||||||
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CTexturedQuadFilterVulkanDataBindingFactory;
|
return new CTexturedQuadFilterVulkanDataBindingFactory;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -185,8 +214,7 @@ URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilterAlpha)
|
||||||
struct CTexturedQuadFilterAlphaGLDataBindingFactory : TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory
|
struct CTexturedQuadFilterAlphaGLDataBindingFactory : TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
CCameraFilterPass::EFilterType type,
|
||||||
boo::IVertexFormat*,
|
|
||||||
CTexturedQuadFilterAlpha& filter)
|
CTexturedQuadFilterAlpha& filter)
|
||||||
{
|
{
|
||||||
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
||||||
|
@ -199,7 +227,7 @@ struct CTexturedQuadFilterAlphaGLDataBindingFactory : TMultiBlendShader<CTexture
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||||
boo::ITexture* texs[] = {filter.m_booTex};
|
boo::ITexture* texs[] = {filter.m_booTex};
|
||||||
return cctx.newShaderDataBinding(pipeline,
|
return cctx.newShaderDataBinding(SelectAlphaPipeline(type),
|
||||||
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
||||||
1, bufs, stages, nullptr, nullptr, 1, texs);
|
1, bufs, stages, nullptr, nullptr, 1, texs);
|
||||||
}
|
}
|
||||||
|
@ -209,15 +237,14 @@ struct CTexturedQuadFilterAlphaGLDataBindingFactory : TMultiBlendShader<CTexture
|
||||||
struct CTexturedQuadFilterAlphaVulkanDataBindingFactory : TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory
|
struct CTexturedQuadFilterAlphaVulkanDataBindingFactory : TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
CCameraFilterPass::EFilterType type,
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CTexturedQuadFilterAlpha& filter)
|
CTexturedQuadFilterAlpha& filter)
|
||||||
{
|
{
|
||||||
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {filter.m_booTex};
|
boo::ITexture* texs[] = {filter.m_booTex};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(SelectAlphaPipeline(type), vtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 1, texs);
|
nullptr, nullptr, nullptr, 1, texs);
|
||||||
}
|
}
|
||||||
|
@ -225,29 +252,22 @@ struct CTexturedQuadFilterAlphaVulkanDataBindingFactory : TMultiBlendShader<CTex
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory*
|
TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory*
|
||||||
CTexturedQuadFilterAlpha::Initialize(boo::GLDataFactory::Context& ctx,
|
CTexturedQuadFilterAlpha::Initialize(boo::GLDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut)
|
|
||||||
{
|
{
|
||||||
const char* texNames[] = {"tex"};
|
const char* texNames[] = {"tex"};
|
||||||
const char* uniNames[] = {"TexuredQuadUniform"};
|
const char* uniNames[] = {"TexuredQuadUniform"};
|
||||||
alphaPipeOut = ctx.newShaderPipeline(VSFlip, FSAlpha, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
s_AAlphaPipeline = ctx.newShaderPipeline(VSFlip, FSAlpha, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
additivePipeOut = ctx.newShaderPipeline(VSFlip, FSAlpha, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
s_AAddPipeline = ctx.newShaderPipeline(VSFlip, FSAlpha, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
colorMultiplyPipeOut = ctx.newShaderPipeline(VSFlip, FSAlpha, 1, texNames, 1, uniNames, boo::BlendFactor::SrcColor,
|
s_AMultPipeline = ctx.newShaderPipeline(VSFlip, FSAlpha, 1, texNames, 1, uniNames, boo::BlendFactor::SrcColor,
|
||||||
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CTexturedQuadFilterAlphaGLDataBindingFactory;
|
return new CTexturedQuadFilterAlphaGLDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory*
|
TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory*
|
||||||
CTexturedQuadFilterAlpha::Initialize(boo::VulkanDataFactory::Context& ctx,
|
CTexturedQuadFilterAlpha::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -255,12 +275,12 @@ CTexturedQuadFilterAlpha::Initialize(boo::VulkanDataFactory::Context& ctx,
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
||||||
alphaPipeOut = ctx.newShaderPipeline(VSFlip, FSAlpha, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
s_AAlphaPipeline = ctx.newShaderPipeline(VSFlip, FSAlpha, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
additivePipeOut = ctx.newShaderPipeline(VSFlip, FSAlpha, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
s_AAddPipeline = ctx.newShaderPipeline(VSFlip, FSAlpha, vtxFmtOut, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
colorMultiplyPipeOut = ctx.newShaderPipeline(VSFlip, FSAlpha, vtxFmtOut, boo::BlendFactor::SrcColor,
|
s_AMultPipeline = ctx.newShaderPipeline(VSFlip, FSAlpha, vtxFmtOut, boo::BlendFactor::SrcColor,
|
||||||
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CTexturedQuadFilterAlphaVulkanDataBindingFactory;
|
return new CTexturedQuadFilterAlphaVulkanDataBindingFactory;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -103,81 +103,91 @@ static const char* FSAlpha =
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
|
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_AlphaPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_AddPipeline = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_MultPipeline = nullptr;
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* SelectPipeline(CCameraFilterPass::EFilterType type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case CCameraFilterPass::EFilterType::Blend:
|
||||||
|
return s_AlphaPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Add:
|
||||||
|
return s_AddPipeline;
|
||||||
|
case CCameraFilterPass::EFilterType::Multiply:
|
||||||
|
return s_MultPipeline;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct CTexturedQuadFilterMetalDataBindingFactory : TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory
|
struct CTexturedQuadFilterMetalDataBindingFactory : TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
CCameraFilterPass::EFilterType type,
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CTexturedQuadFilter& filter)
|
CTexturedQuadFilter& filter)
|
||||||
{
|
{
|
||||||
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {filter.m_booTex};
|
boo::ITexture* texs[] = {filter.m_booTex};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(SelectPipeline(type), s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 1, texs);
|
nullptr, nullptr, nullptr, 1, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory*
|
TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory*
|
||||||
CTexturedQuadFilter::Initialize(boo::MetalDataFactory::Context& ctx,
|
CTexturedQuadFilter::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||||
alphaPipeOut = ctx.newShaderPipeline(VSNoFlip, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
s_AlphaPipeline = ctx.newShaderPipeline(VSNoFlip, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
additivePipeOut = ctx.newShaderPipeline(VSNoFlip, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
s_AddPipeline = ctx.newShaderPipeline(VSNoFlip, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
colorMultiplyPipeOut = ctx.newShaderPipeline(VSNoFlip, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcColor,
|
s_MultPipeline = ctx.newShaderPipeline(VSNoFlip, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcColor,
|
||||||
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CTexturedQuadFilterMetalDataBindingFactory;
|
return new CTexturedQuadFilterMetalDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CTexturedQuadFilterAlphaMetalDataBindingFactory : TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory
|
struct CTexturedQuadFilterAlphaMetalDataBindingFactory : TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
CCameraFilterPass::EFilterType type,
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CTexturedQuadFilterAlpha& filter)
|
CTexturedQuadFilterAlpha& filter)
|
||||||
{
|
{
|
||||||
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {filter.m_booTex};
|
boo::ITexture* texs[] = {filter.m_booTex};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(SelectPipeline(type), s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 1, texs);
|
nullptr, nullptr, nullptr, 1, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory*
|
TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory*
|
||||||
CTexturedQuadFilterAlpha::Initialize(boo::MetalDataFactory::Context& ctx,
|
CTexturedQuadFilterAlpha::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||||
alphaPipeOut = ctx.newShaderPipeline(VSFlip, FSAlpha, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
s_AlphaPipeline = ctx.newShaderPipeline(VSFlip, FSAlpha, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
additivePipeOut = ctx.newShaderPipeline(VSFlip, FSAlpha, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
s_AddPipeline = ctx.newShaderPipeline(VSFlip, FSAlpha, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcAlpha,
|
||||||
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
|
||||||
colorMultiplyPipeOut = ctx.newShaderPipeline(VSFlip, FSAlpha, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcColor,
|
s_MultPipeline = ctx.newShaderPipeline(VSFlip, FSAlpha, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::SrcColor,
|
||||||
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CTexturedQuadFilterAlphaMetalDataBindingFactory;
|
return new CTexturedQuadFilterAlphaMetalDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,8 @@ void CThermalColdFilter::draw()
|
||||||
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CThermalColdFilter::Shutdown() {}
|
||||||
|
|
||||||
URDE_SPECIALIZE_SHADER(CThermalColdFilter)
|
URDE_SPECIALIZE_SHADER(CThermalColdFilter)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,11 +75,11 @@ BOO_GLSL_BINDING_HEAD
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CThermalColdFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CThermalColdFilter)
|
||||||
|
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CThermalColdFilterGLDataBindingFactory : TShader<CThermalColdFilter>::IDataBindingFactory
|
struct CThermalColdFilterGLDataBindingFactory : TShader<CThermalColdFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat*,
|
|
||||||
CThermalColdFilter& filter)
|
CThermalColdFilter& filter)
|
||||||
{
|
{
|
||||||
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
||||||
|
@ -92,7 +92,7 @@ struct CThermalColdFilterGLDataBindingFactory : TShader<CThermalColdFilter>::IDa
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_shiftTex};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_shiftTex};
|
||||||
return cctx.newShaderDataBinding(pipeline,
|
return cctx.newShaderDataBinding(s_Pipeline,
|
||||||
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
||||||
1, bufs, stages, nullptr, nullptr, 2, texs);
|
1, bufs, stages, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
|
@ -102,35 +102,30 @@ struct CThermalColdFilterGLDataBindingFactory : TShader<CThermalColdFilter>::IDa
|
||||||
struct CThermalColdFilterVulkanDataBindingFactory : TShader<CThermalColdFilter>::IDataBindingFactory
|
struct CThermalColdFilterVulkanDataBindingFactory : TShader<CThermalColdFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CThermalColdFilter& filter)
|
CThermalColdFilter& filter)
|
||||||
{
|
{
|
||||||
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_shiftTex};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_shiftTex};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(s_Pipeline, vtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 2, texs);
|
nullptr, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::GLDataFactory::Context& ctx,
|
TShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::GLDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut)
|
|
||||||
{
|
{
|
||||||
const char* texNames[] = {"sceneTex", "shiftTex"};
|
const char* texNames[] = {"sceneTex", "shiftTex"};
|
||||||
const char* uniNames[] = {"ThermalColdUniform"};
|
const char* uniNames[] = {"ThermalColdUniform"};
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, 2, texNames, 1, uniNames, boo::BlendFactor::One,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, 2, texNames, 1, uniNames, boo::BlendFactor::One,
|
||||||
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CThermalColdFilterGLDataBindingFactory;
|
return new CThermalColdFilterGLDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
TShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::VulkanDataFactory::Context& ctx,
|
TShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -138,8 +133,8 @@ TShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::One,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::One,
|
||||||
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CThermalColdFilterVulkanDataBindingFactory;
|
return new CThermalColdFilterVulkanDataBindingFactory;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -85,35 +85,34 @@ static const char* FS =
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CThermalColdFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CThermalColdFilter)
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CThermalColdFilterMetalDataBindingFactory : TShader<CThermalColdFilter>::IDataBindingFactory
|
struct CThermalColdFilterMetalDataBindingFactory : TShader<CThermalColdFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CThermalColdFilter& filter)
|
CThermalColdFilter& filter)
|
||||||
{
|
{
|
||||||
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_shiftTex};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_shiftTex};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 2, texs);
|
nullptr, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::MetalDataFactory::Context& ctx,
|
TShader<CThermalColdFilter>::IDataBindingFactory* CThermalColdFilter::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::One,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::One,
|
||||||
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CThermalColdFilterMetalDataBindingFactory;
|
return new CThermalColdFilterMetalDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@ void CThermalHotFilter::draw()
|
||||||
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CThermalHotFilter::Shutdown() {}
|
||||||
|
|
||||||
URDE_SPECIALIZE_SHADER(CThermalHotFilter)
|
URDE_SPECIALIZE_SHADER(CThermalHotFilter)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,11 +52,12 @@ BOO_GLSL_BINDING_HEAD
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CThermalHotFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CThermalHotFilter)
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CThermalHotFilterGLDataBindingFactory : TShader<CThermalHotFilter>::IDataBindingFactory
|
struct CThermalHotFilterGLDataBindingFactory : TShader<CThermalHotFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat*,
|
|
||||||
CThermalHotFilter& filter)
|
CThermalHotFilter& filter)
|
||||||
{
|
{
|
||||||
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
||||||
|
@ -69,7 +70,7 @@ struct CThermalHotFilterGLDataBindingFactory : TShader<CThermalHotFilter>::IData
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, g_Renderer->GetThermoPalette()};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, g_Renderer->GetThermoPalette()};
|
||||||
return cctx.newShaderDataBinding(pipeline,
|
return cctx.newShaderDataBinding(s_Pipeline,
|
||||||
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
||||||
1, bufs, stages, nullptr, nullptr, 2, texs);
|
1, bufs, stages, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
|
@ -79,44 +80,39 @@ struct CThermalHotFilterGLDataBindingFactory : TShader<CThermalHotFilter>::IData
|
||||||
struct CThermalHotFilterVulkanDataBindingFactory : TShader<CThermalHotFilter>::IDataBindingFactory
|
struct CThermalHotFilterVulkanDataBindingFactory : TShader<CThermalHotFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CThermalHotFilter& filter)
|
CThermalHotFilter& filter)
|
||||||
{
|
{
|
||||||
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, g_Renderer->GetThermoPalette()};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, g_Renderer->GetThermoPalette()};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 2, texs);
|
nullptr, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TShader<CThermalHotFilter>::IDataBindingFactory* CThermalHotFilter::Initialize(boo::GLDataFactory::Context& ctx,
|
TShader<CThermalHotFilter>::IDataBindingFactory* CThermalHotFilter::Initialize(boo::GLDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut)
|
|
||||||
{
|
{
|
||||||
const char* texNames[] = {"sceneTex", "paletteTex"};
|
const char* texNames[] = {"sceneTex", "paletteTex"};
|
||||||
const char* uniNames[] = {"ThermalHotUniform"};
|
const char* uniNames[] = {"ThermalHotUniform"};
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, 2, texNames, 1, uniNames, boo::BlendFactor::DstAlpha,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, 2, texNames, 1, uniNames, boo::BlendFactor::DstAlpha,
|
||||||
boo::BlendFactor::InvDstAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvDstAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CThermalHotFilterGLDataBindingFactory;
|
return new CThermalHotFilterGLDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
TShader<CThermalHotFilter>::IDataBindingFactory* CThermalHotFilter::Initialize(boo::VulkanDataFactory::Context& ctx,
|
TShader<CThermalHotFilter>::IDataBindingFactory* CThermalHotFilter::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::DstAlpha,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, boo::BlendFactor::DstAlpha,
|
||||||
boo::BlendFactor::InvDstAlpha, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::InvDstAlpha, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CThermalHotFilterVulkanDataBindingFactory;
|
return new CThermalHotFilterVulkanDataBindingFactory;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -58,36 +58,35 @@ static const char* FS =
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CThermalHotFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CThermalHotFilter)
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CThermalHotFilterMetalDataBindingFactory : TShader<CThermalHotFilter>::IDataBindingFactory
|
struct CThermalHotFilterMetalDataBindingFactory : TShader<CThermalHotFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CThermalHotFilter& filter)
|
CThermalHotFilter& filter)
|
||||||
{
|
{
|
||||||
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, g_Renderer->GetThermoPalette()};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, g_Renderer->GetThermoPalette()};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 2, texs);
|
nullptr, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CThermalHotFilter>::IDataBindingFactory* CThermalHotFilter::Initialize(boo::MetalDataFactory::Context& ctx,
|
TShader<CThermalHotFilter>::IDataBindingFactory* CThermalHotFilter::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, CGraphics::g_ViewportSamples,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, CGraphics::g_ViewportSamples,
|
||||||
boo::BlendFactor::DstAlpha, boo::BlendFactor::InvDstAlpha,
|
boo::BlendFactor::DstAlpha, boo::BlendFactor::InvDstAlpha,
|
||||||
boo::Primitive::TriStrips, false, false, false);
|
boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CThermalHotFilterMetalDataBindingFactory;
|
return new CThermalHotFilterMetalDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,8 @@ void CXRayBlurFilter::draw(float amount)
|
||||||
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
CGraphics::g_BooMainCommandQueue->draw(0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CXRayBlurFilter::Shutdown() {}
|
||||||
|
|
||||||
URDE_SPECIALIZE_SHADER(CXRayBlurFilter)
|
URDE_SPECIALIZE_SHADER(CXRayBlurFilter)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,11 +64,12 @@ BOO_GLSL_BINDING_HEAD
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CXRayBlurFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CXRayBlurFilter)
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CXRayBlurFilterGLDataBindingFactory : TShader<CXRayBlurFilter>::IDataBindingFactory
|
struct CXRayBlurFilterGLDataBindingFactory : TShader<CXRayBlurFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat*,
|
|
||||||
CXRayBlurFilter& filter)
|
CXRayBlurFilter& filter)
|
||||||
{
|
{
|
||||||
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
||||||
|
@ -81,7 +82,7 @@ struct CXRayBlurFilterGLDataBindingFactory : TShader<CXRayBlurFilter>::IDataBind
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_booTex};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_booTex};
|
||||||
return cctx.newShaderDataBinding(pipeline,
|
return cctx.newShaderDataBinding(s_Pipeline,
|
||||||
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr,
|
||||||
1, bufs, stages, nullptr, nullptr, 2, texs);
|
1, bufs, stages, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
|
@ -99,36 +100,33 @@ struct CXRayBlurFilterVulkanDataBindingFactory : TShader<CXRayBlurFilter>::IData
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_booTex};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_booTex};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 2, texs);
|
nullptr, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TShader<CXRayBlurFilter>::IDataBindingFactory* CXRayBlurFilter::Initialize(boo::GLDataFactory::Context& ctx,
|
TShader<CXRayBlurFilter>::IDataBindingFactory* CXRayBlurFilter::Initialize(boo::GLDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut)
|
|
||||||
{
|
{
|
||||||
const char* texNames[] = {"sceneTex", "paletteTex"};
|
const char* texNames[] = {"sceneTex", "paletteTex"};
|
||||||
const char* uniNames[] = {"XRayBlurUniform"};
|
const char* uniNames[] = {"XRayBlurUniform"};
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, 2, texNames, 1, uniNames, boo::BlendFactor::One,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, 2, texNames, 1, uniNames, boo::BlendFactor::One,
|
||||||
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CXRayBlurFilterGLDataBindingFactory;
|
return new CXRayBlurFilterGLDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
TShader<CXRayBlurFilter>::IDataBindingFactory* CXRayBlurFilter::Initialize(boo::VulkanDataFactory::Context& ctx,
|
TShader<CXRayBlurFilter>::IDataBindingFactory* CXRayBlurFilter::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, boo::BlendFactor::One,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, boo::BlendFactor::One,
|
||||||
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CXRayBlurFilterVulkanDataBindingFactory;
|
return new CXRayBlurFilterVulkanDataBindingFactory;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -73,35 +73,34 @@ static const char* FS =
|
||||||
|
|
||||||
URDE_DECL_SPECIALIZE_SHADER(CXRayBlurFilter)
|
URDE_DECL_SPECIALIZE_SHADER(CXRayBlurFilter)
|
||||||
|
|
||||||
|
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||||
|
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||||
|
|
||||||
struct CXRayBlurFilterMetalDataBindingFactory : TShader<CXRayBlurFilter>::IDataBindingFactory
|
struct CXRayBlurFilterMetalDataBindingFactory : TShader<CXRayBlurFilter>::IDataBindingFactory
|
||||||
{
|
{
|
||||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
CXRayBlurFilter& filter)
|
CXRayBlurFilter& filter)
|
||||||
{
|
{
|
||||||
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||||
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_booTex};
|
boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_booTex};
|
||||||
return cctx.newShaderDataBinding(pipeline, vtxFmt,
|
return cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
|
||||||
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
filter.m_vbo, nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 2, texs);
|
nullptr, nullptr, nullptr, 2, texs);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CXRayBlurFilter>::IDataBindingFactory* CXRayBlurFilter::Initialize(boo::MetalDataFactory::Context& ctx,
|
TShader<CXRayBlurFilter>::IDataBindingFactory* CXRayBlurFilter::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut)
|
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
{nullptr, nullptr, boo::VertexSemantic::Position4},
|
||||||
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
{nullptr, nullptr, boo::VertexSemantic::UV4}
|
||||||
};
|
};
|
||||||
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
|
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||||
pipeOut = ctx.newShaderPipeline(VS, FS, vtxFmtOut, CGraphics::g_ViewportSamples, boo::BlendFactor::One,
|
s_Pipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, CGraphics::g_ViewportSamples, boo::BlendFactor::One,
|
||||||
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
boo::BlendFactor::Zero, boo::Primitive::TriStrips, false, false, false);
|
||||||
return new CXRayBlurFilterMetalDataBindingFactory;
|
return new CXRayBlurFilterMetalDataBindingFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,23 +11,17 @@
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
template <class FilterImp>
|
template <class ShaderImp>
|
||||||
class TMultiBlendShader
|
class TMultiBlendShader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct IDataBindingFactory
|
struct IDataBindingFactory
|
||||||
{
|
{
|
||||||
virtual boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
virtual boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
CCameraFilterPass::EFilterType type,
|
||||||
boo::IVertexFormat* vtxFmt,
|
ShaderImp& filter)=0;
|
||||||
FilterImp& filter)=0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static boo::IShaderPipeline* m_alphaBlendPipeline;
|
|
||||||
static boo::IShaderPipeline* m_additiveAlphaPipeline;
|
|
||||||
static boo::IShaderPipeline* m_colorMultiplyPipeline;
|
|
||||||
static boo::IVertexFormat* m_vtxFmt; /* No OpenGL */
|
|
||||||
|
|
||||||
static std::unique_ptr<IDataBindingFactory> m_bindFactory;
|
static std::unique_ptr<IDataBindingFactory> m_bindFactory;
|
||||||
static boo::GraphicsDataToken m_gfxToken;
|
static boo::GraphicsDataToken m_gfxToken;
|
||||||
|
|
||||||
|
@ -42,29 +36,22 @@ public:
|
||||||
switch (ctx.platform())
|
switch (ctx.platform())
|
||||||
{
|
{
|
||||||
case boo::IGraphicsDataFactory::Platform::OpenGL:
|
case boo::IGraphicsDataFactory::Platform::OpenGL:
|
||||||
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::GLDataFactory::Context&>(ctx),
|
m_bindFactory.reset(ShaderImp::Initialize(static_cast<boo::GLDataFactory::Context&>(ctx)));
|
||||||
m_alphaBlendPipeline, m_additiveAlphaPipeline, m_colorMultiplyPipeline));
|
|
||||||
break;
|
break;
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
case boo::IGraphicsDataFactory::Platform::D3D12:
|
||||||
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::ID3DDataFactory::Context&>(ctx),
|
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::ID3DDataFactory::Context&>(ctx)));
|
||||||
m_alphaBlendPipeline, m_additiveAlphaPipeline,
|
|
||||||
m_colorMultiplyPipeline, m_vtxFmt));
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
case boo::IGraphicsDataFactory::Platform::Metal:
|
case boo::IGraphicsDataFactory::Platform::Metal:
|
||||||
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::MetalDataFactory::Context&>(ctx),
|
m_bindFactory.reset(ShaderImp::Initialize(static_cast<boo::MetalDataFactory::Context&>(ctx)));
|
||||||
m_alphaBlendPipeline, m_additiveAlphaPipeline,
|
|
||||||
m_colorMultiplyPipeline, m_vtxFmt));
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
||||||
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::VulkanDataFactory::Context&>(ctx),
|
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::VulkanDataFactory::Context&>(ctx)));
|
||||||
m_alphaBlendPipeline, m_additiveAlphaPipeline,
|
|
||||||
m_colorMultiplyPipeline, m_vtxFmt));
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default: break;
|
default: break;
|
||||||
|
@ -75,47 +62,25 @@ public:
|
||||||
|
|
||||||
static void Shutdown()
|
static void Shutdown()
|
||||||
{
|
{
|
||||||
|
ShaderImp::Shutdown();
|
||||||
m_gfxToken.doDestroy();
|
m_gfxToken.doDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
static boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
static boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
CCameraFilterPass::EFilterType type,
|
CCameraFilterPass::EFilterType type,
|
||||||
FilterImp& filter)
|
ShaderImp& filter)
|
||||||
{
|
{
|
||||||
if (type == CCameraFilterPass::EFilterType::Add)
|
return m_bindFactory->BuildShaderDataBinding(ctx, type, filter);
|
||||||
return m_bindFactory->BuildShaderDataBinding(ctx, m_additiveAlphaPipeline, m_vtxFmt, filter);
|
|
||||||
else if (type == CCameraFilterPass::EFilterType::Multiply)
|
|
||||||
return m_bindFactory->BuildShaderDataBinding(ctx, m_colorMultiplyPipeline, m_vtxFmt, filter);
|
|
||||||
else
|
|
||||||
return m_bindFactory->BuildShaderDataBinding(ctx, m_alphaBlendPipeline, m_vtxFmt, filter);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(cls) \
|
#define URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(cls) \
|
||||||
template <> boo::IShaderPipeline* \
|
|
||||||
TMultiBlendShader<cls>::m_alphaBlendPipeline; \
|
|
||||||
template <> boo::IShaderPipeline* \
|
|
||||||
TMultiBlendShader<cls>::m_additiveAlphaPipeline; \
|
|
||||||
template <> boo::IShaderPipeline* \
|
|
||||||
TMultiBlendShader<cls>::m_colorMultiplyPipeline; \
|
|
||||||
template <> boo::IVertexFormat* \
|
|
||||||
TMultiBlendShader<cls>::m_vtxFmt; \
|
|
||||||
\
|
|
||||||
template <> std::unique_ptr<TMultiBlendShader<cls>::IDataBindingFactory> \
|
template <> std::unique_ptr<TMultiBlendShader<cls>::IDataBindingFactory> \
|
||||||
TMultiBlendShader<cls>::m_bindFactory; \
|
TMultiBlendShader<cls>::m_bindFactory; \
|
||||||
template <> boo::GraphicsDataToken \
|
template <> boo::GraphicsDataToken \
|
||||||
TMultiBlendShader<cls>::m_gfxToken; \
|
TMultiBlendShader<cls>::m_gfxToken; \
|
||||||
|
|
||||||
#define URDE_SPECIALIZE_MULTI_BLEND_SHADER(cls) \
|
#define URDE_SPECIALIZE_MULTI_BLEND_SHADER(cls) \
|
||||||
template <> boo::IShaderPipeline* \
|
|
||||||
TMultiBlendShader<cls>::m_alphaBlendPipeline = nullptr; \
|
|
||||||
template <> boo::IShaderPipeline* \
|
|
||||||
TMultiBlendShader<cls>::m_additiveAlphaPipeline = nullptr; \
|
|
||||||
template <> boo::IShaderPipeline* \
|
|
||||||
TMultiBlendShader<cls>::m_colorMultiplyPipeline = nullptr; \
|
|
||||||
template <> boo::IVertexFormat* \
|
|
||||||
TMultiBlendShader<cls>::m_vtxFmt = nullptr; \
|
|
||||||
\
|
|
||||||
template <> std::unique_ptr<TMultiBlendShader<cls>::IDataBindingFactory> \
|
template <> std::unique_ptr<TMultiBlendShader<cls>::IDataBindingFactory> \
|
||||||
TMultiBlendShader<cls>::m_bindFactory = {}; \
|
TMultiBlendShader<cls>::m_bindFactory = {}; \
|
||||||
template <> boo::GraphicsDataToken \
|
template <> boo::GraphicsDataToken \
|
||||||
|
|
|
@ -1,25 +1,11 @@
|
||||||
static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::GLDataFactory::Context& ctx,
|
static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::GLDataFactory::Context& ctx);
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut);
|
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::ID3DDataFactory::Context& ctx,
|
static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::ID3DDataFactory::Context& ctx);
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut);
|
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::MetalDataFactory::Context& ctx,
|
static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::MetalDataFactory::Context& ctx);
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut);
|
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::VulkanDataFactory::Context& ctx,
|
static TMultiBlendShader<_CLS>::IDataBindingFactory* Initialize(boo::VulkanDataFactory::Context& ctx);
|
||||||
boo::IShaderPipeline*& alphaPipeOut,
|
|
||||||
boo::IShaderPipeline*& additivePipeOut,
|
|
||||||
boo::IShaderPipeline*& colorMultiplyPipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut);
|
|
||||||
#endif
|
#endif
|
||||||
|
static void Shutdown();
|
||||||
|
|
|
@ -10,21 +10,16 @@
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
template <class FilterImp>
|
template <class ShaderImp>
|
||||||
class TShader
|
class TShader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct IDataBindingFactory
|
struct IDataBindingFactory
|
||||||
{
|
{
|
||||||
virtual boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
virtual boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
boo::IShaderPipeline* pipeline,
|
ShaderImp& filter)=0;
|
||||||
boo::IVertexFormat* vtxFmt,
|
|
||||||
FilterImp& filter)=0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static boo::IShaderPipeline* m_pipeline;
|
|
||||||
static boo::IVertexFormat* m_vtxFmt; /* No OpenGL */
|
|
||||||
|
|
||||||
static std::unique_ptr<IDataBindingFactory> m_bindFactory;
|
static std::unique_ptr<IDataBindingFactory> m_bindFactory;
|
||||||
static boo::GraphicsDataToken m_gfxToken;
|
static boo::GraphicsDataToken m_gfxToken;
|
||||||
|
|
||||||
|
@ -39,26 +34,22 @@ public:
|
||||||
switch (ctx.platform())
|
switch (ctx.platform())
|
||||||
{
|
{
|
||||||
case boo::IGraphicsDataFactory::Platform::OpenGL:
|
case boo::IGraphicsDataFactory::Platform::OpenGL:
|
||||||
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::GLDataFactory::Context&>(ctx),
|
m_bindFactory.reset(ShaderImp::Initialize(static_cast<boo::GLDataFactory::Context&>(ctx)));
|
||||||
m_pipeline));
|
|
||||||
break;
|
break;
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
case boo::IGraphicsDataFactory::Platform::D3D12:
|
||||||
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::ID3DDataFactory::Context&>(ctx),
|
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::ID3DDataFactory::Context&>(ctx)));
|
||||||
m_pipeline, m_vtxFmt));
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
case boo::IGraphicsDataFactory::Platform::Metal:
|
case boo::IGraphicsDataFactory::Platform::Metal:
|
||||||
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::MetalDataFactory::Context&>(ctx),
|
m_bindFactory.reset(ShaderImp::Initialize(static_cast<boo::MetalDataFactory::Context&>(ctx)));
|
||||||
m_pipeline, m_vtxFmt));
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
||||||
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::VulkanDataFactory::Context&>(ctx),
|
m_bindFactory.reset(FilterImp::Initialize(static_cast<boo::VulkanDataFactory::Context&>(ctx)));
|
||||||
m_pipeline, m_vtxFmt));
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default: break;
|
default: break;
|
||||||
|
@ -69,32 +60,23 @@ public:
|
||||||
|
|
||||||
static void Shutdown()
|
static void Shutdown()
|
||||||
{
|
{
|
||||||
|
ShaderImp::Shutdown();
|
||||||
m_gfxToken.doDestroy();
|
m_gfxToken.doDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
static boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, FilterImp& filter)
|
static boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, ShaderImp& filter)
|
||||||
{
|
{
|
||||||
return m_bindFactory->BuildShaderDataBinding(ctx, m_pipeline, m_vtxFmt, filter);
|
return m_bindFactory->BuildShaderDataBinding(ctx, filter);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define URDE_DECL_SPECIALIZE_SHADER(cls) \
|
#define URDE_DECL_SPECIALIZE_SHADER(cls) \
|
||||||
template <> boo::IShaderPipeline* \
|
|
||||||
TShader<cls>::m_pipeline; \
|
|
||||||
template <> boo::IVertexFormat* \
|
|
||||||
TShader<cls>::m_vtxFmt; \
|
|
||||||
\
|
|
||||||
template <> std::unique_ptr<TShader<cls>::IDataBindingFactory> \
|
template <> std::unique_ptr<TShader<cls>::IDataBindingFactory> \
|
||||||
TShader<cls>::m_bindFactory; \
|
TShader<cls>::m_bindFactory; \
|
||||||
template <> boo::GraphicsDataToken \
|
template <> boo::GraphicsDataToken \
|
||||||
TShader<cls>::m_gfxToken; \
|
TShader<cls>::m_gfxToken; \
|
||||||
|
|
||||||
#define URDE_SPECIALIZE_SHADER(cls) \
|
#define URDE_SPECIALIZE_SHADER(cls) \
|
||||||
template <> boo::IShaderPipeline* \
|
|
||||||
TShader<cls>::m_pipeline = nullptr; \
|
|
||||||
template <> boo::IVertexFormat* \
|
|
||||||
TShader<cls>::m_vtxFmt = nullptr; \
|
|
||||||
\
|
|
||||||
template <> std::unique_ptr<TShader<cls>::IDataBindingFactory> \
|
template <> std::unique_ptr<TShader<cls>::IDataBindingFactory> \
|
||||||
TShader<cls>::m_bindFactory = {}; \
|
TShader<cls>::m_bindFactory = {}; \
|
||||||
template <> boo::GraphicsDataToken \
|
template <> boo::GraphicsDataToken \
|
||||||
|
|
|
@ -1,17 +1,11 @@
|
||||||
static TShader<_CLS>::IDataBindingFactory* Initialize(boo::GLDataFactory::Context& ctx,
|
static TShader<_CLS>::IDataBindingFactory* Initialize(boo::GLDataFactory::Context& ctx);
|
||||||
boo::IShaderPipeline*& pipeOut);
|
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
static TShader<_CLS>::IDataBindingFactory* Initialize(boo::ID3DDataFactory::Context& ctx,
|
static TShader<_CLS>::IDataBindingFactory* Initialize(boo::ID3DDataFactory::Context& ctx);
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut);
|
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
static TShader<_CLS>::IDataBindingFactory* Initialize(boo::MetalDataFactory::Context& ctx,
|
static TShader<_CLS>::IDataBindingFactory* Initialize(boo::MetalDataFactory::Context& ctx);
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut);
|
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_VULKAN
|
#if BOO_HAS_VULKAN
|
||||||
static TShader<_CLS>::IDataBindingFactory* Initialize(boo::VulkanDataFactory::Context& ctx,
|
static TShader<_CLS>::IDataBindingFactory* Initialize(boo::VulkanDataFactory::Context& ctx);
|
||||||
boo::IShaderPipeline*& pipeOut,
|
|
||||||
boo::IVertexFormat*& vtxFmtOut);
|
|
||||||
#endif
|
#endif
|
||||||
|
static void Shutdown();
|
||||||
|
|
|
@ -11,6 +11,7 @@ class CAuiEnergyBarT01 : public CGuiWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CAuiEnergyBarT01(const CGuiWidgetParms& parms, u32);
|
CAuiEnergyBarT01(const CGuiWidgetParms& parms, u32);
|
||||||
|
FourCC GetWidgetTypeID() const { return FOURCC('ENRG'); }
|
||||||
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ public:
|
||||||
CAuiImagePane(const CGuiWidgetParms& parms, CSimplePool* sp, ResId, ResId,
|
CAuiImagePane(const CGuiWidgetParms& parms, CSimplePool* sp, ResId, ResId,
|
||||||
rstl::reserved_vector<zeus::CVector3f, 4>&& coords,
|
rstl::reserved_vector<zeus::CVector3f, 4>&& coords,
|
||||||
rstl::reserved_vector<zeus::CVector2f, 4>&& uvs, bool);
|
rstl::reserved_vector<zeus::CVector2f, 4>&& uvs, bool);
|
||||||
|
FourCC GetWidgetTypeID() const { return FOURCC('IMGP'); }
|
||||||
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ class CAuiMeter : public CGuiGroup
|
||||||
public:
|
public:
|
||||||
CAuiMeter(const CGuiWidgetParms& parms, bool noRoundUp,
|
CAuiMeter(const CGuiWidgetParms& parms, bool noRoundUp,
|
||||||
u32 maxCapacity, u32 workerCount);
|
u32 maxCapacity, u32 workerCount);
|
||||||
FourCC GetWidgetTypeID() const {return FOURCC('METR');}
|
FourCC GetWidgetTypeID() const { return FOURCC('METR'); }
|
||||||
|
|
||||||
void OnVisibleChange();
|
void OnVisibleChange();
|
||||||
void SetCurrValue(s32 val);
|
void SetCurrValue(s32 val);
|
||||||
|
|
|
@ -3,18 +3,19 @@
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
CFontImageDef::CFontImageDef(std::vector<TToken<CTexture>>&& texs,
|
CFontImageDef::CFontImageDef(const std::vector<TToken<CTexture>>& texs,
|
||||||
float interval, const zeus::CVector2f& vec)
|
float interval, const zeus::CVector2f& vec)
|
||||||
: x0_fps(interval), x4_texs(std::move(texs)), x14_pointsPerTexel(vec)
|
: x0_fps(interval), x14_pointsPerTexel(vec)
|
||||||
{
|
{
|
||||||
for (TToken<CTexture>& tok : x4_texs)
|
x4_texs.reserve(texs.size());
|
||||||
tok.Lock();
|
for (const TToken<CTexture>& tok : texs)
|
||||||
|
x4_texs.push_back(tok);
|
||||||
}
|
}
|
||||||
|
|
||||||
CFontImageDef::CFontImageDef(TToken<CTexture>&& tex, const zeus::CVector2f& vec)
|
CFontImageDef::CFontImageDef(const TToken<CTexture>& tex, const zeus::CVector2f& vec)
|
||||||
: x0_fps(0.f), x4_texs({std::move(tex)}), x14_pointsPerTexel(vec)
|
: x0_fps(0.f), x14_pointsPerTexel(vec)
|
||||||
{
|
{
|
||||||
x4_texs[0].Lock();
|
x4_texs.push_back(tex);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CFontImageDef::IsLoaded() const
|
bool CFontImageDef::IsLoaded() const
|
||||||
|
|
|
@ -13,12 +13,12 @@ class CFontImageDef
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
float x0_fps;
|
float x0_fps;
|
||||||
std::vector<TToken<CTexture>> x4_texs;
|
std::vector<TLockedToken<CTexture>> x4_texs;
|
||||||
zeus::CVector2f x14_pointsPerTexel;
|
zeus::CVector2f x14_pointsPerTexel;
|
||||||
|
|
||||||
CFontImageDef(std::vector<TToken<CTexture>>&& texs, float fps,
|
CFontImageDef(const std::vector<TToken<CTexture>>& texs, float fps,
|
||||||
const zeus::CVector2f& vec);
|
const zeus::CVector2f& vec);
|
||||||
CFontImageDef(TToken<CTexture>&& tex, const zeus::CVector2f& vec);
|
CFontImageDef(const TToken<CTexture>& tex, const zeus::CVector2f& vec);
|
||||||
bool IsLoaded() const;
|
bool IsLoaded() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ CGuiCamera::CGuiCamera(const CGuiWidgetParms& parms,
|
||||||
float left, float right,
|
float left, float right,
|
||||||
float top, float bottom,
|
float top, float bottom,
|
||||||
float znear, float zfar)
|
float znear, float zfar)
|
||||||
: CGuiWidget(parms),
|
: CGuiWidget(parms), xf8_proj(EProjection::Orthographic),
|
||||||
xfc_left(left), x100_right(right),
|
xfc_left(left), x100_right(right),
|
||||||
x104_top(top), x108_bottom(bottom),
|
x104_top(top), x108_bottom(bottom),
|
||||||
x10c_znear(znear), x110_zfar(zfar)
|
x10c_znear(znear), x110_zfar(zfar)
|
||||||
|
@ -19,7 +19,7 @@ CGuiCamera::CGuiCamera(const CGuiWidgetParms& parms,
|
||||||
CGuiCamera::CGuiCamera(const CGuiWidgetParms& parms,
|
CGuiCamera::CGuiCamera(const CGuiWidgetParms& parms,
|
||||||
float fov, float aspect,
|
float fov, float aspect,
|
||||||
float znear, float zfar)
|
float znear, float zfar)
|
||||||
: CGuiWidget(parms),
|
: CGuiWidget(parms), xf8_proj(EProjection::Perspective),
|
||||||
xfc_fov(fov), x100_aspect(aspect),
|
xfc_fov(fov), x100_aspect(aspect),
|
||||||
x104_znear(znear), x108_zfar(zfar)
|
x104_znear(znear), x108_zfar(zfar)
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -41,6 +41,8 @@ public:
|
||||||
float top, float bottom,
|
float top, float bottom,
|
||||||
float znear, float zfar);
|
float znear, float zfar);
|
||||||
CGuiCamera(const CGuiWidgetParms& parms, float fov, float aspect, float znear, float zfar);
|
CGuiCamera(const CGuiWidgetParms& parms, float fov, float aspect, float znear, float zfar);
|
||||||
|
FourCC GetWidgetTypeID() const { return FOURCC('CAMR'); }
|
||||||
|
|
||||||
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
||||||
|
|
||||||
zeus::CVector3f ConvertToScreenSpace(const zeus::CVector3f& vec) const;
|
zeus::CVector3f ConvertToScreenSpace(const zeus::CVector3f& vec) const;
|
||||||
|
|
|
@ -13,7 +13,7 @@ void CGuiCompoundWidget::OnVisibleChange()
|
||||||
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
|
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
|
||||||
while (child)
|
while (child)
|
||||||
{
|
{
|
||||||
child->SetIsVisible(true);
|
child->SetIsVisible(GetIsVisible());
|
||||||
child = static_cast<CGuiWidget*>(child->GetNextSibling());
|
child = static_cast<CGuiWidget*>(child->GetNextSibling());
|
||||||
}
|
}
|
||||||
CGuiWidget::OnVisibleChange();
|
CGuiWidget::OnVisibleChange();
|
||||||
|
@ -24,7 +24,7 @@ void CGuiCompoundWidget::OnActiveChange()
|
||||||
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
|
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
|
||||||
while (child)
|
while (child)
|
||||||
{
|
{
|
||||||
child->SetIsActive(true);
|
child->SetIsActive(GetIsActive());
|
||||||
child = static_cast<CGuiWidget*>(child->GetNextSibling());
|
child = static_cast<CGuiWidget*>(child->GetNextSibling());
|
||||||
}
|
}
|
||||||
CGuiWidget::OnActiveChange();
|
CGuiWidget::OnActiveChange();
|
||||||
|
|
|
@ -110,20 +110,18 @@ void CGuiFrame::Update(float dt)
|
||||||
|
|
||||||
void CGuiFrame::Draw(const CGuiWidgetDrawParms& parms) const
|
void CGuiFrame::Draw(const CGuiWidgetDrawParms& parms) const
|
||||||
{
|
{
|
||||||
if (x4_)
|
CGraphics::SetCullMode(ERglCullMode::None);
|
||||||
{
|
CGraphics::SetAmbientColor(zeus::CColor::skWhite);
|
||||||
CGraphics::SetCullMode(ERglCullMode::None);
|
DisableLights();
|
||||||
CGraphics::SetAmbientColor(zeus::CColor::skWhite);
|
x14_camera->Draw(parms);
|
||||||
DisableLights();
|
// Set one-stage modulate
|
||||||
x14_camera->Draw(parms);
|
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha,
|
||||||
// Set one-stage modulate
|
ERglBlendFactor::InvSrcAlpha, ERglLogicOp::Clear);
|
||||||
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha,
|
|
||||||
ERglBlendFactor::InvSrcAlpha, ERglLogicOp::Clear);
|
for (const auto& widget : x2c_widgets)
|
||||||
|
if (widget->GetIsVisible())
|
||||||
|
widget->Draw(parms);
|
||||||
|
|
||||||
for (const auto& widget : x2c_widgets)
|
|
||||||
if (widget->GetIsVisible())
|
|
||||||
widget->Draw(parms);
|
|
||||||
}
|
|
||||||
CGraphics::SetCullMode(ERglCullMode::Front);
|
CGraphics::SetCullMode(ERglCullMode::Front);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +158,7 @@ void CGuiFrame::LoadWidgetsInGame(CInputStream& in, CSimplePool* sp)
|
||||||
|
|
||||||
void CGuiFrame::ProcessUserInput(const CFinalInput& input) const
|
void CGuiFrame::ProcessUserInput(const CFinalInput& input) const
|
||||||
{
|
{
|
||||||
if (x4_)
|
if (input.ControllerIdx() != 0)
|
||||||
return;
|
return;
|
||||||
for (auto& widget : x2c_widgets)
|
for (auto& widget : x2c_widgets)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define __URDE_CGUIFRAME_HPP__
|
#define __URDE_CGUIFRAME_HPP__
|
||||||
|
|
||||||
#include "CGuiWidget.hpp"
|
#include "CGuiWidget.hpp"
|
||||||
|
#include "CGuiHeadWidget.hpp"
|
||||||
#include "CGuiWidgetIdDB.hpp"
|
#include "CGuiWidgetIdDB.hpp"
|
||||||
#include "IObj.hpp"
|
#include "IObj.hpp"
|
||||||
|
|
||||||
|
@ -10,7 +11,6 @@ namespace urde
|
||||||
class CGuiSys;
|
class CGuiSys;
|
||||||
class CLight;
|
class CLight;
|
||||||
class CGuiCamera;
|
class CGuiCamera;
|
||||||
class CGuiHeadWidget;
|
|
||||||
class CFinalInput;
|
class CFinalInput;
|
||||||
class CGuiLight;
|
class CGuiLight;
|
||||||
class CVParamTransfer;
|
class CVParamTransfer;
|
||||||
|
@ -44,6 +44,7 @@ public:
|
||||||
CGuiWidget* FindWidget(s16 id) const;
|
CGuiWidget* FindWidget(s16 id) const;
|
||||||
void SetFrameCamera(std::shared_ptr<CGuiCamera>&& camr) { x14_camera = std::move(camr); }
|
void SetFrameCamera(std::shared_ptr<CGuiCamera>&& camr) { x14_camera = std::move(camr); }
|
||||||
void SetHeadWidget(std::shared_ptr<CGuiHeadWidget>&& hwig) { xc_headWidget = std::move(hwig); }
|
void SetHeadWidget(std::shared_ptr<CGuiHeadWidget>&& hwig) { xc_headWidget = std::move(hwig); }
|
||||||
|
CGuiHeadWidget* GetHeadWidget() const { return xc_headWidget.get(); }
|
||||||
void SortDrawOrder();
|
void SortDrawOrder();
|
||||||
void EnableLights(u32 lights) const;
|
void EnableLights(u32 lights) const;
|
||||||
void DisableLights() const;
|
void DisableLights() const;
|
||||||
|
|
|
@ -13,7 +13,7 @@ class CGuiGroup : public CGuiCompoundWidget
|
||||||
bool xc0_b;
|
bool xc0_b;
|
||||||
public:
|
public:
|
||||||
CGuiGroup(const CGuiWidgetParms& parms, int defaultWorker, bool b);
|
CGuiGroup(const CGuiWidgetParms& parms, int defaultWorker, bool b);
|
||||||
FourCC GetWidgetTypeID() const {return FOURCC('GRUP');}
|
FourCC GetWidgetTypeID() const { return FOURCC('GRUP'); }
|
||||||
|
|
||||||
void SelectWorkerWidget(int workerId, bool setActive, bool setVisible);
|
void SelectWorkerWidget(int workerId, bool setActive, bool setVisible);
|
||||||
CGuiWidget* GetSelectedWidget();
|
CGuiWidget* GetSelectedWidget();
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace urde
|
||||||
class CGuiHeadWidget : public CGuiWidget
|
class CGuiHeadWidget : public CGuiWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FourCC GetWidgetTypeID() const {return FOURCC('HWIG');}
|
FourCC GetWidgetTypeID() const { return FOURCC('HWIG'); }
|
||||||
CGuiHeadWidget(const CGuiWidgetParms& parms);
|
CGuiHeadWidget(const CGuiWidgetParms& parms);
|
||||||
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ class CGuiLight : public CGuiWidget
|
||||||
public:
|
public:
|
||||||
~CGuiLight();
|
~CGuiLight();
|
||||||
CGuiLight(const CGuiWidgetParms& parms, const CLight& light);
|
CGuiLight(const CGuiWidgetParms& parms, const CLight& light);
|
||||||
FourCC GetWidgetTypeID() const {return FOURCC('LITE');}
|
FourCC GetWidgetTypeID() const { return FOURCC('LITE'); }
|
||||||
|
|
||||||
CLight BuildLight() const;
|
CLight BuildLight() const;
|
||||||
void SetIsVisible(bool vis);
|
void SetIsVisible(bool vis);
|
||||||
|
|
|
@ -16,7 +16,7 @@ class CGuiModel : public CGuiWidget
|
||||||
u32 x10c_lightMask;
|
u32 x10c_lightMask;
|
||||||
public:
|
public:
|
||||||
CGuiModel(const CGuiWidgetParms& parms, CSimplePool* sp, ResId modelId, u32 lightMask, bool flag);
|
CGuiModel(const CGuiWidgetParms& parms, CSimplePool* sp, ResId modelId, u32 lightMask, bool flag);
|
||||||
FourCC GetWidgetTypeID() const {return FOURCC('MODL');}
|
FourCC GetWidgetTypeID() const { return FOURCC('MODL'); }
|
||||||
|
|
||||||
std::vector<ResId> GetModelAssets() const;
|
std::vector<ResId> GetModelAssets() const;
|
||||||
bool GetIsFinishedLoadingWidgetSpecific() const;
|
bool GetIsFinishedLoadingWidgetSpecific() const;
|
||||||
|
|
|
@ -20,7 +20,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CGuiPane(const CGuiWidgetParms& parms, const zeus::CVector2f& dim, const zeus::CVector3f& scaleCenter);
|
CGuiPane(const CGuiWidgetParms& parms, const zeus::CVector2f& dim, const zeus::CVector3f& scaleCenter);
|
||||||
FourCC GetWidgetTypeID() const {return FOURCC('PANE');}
|
FourCC GetWidgetTypeID() const { return FOURCC('PANE'); }
|
||||||
|
|
||||||
virtual void ScaleDimensions(const zeus::CVector3f& scale);
|
virtual void ScaleDimensions(const zeus::CVector3f& scale);
|
||||||
virtual void SetDimensions(const zeus::CVector2f& dim, bool initVBO);
|
virtual void SetDimensions(const zeus::CVector2f& dim, bool initVBO);
|
||||||
|
|
|
@ -40,7 +40,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CGuiSliderGroup(const CGuiWidgetParms& parms, float a, float b, float c, float d);
|
CGuiSliderGroup(const CGuiWidgetParms& parms, float a, float b, float c, float d);
|
||||||
FourCC GetWidgetTypeID() const {return FOURCC('SLGP');}
|
FourCC GetWidgetTypeID() const { return FOURCC('SLGP'); }
|
||||||
|
|
||||||
EState GetState() const { return xf0_state; }
|
EState GetState() const { return xf0_state; }
|
||||||
void SetSelectionChangedCallback(std::function<void(CGuiSliderGroup*, float)>&& func);
|
void SetSelectionChangedCallback(std::function<void(CGuiSliderGroup*, float)>&& func);
|
||||||
|
|
|
@ -55,7 +55,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CGuiTableGroup(const CGuiWidgetParms& parms, int, int, bool);
|
CGuiTableGroup(const CGuiWidgetParms& parms, int, int, bool);
|
||||||
FourCC GetWidgetTypeID() const {return FOURCC('TBGP');}
|
FourCC GetWidgetTypeID() const { return FOURCC('TBGP'); }
|
||||||
|
|
||||||
void SetMenuAdvanceCallback(std::function<void(CGuiTableGroup*)>&& cb)
|
void SetMenuAdvanceCallback(std::function<void(CGuiTableGroup*)>&& cb)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,7 +14,7 @@ CGuiTextPane::CGuiTextPane(const CGuiWidgetParms& parms, CSimplePool* sp, const
|
||||||
const zeus::CColor& fontCol, const zeus::CColor& outlineCol,
|
const zeus::CColor& fontCol, const zeus::CColor& outlineCol,
|
||||||
s32 extentX, s32 extentY)
|
s32 extentX, s32 extentY)
|
||||||
: CGuiPane(parms, dim, vec), xd4_textSupport(fontId, props, fontCol, outlineCol,
|
: CGuiPane(parms, dim, vec), xd4_textSupport(fontId, props, fontCol, outlineCol,
|
||||||
zeus::CColor::skWhite, extentX, extentY, sp) {}
|
zeus::CColor::skWhite, extentX, extentY, sp, xac_drawFlags) {}
|
||||||
|
|
||||||
void CGuiTextPane::Update(float dt)
|
void CGuiTextPane::Update(float dt)
|
||||||
{
|
{
|
||||||
|
@ -64,6 +64,7 @@ void CGuiTextPane::Draw(const CGuiWidgetDrawParms& parms) const
|
||||||
geomCol.a *= parms.x0_alphaMod;
|
geomCol.a *= parms.x0_alphaMod;
|
||||||
const_cast<CGuiTextPane*>(this)->xd4_textSupport.SetGeometryColor(geomCol);
|
const_cast<CGuiTextPane*>(this)->xd4_textSupport.SetGeometryColor(geomCol);
|
||||||
|
|
||||||
|
# if 0
|
||||||
CGraphics::SetDepthWriteMode(xb6_31_depthTest, ERglEnum::LEqual, xb7_24_depthWrite);
|
CGraphics::SetDepthWriteMode(xb6_31_depthTest, ERglEnum::LEqual, xb7_24_depthWrite);
|
||||||
|
|
||||||
switch (xac_drawFlags)
|
switch (xac_drawFlags)
|
||||||
|
@ -95,6 +96,9 @@ void CGuiTextPane::Draw(const CGuiWidgetDrawParms& parms) const
|
||||||
xd4_textSupport.Render();
|
xd4_textSupport.Render();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
xd4_textSupport.Render();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<CGuiWidget> CGuiTextPane::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp)
|
std::shared_ptr<CGuiWidget> CGuiTextPane::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp)
|
||||||
|
|
|
@ -14,13 +14,13 @@ public:
|
||||||
CGuiTextPane(const CGuiWidgetParms& parms, CSimplePool* sp, const zeus::CVector2f& dim,
|
CGuiTextPane(const CGuiWidgetParms& parms, CSimplePool* sp, const zeus::CVector2f& dim,
|
||||||
const zeus::CVector3f& vec, ResId fontId, const CGuiTextProperties& props,
|
const zeus::CVector3f& vec, ResId fontId, const CGuiTextProperties& props,
|
||||||
const zeus::CColor& col1, const zeus::CColor& col2, s32 padX, s32 padY);
|
const zeus::CColor& col1, const zeus::CColor& col2, s32 padX, s32 padY);
|
||||||
FourCC GetWidgetTypeID() const {return FOURCC('TXPN');}
|
FourCC GetWidgetTypeID() const { return FOURCC('TXPN'); }
|
||||||
|
|
||||||
CGuiTextSupport* TextSupport() {return &xd4_textSupport;}
|
CGuiTextSupport* TextSupport() { return &xd4_textSupport; }
|
||||||
const CGuiTextSupport* GetTextSupport() const {return &xd4_textSupport;}
|
const CGuiTextSupport* GetTextSupport() const { return &xd4_textSupport; }
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
bool GetIsFinishedLoadingWidgetSpecific() const;
|
bool GetIsFinishedLoadingWidgetSpecific() const;
|
||||||
std::vector<ResId> GetFontAssets() const {return {xd4_textSupport.x5c_fontId};}
|
std::vector<ResId> GetFontAssets() const { return {xd4_textSupport.x5c_fontId}; }
|
||||||
void SetDimensions(const zeus::CVector2f& dim, bool initVBO);
|
void SetDimensions(const zeus::CVector2f& dim, bool initVBO);
|
||||||
void ScaleDimensions(const zeus::CVector3f& scale);
|
void ScaleDimensions(const zeus::CVector3f& scale);
|
||||||
void Draw(const CGuiWidgetDrawParms& parms) const;
|
void Draw(const CGuiWidgetDrawParms& parms) const;
|
||||||
|
|
|
@ -13,9 +13,11 @@ namespace urde
|
||||||
|
|
||||||
CGuiTextSupport::CGuiTextSupport(ResId fontId, const CGuiTextProperties& props,
|
CGuiTextSupport::CGuiTextSupport(ResId fontId, const CGuiTextProperties& props,
|
||||||
const zeus::CColor& fontCol, const zeus::CColor& outlineCol,
|
const zeus::CColor& fontCol, const zeus::CColor& outlineCol,
|
||||||
const zeus::CColor& geomCol, s32 padX, s32 padY, CSimplePool* store)
|
const zeus::CColor& geomCol, s32 padX, s32 padY, CSimplePool* store,
|
||||||
|
CGuiWidget::EGuiModelDrawFlags drawFlags)
|
||||||
: x14_props(props), x24_fontColor(fontCol), x28_outlineColor(outlineCol),
|
: x14_props(props), x24_fontColor(fontCol), x28_outlineColor(outlineCol),
|
||||||
x2c_geometryColor(geomCol), x34_extentX(padX), x38_extentY(padY), x5c_fontId(fontId)
|
x2c_geometryColor(geomCol), x34_extentX(padX), x38_extentY(padY), x5c_fontId(fontId),
|
||||||
|
m_drawFlags(drawFlags)
|
||||||
{
|
{
|
||||||
x2cc_font = store->GetObj({SBIG('FONT'), fontId});
|
x2cc_font = store->GetObj({SBIG('FONT'), fontId});
|
||||||
}
|
}
|
||||||
|
@ -138,7 +140,6 @@ void CGuiTextSupport::ClearRenderBuffer()
|
||||||
|
|
||||||
void CGuiTextSupport::CheckAndRebuildTextBuffer()
|
void CGuiTextSupport::CheckAndRebuildTextBuffer()
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
g_TextExecuteBuf->Clear();
|
g_TextExecuteBuf->Clear();
|
||||||
g_TextExecuteBuf->x18_textState.x7c_enableWordWrap = x14_props.x0_wordWrap;
|
g_TextExecuteBuf->x18_textState.x7c_enableWordWrap = x14_props.x0_wordWrap;
|
||||||
g_TextExecuteBuf->BeginBlock(0, 0, x34_extentX, x38_extentY, x14_props.xc_direction,
|
g_TextExecuteBuf->BeginBlock(0, 0, x34_extentX, x38_extentY, x14_props.xc_direction,
|
||||||
|
@ -154,7 +155,6 @@ void CGuiTextSupport::CheckAndRebuildTextBuffer()
|
||||||
g_TextParser->ParseText(*g_TextExecuteBuf, initStr.c_str(), initStr.size());
|
g_TextParser->ParseText(*g_TextExecuteBuf, initStr.c_str(), initStr.size());
|
||||||
|
|
||||||
g_TextExecuteBuf->EndBlock();
|
g_TextExecuteBuf->EndBlock();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGuiTextSupport::CheckAndRebuildRenderBuffer()
|
bool CGuiTextSupport::CheckAndRebuildRenderBuffer()
|
||||||
|
@ -173,11 +173,11 @@ bool CGuiTextSupport::CheckAndRebuildRenderBuffer()
|
||||||
if (x308_multipageFlag)
|
if (x308_multipageFlag)
|
||||||
{
|
{
|
||||||
zeus::CVector2i extent(x34_extentX, x38_extentY);
|
zeus::CVector2i extent(x34_extentX, x38_extentY);
|
||||||
x2ec_renderBufferPages = g_TextExecuteBuf->BuildRenderBufferPages(extent);
|
x2ec_renderBufferPages = g_TextExecuteBuf->BuildRenderBufferPages(extent, m_drawFlags);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x60_renderBuf.emplace(g_TextExecuteBuf->BuildRenderBuffer());
|
x60_renderBuf.emplace(g_TextExecuteBuf->BuildRenderBuffer(m_drawFlags));
|
||||||
x2dc_oneBufBounds = x60_renderBuf->AccumulateTextBounds();
|
x2dc_oneBufBounds = x60_renderBuf->AccumulateTextBounds();
|
||||||
}
|
}
|
||||||
g_TextExecuteBuf->Clear();
|
g_TextExecuteBuf->Clear();
|
||||||
|
@ -201,6 +201,7 @@ void CGuiTextSupport::AutoSetExtent()
|
||||||
|
|
||||||
void CGuiTextSupport::Render() const
|
void CGuiTextSupport::Render() const
|
||||||
{
|
{
|
||||||
|
const_cast<CGuiTextSupport*>(this)->CheckAndRebuildRenderBuffer();
|
||||||
if (CTextRenderBuffer* buf = GetCurrentPageRenderBuffer())
|
if (CTextRenderBuffer* buf = GetCurrentPageRenderBuffer())
|
||||||
{
|
{
|
||||||
zeus::CTransform oldModel = CGraphics::g_GXModelMatrix;
|
zeus::CTransform oldModel = CGraphics::g_GXModelMatrix;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "RetroTypes.hpp"
|
#include "RetroTypes.hpp"
|
||||||
#include "CToken.hpp"
|
#include "CToken.hpp"
|
||||||
#include "CTextRenderBuffer.hpp"
|
#include "CTextRenderBuffer.hpp"
|
||||||
|
#include "CGuiWidget.hpp"
|
||||||
#include "optional.hpp"
|
#include "optional.hpp"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -91,6 +92,7 @@ class CGuiTextSupport
|
||||||
float x54_chFadeTime = 0.1f;
|
float x54_chFadeTime = 0.1f;
|
||||||
float x58_chRate = 10.0f;
|
float x58_chRate = 10.0f;
|
||||||
ResId x5c_fontId = -1;
|
ResId x5c_fontId = -1;
|
||||||
|
CGuiWidget::EGuiModelDrawFlags m_drawFlags;
|
||||||
std::experimental::optional<CTextRenderBuffer> x60_renderBuf;
|
std::experimental::optional<CTextRenderBuffer> x60_renderBuf;
|
||||||
std::vector<CToken> x2bc_assets;
|
std::vector<CToken> x2bc_assets;
|
||||||
TLockedToken<CRasterFont> x2cc_font;
|
TLockedToken<CRasterFont> x2cc_font;
|
||||||
|
@ -107,7 +109,8 @@ class CGuiTextSupport
|
||||||
public:
|
public:
|
||||||
CGuiTextSupport(ResId fontId, const CGuiTextProperties& props,
|
CGuiTextSupport(ResId fontId, const CGuiTextProperties& props,
|
||||||
const zeus::CColor& fontCol, const zeus::CColor& outlineCol,
|
const zeus::CColor& fontCol, const zeus::CColor& outlineCol,
|
||||||
const zeus::CColor& geomCol, s32 extX, s32 extY, CSimplePool* store);
|
const zeus::CColor& geomCol, s32 extX, s32 extY, CSimplePool* store,
|
||||||
|
CGuiWidget::EGuiModelDrawFlags drawFlags);
|
||||||
float GetCurrentAnimationOverAge() const;
|
float GetCurrentAnimationOverAge() const;
|
||||||
float GetNumCharsTotal() const;
|
float GetNumCharsTotal() const;
|
||||||
float GetNumCharsPrinted() const;
|
float GetNumCharsPrinted() const;
|
||||||
|
|
|
@ -101,7 +101,7 @@ public:
|
||||||
virtual void Touch() const;
|
virtual void Touch() const;
|
||||||
virtual bool GetIsVisible() const;
|
virtual bool GetIsVisible() const;
|
||||||
virtual bool GetIsActive() const;
|
virtual bool GetIsActive() const;
|
||||||
virtual FourCC GetWidgetTypeID() const {return FOURCC('BWIG');}
|
virtual FourCC GetWidgetTypeID() const { return FOURCC('BWIG'); }
|
||||||
virtual bool AddWorkerWidget(CGuiWidget* worker);
|
virtual bool AddWorkerWidget(CGuiWidget* worker);
|
||||||
virtual bool GetIsFinishedLoadingWidgetSpecific() const;
|
virtual bool GetIsFinishedLoadingWidgetSpecific() const;
|
||||||
virtual void OnVisibleChange();
|
virtual void OnVisibleChange();
|
||||||
|
|
|
@ -238,7 +238,7 @@ void CImageInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf)
|
||||||
tex->GetHeight() * x4_image.x14_pointsPerTexel.y * 2 / 3);
|
tex->GetHeight() * x4_image.x14_pointsPerTexel.y * 2 / 3);
|
||||||
buf->AddImage(coords, x4_image);
|
buf->AddImage(coords, x4_image);
|
||||||
}
|
}
|
||||||
state.xd4_curX += tex->GetWidth() * x4_image.x14_pointsPerTexel.x;
|
state.xd4_curX = state.xd4_curX + tex->GetWidth() * x4_image.x14_pointsPerTexel.x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ void CRasterFont::SinglePassDrawString(const CDrawStringOptions& opts, int x, in
|
||||||
{
|
{
|
||||||
if (opts.x0_direction == ETextDirection::Horizontal)
|
if (opts.x0_direction == ETextDirection::Horizontal)
|
||||||
{
|
{
|
||||||
x += glyph->GetA();
|
x += glyph->GetLeftPadding();
|
||||||
|
|
||||||
if (prevGlyph != 0)
|
if (prevGlyph != 0)
|
||||||
x += KernLookup(x1c_kerning, prevGlyph->GetKernStart(), *chr);
|
x += KernLookup(x1c_kerning, prevGlyph->GetKernStart(), *chr);
|
||||||
|
@ -102,10 +102,10 @@ void CRasterFont::SinglePassDrawString(const CDrawStringOptions& opts, int x, in
|
||||||
if (renderBuf)
|
if (renderBuf)
|
||||||
{
|
{
|
||||||
left += x;
|
left += x;
|
||||||
top += glyph->GetBaseline() - y;
|
top += y - glyph->GetBaseline();
|
||||||
renderBuf->AddCharacter(zeus::CVector2i(left, top), *chr, opts.x4_colors[0]);
|
renderBuf->AddCharacter(zeus::CVector2i(left, top), *chr, opts.x4_colors[0]);
|
||||||
}
|
}
|
||||||
x += glyph->GetC() + glyph->GetB();
|
x += glyph->GetRightPadding() + glyph->GetAdvance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevGlyph = glyph;
|
prevGlyph = glyph;
|
||||||
|
@ -113,7 +113,7 @@ void CRasterFont::SinglePassDrawString(const CDrawStringOptions& opts, int x, in
|
||||||
if (length == -1)
|
if (length == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((str - chr) >= length)
|
if ((chr - str) >= length)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,8 +173,8 @@ void CRasterFont::GetSize(const CDrawStringOptions& opts, int& width, int& heigh
|
||||||
if (prevGlyph)
|
if (prevGlyph)
|
||||||
advance = KernLookup(x1c_kerning, prevGlyph->GetKernStart(), *chr);
|
advance = KernLookup(x1c_kerning, prevGlyph->GetKernStart(), *chr);
|
||||||
|
|
||||||
s16 curWidth = prevWidth - (glyph->GetA() + glyph->GetB() + glyph->GetC() + advance);
|
int curWidth = prevWidth + (glyph->GetLeftPadding() + glyph->GetAdvance() + glyph->GetRightPadding() + advance);
|
||||||
s16 curHeight = glyph->GetBaseline() - (x8_monoHeight + glyph->GetCellHeight());
|
int curHeight = glyph->GetBaseline() - (x8_monoHeight + glyph->GetCellHeight());
|
||||||
|
|
||||||
width = curWidth;
|
width = curWidth;
|
||||||
prevWidth = curWidth;
|
prevWidth = curWidth;
|
||||||
|
@ -189,7 +189,7 @@ void CRasterFont::GetSize(const CDrawStringOptions& opts, int& width, int& heigh
|
||||||
if (len == -1)
|
if (len == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((str - chr) >= len)
|
if ((chr - str) >= len)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
#include "CToken.hpp"
|
#include "CToken.hpp"
|
||||||
#include "zeus/CVector2i.hpp"
|
#include "zeus/CVector2i.hpp"
|
||||||
#include "CGuiTextSupport.hpp"
|
#include "CGuiTextSupport.hpp"
|
||||||
|
#include "Graphics/CTexture.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class IObjectStore;
|
class IObjectStore;
|
||||||
class CTexture;
|
|
||||||
class CDrawStringOptions;
|
class CDrawStringOptions;
|
||||||
class CTextRenderBuffer;
|
class CTextRenderBuffer;
|
||||||
|
|
||||||
|
@ -28,28 +28,30 @@ private:
|
||||||
s16 x1a_cellHeight;
|
s16 x1a_cellHeight;
|
||||||
s16 x1c_baseline;
|
s16 x1c_baseline;
|
||||||
s16 x1e_kernStart;
|
s16 x1e_kernStart;
|
||||||
|
s16 m_layer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CGlyph() = default;
|
CGlyph() = default;
|
||||||
CGlyph(s16 a, s16 b, s32 c, float startU, float startV, float endU, float endV,
|
CGlyph(s16 a, s16 b, s32 c, float startU, float startV, float endU, float endV,
|
||||||
s16 cellWidth, s16 cellHeight, s16 baseline, s16 kernStart)
|
s16 cellWidth, s16 cellHeight, s16 baseline, s16 kernStart, s16 layer=0)
|
||||||
: x0_leftPadding(a), x2_advance(b), x4_rightPadding(c),
|
: x0_leftPadding(a), x2_advance(b), x4_rightPadding(c),
|
||||||
x8_startU(startU), xc_startV(startV), x10_endU(endU), x14_endV(endV),
|
x8_startU(startU), xc_startV(startV), x10_endU(endU), x14_endV(endV),
|
||||||
x18_cellWidth(cellWidth), x1a_cellHeight(cellHeight),
|
x18_cellWidth(cellWidth), x1a_cellHeight(cellHeight),
|
||||||
x1c_baseline(baseline), x1e_kernStart(kernStart)
|
x1c_baseline(baseline), x1e_kernStart(kernStart), m_layer(layer)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
s16 GetA() const { return x0_leftPadding; }
|
s16 GetLeftPadding() const { return x0_leftPadding; }
|
||||||
s16 GetB() const { return x2_advance; }
|
s16 GetAdvance() const { return x2_advance; }
|
||||||
s16 GetC() const { return x4_rightPadding; }
|
s16 GetRightPadding() const { return x4_rightPadding; }
|
||||||
float GetStartU() const { return x8_startU; }
|
float GetStartU() const { return x8_startU; }
|
||||||
float GetStartV() const { return xc_startV; }
|
float GetStartV() const { return xc_startV; }
|
||||||
float GetEndU() const { return x10_endU; }
|
float GetEndU() const { return x10_endU; }
|
||||||
float GetEndV() const { return x14_endV; }
|
float GetEndV() const { return x14_endV; }
|
||||||
s16 GetCellWidth() const { return x18_cellWidth; }
|
s16 GetCellWidth() const { return x18_cellWidth; }
|
||||||
s16 GetCellHeight() const { return x1a_cellHeight; }
|
s16 GetCellHeight() const { return x1a_cellHeight; }
|
||||||
s16 GetBaseline() const { return x1c_baseline; }
|
s16 GetBaseline() const { return x1c_baseline; }
|
||||||
s16 GetKernStart() const { return x1e_kernStart; }
|
s16 GetKernStart() const { return x1e_kernStart; }
|
||||||
|
s16 GetLayer() const { return m_layer; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class CKernPair
|
class CKernPair
|
||||||
|
@ -146,7 +148,7 @@ public:
|
||||||
}
|
}
|
||||||
void GetSize(const CDrawStringOptions& opts, int& width, int& height,
|
void GetSize(const CDrawStringOptions& opts, int& width, int& height,
|
||||||
const char16_t* str, int len) const;
|
const char16_t* str, int len) const;
|
||||||
TToken<CTexture>& GetTexture() { return x80_texture; }
|
boo::ITexture* GetTexture() { return x80_texture->GetFontTexture(CTexture::EFontType(x2c_mode)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<IObj> FRasterFontFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
|
std::unique_ptr<IObj> FRasterFontFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
CTextRenderBuffer CTextExecuteBuffer::BuildRenderBuffer() const
|
CTextRenderBuffer CTextExecuteBuffer::BuildRenderBuffer(CGuiWidget::EGuiModelDrawFlags df) const
|
||||||
{
|
{
|
||||||
CTextRenderBuffer ret(CTextRenderBuffer::EMode::AllocTally);
|
CTextRenderBuffer ret(CTextRenderBuffer::EMode::AllocTally, df);
|
||||||
|
|
||||||
{
|
{
|
||||||
CFontRenderState rendState;
|
CFontRenderState rendState;
|
||||||
|
@ -34,9 +34,10 @@ CTextRenderBuffer CTextExecuteBuffer::BuildRenderBuffer() const
|
||||||
|
|
||||||
CTextRenderBuffer CTextExecuteBuffer::BuildRenderBufferPage(InstList::const_iterator start,
|
CTextRenderBuffer CTextExecuteBuffer::BuildRenderBufferPage(InstList::const_iterator start,
|
||||||
InstList::const_iterator pgStart,
|
InstList::const_iterator pgStart,
|
||||||
InstList::const_iterator pgEnd) const
|
InstList::const_iterator pgEnd,
|
||||||
|
CGuiWidget::EGuiModelDrawFlags df) const
|
||||||
{
|
{
|
||||||
CTextRenderBuffer ret(CTextRenderBuffer::EMode::AllocTally);
|
CTextRenderBuffer ret(CTextRenderBuffer::EMode::AllocTally, df);
|
||||||
|
|
||||||
{
|
{
|
||||||
CFontRenderState rendState;
|
CFontRenderState rendState;
|
||||||
|
@ -71,14 +72,15 @@ CTextRenderBuffer CTextExecuteBuffer::BuildRenderBufferPage(InstList::const_iter
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<CTextRenderBuffer> CTextExecuteBuffer::BuildRenderBufferPages(const zeus::CVector2i& extent) const
|
std::list<CTextRenderBuffer> CTextExecuteBuffer::BuildRenderBufferPages(const zeus::CVector2i& extent,
|
||||||
|
CGuiWidget::EGuiModelDrawFlags df) const
|
||||||
{
|
{
|
||||||
std::list<CTextRenderBuffer> ret;
|
std::list<CTextRenderBuffer> ret;
|
||||||
|
|
||||||
for (auto it = x0_instList.begin() ; it != x0_instList.end() ;)
|
for (auto it = x0_instList.begin() ; it != x0_instList.end() ;)
|
||||||
{
|
{
|
||||||
const std::shared_ptr<CInstruction>& inst = *it;
|
const std::shared_ptr<CInstruction>& inst = *it;
|
||||||
CTextRenderBuffer rbuf(CTextRenderBuffer::EMode::AllocTally);
|
CTextRenderBuffer rbuf(CTextRenderBuffer::EMode::AllocTally, df);
|
||||||
|
|
||||||
{
|
{
|
||||||
CFontRenderState rstate;
|
CFontRenderState rstate;
|
||||||
|
@ -111,7 +113,7 @@ std::list<CTextRenderBuffer> CTextExecuteBuffer::BuildRenderBufferPages(const ze
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.push_back(BuildRenderBufferPage(x0_instList.cbegin(), it, pageEnd));
|
ret.push_back(BuildRenderBufferPage(x0_instList.cbegin(), it, pageEnd, df));
|
||||||
it = pageEnd;
|
it = pageEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ class CTextExecuteBuffer
|
||||||
CSaveableState x18_textState;
|
CSaveableState x18_textState;
|
||||||
CBlockInstruction* xa0_curBlock = nullptr;
|
CBlockInstruction* xa0_curBlock = nullptr;
|
||||||
CLineInstruction* xa4_curLine = nullptr;
|
CLineInstruction* xa4_curLine = nullptr;
|
||||||
std::list<std::shared_ptr<CInstruction>>::iterator xa8_curWordIt;
|
InstList::iterator xa8_curWordIt;
|
||||||
s32 xac_curY;
|
s32 xac_curY;
|
||||||
s32 xb0_curX;
|
s32 xb0_curX;
|
||||||
s32 xb4_curWordX = 0;
|
s32 xb4_curWordX = 0;
|
||||||
|
@ -40,11 +40,13 @@ public:
|
||||||
xa8_curWordIt = x0_instList.begin();
|
xa8_curWordIt = x0_instList.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
CTextRenderBuffer BuildRenderBuffer() const;
|
CTextRenderBuffer BuildRenderBuffer(CGuiWidget::EGuiModelDrawFlags df) const;
|
||||||
CTextRenderBuffer BuildRenderBufferPage(InstList::const_iterator start,
|
CTextRenderBuffer BuildRenderBufferPage(InstList::const_iterator start,
|
||||||
InstList::const_iterator pgStart,
|
InstList::const_iterator pgStart,
|
||||||
InstList::const_iterator pgEnd) const;
|
InstList::const_iterator pgEnd,
|
||||||
std::list<CTextRenderBuffer> BuildRenderBufferPages(const zeus::CVector2i& extent) const;
|
CGuiWidget::EGuiModelDrawFlags df) const;
|
||||||
|
std::list<CTextRenderBuffer> BuildRenderBufferPages(const zeus::CVector2i& extent,
|
||||||
|
CGuiWidget::EGuiModelDrawFlags df) const;
|
||||||
std::vector<CToken> GetAssets() const;
|
std::vector<CToken> GetAssets() const;
|
||||||
void AddString(const char16_t* str, int len);
|
void AddString(const char16_t* str, int len);
|
||||||
void AddStringFragment(const char16_t* str, int len);
|
void AddStringFragment(const char16_t* str, int len);
|
||||||
|
|
|
@ -240,7 +240,7 @@ CFontImageDef CTextParser::GetImage(const char16_t* str, int len)
|
||||||
AdvanceTokenPos();
|
AdvanceTokenPos();
|
||||||
} while (commaPos != iterable.size());
|
} while (commaPos != iterable.size());
|
||||||
|
|
||||||
return CFontImageDef(std::move(texs), interval, zeus::CVector2f(1.f, 1.f));
|
return CFontImageDef(texs, interval, zeus::CVector2f(1.f, 1.f));
|
||||||
}
|
}
|
||||||
else if (BeginsWith(str, len, u"SA"))
|
else if (BeginsWith(str, len, u"SA"))
|
||||||
{
|
{
|
||||||
|
@ -267,7 +267,7 @@ CFontImageDef CTextParser::GetImage(const char16_t* str, int len)
|
||||||
AdvanceTokenPos();
|
AdvanceTokenPos();
|
||||||
} while (commaPos != iterable.size());
|
} while (commaPos != iterable.size());
|
||||||
|
|
||||||
return CFontImageDef(std::move(texs), interval, zeus::CVector2f(scaleX, scaleY));
|
return CFontImageDef(texs, interval, zeus::CVector2f(scaleX, scaleY));
|
||||||
}
|
}
|
||||||
else if (BeginsWith(str, len, u"SI"))
|
else if (BeginsWith(str, len, u"SI"))
|
||||||
{
|
{
|
||||||
|
@ -285,12 +285,12 @@ CFontImageDef CTextParser::GetImage(const char16_t* str, int len)
|
||||||
GetAssetIdFromString(&iterable[tokenPos])});
|
GetAssetIdFromString(&iterable[tokenPos])});
|
||||||
AdvanceTokenPos();
|
AdvanceTokenPos();
|
||||||
|
|
||||||
return CFontImageDef(std::move(tex), zeus::CVector2f(scaleX, scaleY));
|
return CFontImageDef(tex, zeus::CVector2f(scaleX, scaleY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TToken<CTexture> tex = x0_store.GetObj({SBIG('TXTR'), GetAssetIdFromString(str)});
|
TToken<CTexture> tex = x0_store.GetObj({SBIG('TXTR'), GetAssetIdFromString(str)});
|
||||||
return CFontImageDef(std::move(tex), zeus::CVector2f(1.f, 1.f));
|
return CFontImageDef(tex, zeus::CVector2f(1.f, 1.f));
|
||||||
}
|
}
|
||||||
|
|
||||||
ResId CTextParser::GetAssetIdFromString(const char16_t* str)
|
ResId CTextParser::GetAssetIdFromString(const char16_t* str)
|
||||||
|
@ -309,7 +309,8 @@ TToken<CRasterFont> CTextParser::GetFont(const char16_t* str, int len)
|
||||||
|
|
||||||
void CTextParser::ParseText(CTextExecuteBuffer& out, const char16_t* str, int len)
|
void CTextParser::ParseText(CTextExecuteBuffer& out, const char16_t* str, int len)
|
||||||
{
|
{
|
||||||
for (int b=0, e=0 ; str[e] && (len == -1 || e < len) ;)
|
int b=0, e=0;
|
||||||
|
for (b=0, e=0 ; str[e] && (len == -1 || e < len) ;)
|
||||||
{
|
{
|
||||||
if (str[e] != u'&')
|
if (str[e] != u'&')
|
||||||
{
|
{
|
||||||
|
@ -335,6 +336,9 @@ void CTextParser::ParseText(CTextExecuteBuffer& out, const char16_t* str, int le
|
||||||
b = e;
|
b = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e > b)
|
||||||
|
out.AddString(str + b, e - b);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,34 +7,13 @@
|
||||||
#include "CTextExecuteBuffer.hpp"
|
#include "CTextExecuteBuffer.hpp"
|
||||||
#include "CFontRenderState.hpp"
|
#include "CFontRenderState.hpp"
|
||||||
#include "CInstruction.hpp"
|
#include "CInstruction.hpp"
|
||||||
|
#include "Graphics/Shaders/CTextSupportShader.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
boo::IShaderPipeline* g_TextShaderPipeline = nullptr;
|
CTextRenderBuffer::CTextRenderBuffer(EMode mode, CGuiWidget::EGuiModelDrawFlags df)
|
||||||
boo::IVertexFormat* g_TextVtxFmt = nullptr;
|
: x0_mode(mode), m_drawFlags(df) {}
|
||||||
|
|
||||||
boo::IShaderPipeline* g_TextImageShaderPipeline = nullptr;
|
|
||||||
boo::IVertexFormat* g_TextImageVtxFmt = nullptr;
|
|
||||||
|
|
||||||
CTextRenderBuffer::CTextRenderBuffer(EMode mode)
|
|
||||||
: x0_mode(mode) {}
|
|
||||||
|
|
||||||
void CTextRenderBuffer::BooCharacterInstance::SetMetrics(const CGlyph& glyph,
|
|
||||||
const zeus::CVector2i& offset)
|
|
||||||
{
|
|
||||||
m_pos[0].assign(offset.x, 0.f, offset.y);
|
|
||||||
m_uv[0].assign(glyph.GetStartU(), glyph.GetStartV());
|
|
||||||
|
|
||||||
m_pos[1].assign(offset.x + glyph.GetCellWidth(), 0.f, offset.y);
|
|
||||||
m_uv[1].assign(glyph.GetEndU(), glyph.GetStartV());
|
|
||||||
|
|
||||||
m_pos[2].assign(offset.x, 0.f, offset.y + glyph.GetCellHeight());
|
|
||||||
m_uv[2].assign(glyph.GetStartU(), glyph.GetEndV());
|
|
||||||
|
|
||||||
m_pos[3].assign(offset.x + glyph.GetCellWidth(), 0.f, offset.y + glyph.GetCellHeight());
|
|
||||||
m_uv[3].assign(glyph.GetEndU(), glyph.GetEndV());
|
|
||||||
}
|
|
||||||
|
|
||||||
CTextRenderBuffer::BooImage::BooImage(const CFontImageDef& imgDef, const zeus::CVector2i& offset)
|
CTextRenderBuffer::BooImage::BooImage(const CFontImageDef& imgDef, const zeus::CVector2i& offset)
|
||||||
: m_imageDef(imgDef)
|
: m_imageDef(imgDef)
|
||||||
|
@ -47,17 +26,7 @@ CTextRenderBuffer::BooImage::BooImage(const CFontImageDef& imgDef, const zeus::C
|
||||||
tex.GetHeight() * imgDef.x14_pointsPerTexel.y);
|
tex.GetHeight() * imgDef.x14_pointsPerTexel.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_imageData.m_pos[0].assign(offset.x, 0.f, offset.y);
|
m_imageData.SetMetrics(imgSize, offset);
|
||||||
m_imageData.m_uv[0].assign(0.f, 0.f);
|
|
||||||
|
|
||||||
m_imageData.m_pos[1].assign(offset.x + imgSize.x, 0.f, offset.y);
|
|
||||||
m_imageData.m_uv[1].assign(1.f, 0.f);
|
|
||||||
|
|
||||||
m_imageData.m_pos[2].assign(offset.x, 0.f, offset.y + imgSize.y);
|
|
||||||
m_imageData.m_uv[2].assign(0.f, 1.f);
|
|
||||||
|
|
||||||
m_imageData.m_pos[3].assign(offset.x + imgSize.x, 0.f, offset.y + imgSize.y);
|
|
||||||
m_imageData.m_uv[3].assign(1.f, 1.f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTextRenderBuffer::BooPrimitiveMark::SetOpacity(CTextRenderBuffer& rb, float opacity)
|
void CTextRenderBuffer::BooPrimitiveMark::SetOpacity(CTextRenderBuffer& rb, float opacity)
|
||||||
|
@ -67,7 +36,7 @@ void CTextRenderBuffer::BooPrimitiveMark::SetOpacity(CTextRenderBuffer& rb, floa
|
||||||
case Command::CharacterRender:
|
case Command::CharacterRender:
|
||||||
{
|
{
|
||||||
BooFontCharacters& fc = rb.m_fontCharacters[m_bindIdx];
|
BooFontCharacters& fc = rb.m_fontCharacters[m_bindIdx];
|
||||||
BooCharacterInstance& inst = fc.m_charData[m_instIdx];
|
CTextSupportShader::CharacterInstance& inst = fc.m_charData[m_instIdx];
|
||||||
inst.m_fontColor.a = opacity;
|
inst.m_fontColor.a = opacity;
|
||||||
inst.m_outlineColor.a = opacity;
|
inst.m_outlineColor.a = opacity;
|
||||||
fc.m_dirty = true;
|
fc.m_dirty = true;
|
||||||
|
@ -90,70 +59,87 @@ void CTextRenderBuffer::CommitResources()
|
||||||
return;
|
return;
|
||||||
m_committed = true;
|
m_committed = true;
|
||||||
|
|
||||||
|
/* Ensure font textures are ready outside transaction */
|
||||||
|
for (BooFontCharacters& chs : m_fontCharacters)
|
||||||
|
chs.m_font->GetTexture();
|
||||||
|
|
||||||
m_booToken = CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) -> bool
|
m_booToken = CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) -> bool
|
||||||
{
|
{
|
||||||
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(BooUniform), 1);
|
m_uniBuf = CTextSupportShader::s_Uniforms.allocateBlock(CGraphics::g_BooFactory);
|
||||||
|
auto uBufInfo = m_uniBuf.getBufferInfo();
|
||||||
|
|
||||||
for (BooFontCharacters& chs : m_fontCharacters)
|
for (BooFontCharacters& chs : m_fontCharacters)
|
||||||
{
|
{
|
||||||
chs.m_instBuf = ctx.newDynamicBuffer(boo::BufferUse::Vertex,
|
chs.m_instBuf = CTextSupportShader::s_CharInsts.allocateBlock(CGraphics::g_BooFactory, chs.m_charCount);
|
||||||
sizeof(BooCharacterInstance),
|
auto iBufInfo = chs.m_instBuf.getBufferInfo();
|
||||||
chs.m_charCount);
|
|
||||||
boo::IVertexFormat* vFmt = g_TextVtxFmt;
|
boo::IVertexFormat* vFmt = CTextSupportShader::s_TextVtxFmt;
|
||||||
if (ctx.bindingNeedsVertexFormat())
|
if (ctx.bindingNeedsVertexFormat())
|
||||||
{
|
{
|
||||||
|
boo::IGraphicsBufferD* buf = iBufInfo.first;
|
||||||
boo::VertexElementDescriptor elems[] =
|
boo::VertexElementDescriptor elems[] =
|
||||||
{
|
{
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0},
|
{buf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0},
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 1},
|
{buf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 1},
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 2},
|
{buf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 2},
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 3},
|
{buf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 3},
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 0},
|
{buf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 0},
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 1},
|
{buf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 1},
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 2},
|
{buf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 2},
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 3},
|
{buf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 3},
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced, 0},
|
{buf, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced, 0},
|
||||||
{chs.m_instBuf, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced, 1},
|
{buf, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced, 1},
|
||||||
};
|
};
|
||||||
vFmt = ctx.newVertexFormat(10, elems);
|
vFmt = ctx.newVertexFormat(10, elems, 0, iBufInfo.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
boo::IGraphicsBuffer* uniforms[] = {m_uniBuf};
|
boo::IGraphicsBuffer* uniforms[] = {uBufInfo.first};
|
||||||
boo::ITexture* texs[] = {chs.m_font.GetObj()->GetTexture()->GetBooTexture()};
|
boo::PipelineStage unistages[] = {boo::PipelineStage::Vertex};
|
||||||
chs.m_dataBinding = ctx.newShaderDataBinding(g_TextShaderPipeline, vFmt,
|
size_t unioffs[] = {uBufInfo.second};
|
||||||
nullptr, chs.m_instBuf, nullptr,
|
size_t unisizes[] = {sizeof(CTextSupportShader::Uniform)};
|
||||||
1, uniforms, nullptr, 1, texs);
|
boo::ITexture* texs[] = {chs.m_font->GetTexture()};
|
||||||
|
chs.m_dataBinding = ctx.newShaderDataBinding(CTextSupportShader::SelectTextPipeline(m_drawFlags),
|
||||||
|
vFmt, nullptr, iBufInfo.first, nullptr,
|
||||||
|
1, uniforms, unistages, unioffs,
|
||||||
|
unisizes, 1, texs, 0, iBufInfo.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BooImage& img : m_images)
|
for (BooImage& img : m_images)
|
||||||
{
|
{
|
||||||
img.m_instBuf = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(BooImageInstance), 1);
|
img.m_instBuf = CTextSupportShader::s_ImgInsts.allocateBlock(CGraphics::g_BooFactory, 1);
|
||||||
boo::IVertexFormat* vFmt = g_TextImageVtxFmt;
|
auto iBufInfo = img.m_instBuf.getBufferInfo();
|
||||||
|
|
||||||
|
boo::IVertexFormat* vFmt = CTextSupportShader::s_ImageVtxFmt;
|
||||||
if (ctx.bindingNeedsVertexFormat())
|
if (ctx.bindingNeedsVertexFormat())
|
||||||
{
|
{
|
||||||
|
boo::IGraphicsBufferD* buf = iBufInfo.first;
|
||||||
boo::VertexElementDescriptor elems[] =
|
boo::VertexElementDescriptor elems[] =
|
||||||
{
|
{
|
||||||
{img.m_instBuf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0},
|
{buf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0},
|
||||||
{img.m_instBuf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 1},
|
{buf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 1},
|
||||||
{img.m_instBuf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 2},
|
{buf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 2},
|
||||||
{img.m_instBuf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 3},
|
{buf, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 3},
|
||||||
{img.m_instBuf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 0},
|
{buf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 0},
|
||||||
{img.m_instBuf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 1},
|
{buf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 1},
|
||||||
{img.m_instBuf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 2},
|
{buf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 2},
|
||||||
{img.m_instBuf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 3},
|
{buf, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 3},
|
||||||
{img.m_instBuf, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced, 0},
|
{buf, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced, 0},
|
||||||
};
|
};
|
||||||
vFmt = ctx.newVertexFormat(9, elems);
|
vFmt = ctx.newVertexFormat(9, elems, 0, iBufInfo.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
boo::IGraphicsBuffer* uniforms[] = {m_uniBuf};
|
boo::IGraphicsBuffer* uniforms[] = {uBufInfo.first};
|
||||||
|
boo::PipelineStage unistages[] = {boo::PipelineStage::Vertex};
|
||||||
|
size_t unioffs[] = {uBufInfo.second};
|
||||||
|
size_t unisizes[] = {sizeof(CTextSupportShader::Uniform)};
|
||||||
img.m_dataBinding.reserve(img.m_imageDef.x4_texs.size());
|
img.m_dataBinding.reserve(img.m_imageDef.x4_texs.size());
|
||||||
for (TToken<CTexture>& tex : img.m_imageDef.x4_texs)
|
for (TToken<CTexture>& tex : img.m_imageDef.x4_texs)
|
||||||
{
|
{
|
||||||
boo::ITexture* texs[] = {tex->GetBooTexture()};
|
boo::ITexture* texs[] = {tex->GetBooTexture()};
|
||||||
img.m_dataBinding.push_back(ctx.newShaderDataBinding(g_TextImageShaderPipeline, vFmt,
|
img.m_dataBinding.push_back(ctx.newShaderDataBinding(CTextSupportShader::SelectImagePipeline(m_drawFlags),
|
||||||
nullptr, img.m_instBuf, nullptr,
|
vFmt, nullptr, iBufInfo.first, nullptr,
|
||||||
1, uniforms, nullptr, 1, texs));
|
1, uniforms, unistages, unioffs,
|
||||||
|
unisizes, 1, texs, 0, iBufInfo.second));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -169,6 +155,7 @@ void CTextRenderBuffer::SetMode(EMode mode)
|
||||||
fc.m_charData.reserve(fc.m_charCount);
|
fc.m_charData.reserve(fc.m_charCount);
|
||||||
}
|
}
|
||||||
m_activeFontCh = -1;
|
m_activeFontCh = -1;
|
||||||
|
x0_mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTextRenderBuffer::SetPrimitiveOpacity(int idx, float opacity)
|
void CTextRenderBuffer::SetPrimitiveOpacity(int idx, float opacity)
|
||||||
|
@ -180,26 +167,34 @@ void CTextRenderBuffer::Render(const zeus::CColor& col, float time) const
|
||||||
{
|
{
|
||||||
const_cast<CTextRenderBuffer*>(this)->CommitResources();
|
const_cast<CTextRenderBuffer*>(this)->CommitResources();
|
||||||
|
|
||||||
BooUniform uniforms = {CGraphics::GetPerspectiveProjectionMatrix(true) *
|
zeus::CMatrix4f mv = CGraphics::g_GXModelView.toMatrix4f();
|
||||||
CGraphics::g_GXModelView.toMatrix4f(), col};
|
zeus::CMatrix4f proj = CGraphics::GetPerspectiveProjectionMatrix(true);
|
||||||
m_uniBuf->load(&uniforms, sizeof(uniforms));
|
zeus::CMatrix4f mat = proj * mv;
|
||||||
|
|
||||||
|
const_cast<CTextRenderBuffer*>(this)->m_uniBuf.access() =
|
||||||
|
CTextSupportShader::Uniform{mat, col};
|
||||||
|
|
||||||
for (const BooFontCharacters& chs : m_fontCharacters)
|
for (const BooFontCharacters& chs : m_fontCharacters)
|
||||||
{
|
{
|
||||||
if (chs.m_dirty)
|
if (chs.m_charData.size())
|
||||||
{
|
{
|
||||||
chs.m_instBuf->load(chs.m_charData.data(), sizeof(BooCharacterInstance) * chs.m_charData.size());
|
if (chs.m_dirty)
|
||||||
((BooFontCharacters&)chs).m_dirty = false;
|
{
|
||||||
|
memmove(const_cast<BooFontCharacters&>(chs).m_instBuf.access(),
|
||||||
|
chs.m_charData.data(), sizeof(CTextSupportShader::CharacterInstance) *
|
||||||
|
chs.m_charData.size());
|
||||||
|
const_cast<BooFontCharacters&>(chs).m_dirty = false;
|
||||||
|
}
|
||||||
|
CGraphics::SetShaderDataBinding(chs.m_dataBinding);
|
||||||
|
CGraphics::DrawInstances(0, 4, chs.m_charData.size());
|
||||||
}
|
}
|
||||||
CGraphics::SetShaderDataBinding(chs.m_dataBinding);
|
|
||||||
CGraphics::DrawInstances(0, 4, chs.m_charData.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const BooImage& img : m_images)
|
for (const BooImage& img : m_images)
|
||||||
{
|
{
|
||||||
if (img.m_dirty)
|
if (img.m_dirty)
|
||||||
{
|
{
|
||||||
img.m_instBuf->load(&img.m_imageData, sizeof(BooImageInstance));
|
*const_cast<BooImage&>(img).m_instBuf.access() = img.m_imageData;
|
||||||
const_cast<BooImage&>(img).m_dirty = false;
|
const_cast<BooImage&>(img).m_dirty = false;
|
||||||
}
|
}
|
||||||
int idx = int(img.m_imageDef.x0_fps * time) % img.m_dataBinding.size();
|
int idx = int(img.m_imageDef.x0_fps * time) % img.m_dataBinding.size();
|
||||||
|
@ -216,7 +211,7 @@ void CTextRenderBuffer::AddImage(const zeus::CVector2i& offset, const CFontImage
|
||||||
m_images.push_back({image, offset});
|
m_images.push_back({image, offset});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTextRenderBuffer::AddCharacter(const zeus::CVector2i& offset, wchar_t ch,
|
void CTextRenderBuffer::AddCharacter(const zeus::CVector2i& offset, char16_t ch,
|
||||||
const zeus::CColor& color)
|
const zeus::CColor& color)
|
||||||
{
|
{
|
||||||
if (m_activeFontCh == -1)
|
if (m_activeFontCh == -1)
|
||||||
|
@ -228,7 +223,7 @@ void CTextRenderBuffer::AddCharacter(const zeus::CVector2i& offset, wchar_t ch,
|
||||||
{
|
{
|
||||||
const CGlyph* glyph = chs.m_font.GetObj()->GetGlyph(ch);
|
const CGlyph* glyph = chs.m_font.GetObj()->GetGlyph(ch);
|
||||||
chs.m_charData.emplace_back();
|
chs.m_charData.emplace_back();
|
||||||
BooCharacterInstance& inst = chs.m_charData.back();
|
CTextSupportShader::CharacterInstance& inst = chs.m_charData.back();
|
||||||
inst.SetMetrics(*glyph, offset);
|
inst.SetMetrics(*glyph, offset);
|
||||||
inst.m_fontColor = m_main * color;
|
inst.m_fontColor = m_main * color;
|
||||||
inst.m_outlineColor = m_outline * color;
|
inst.m_outlineColor = m_outline * color;
|
||||||
|
@ -278,7 +273,7 @@ std::pair<zeus::CVector2i, zeus::CVector2i> CTextRenderBuffer::AccumulateTextBou
|
||||||
|
|
||||||
for (const BooFontCharacters& chars : m_fontCharacters)
|
for (const BooFontCharacters& chars : m_fontCharacters)
|
||||||
{
|
{
|
||||||
for (const BooCharacterInstance& charInst : chars.m_charData)
|
for (const CTextSupportShader::CharacterInstance& charInst : chars.m_charData)
|
||||||
{
|
{
|
||||||
ret.first.x = std::min(ret.first.x, int(charInst.m_pos[0].x));
|
ret.first.x = std::min(ret.first.x, int(charInst.m_pos[0].x));
|
||||||
ret.first.y = std::min(ret.first.y, int(charInst.m_pos[0].z));
|
ret.first.y = std::min(ret.first.y, int(charInst.m_pos[0].z));
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
#include "CToken.hpp"
|
#include "CToken.hpp"
|
||||||
#include "CFontImageDef.hpp"
|
#include "CFontImageDef.hpp"
|
||||||
#include "RetroTypes.hpp"
|
#include "RetroTypes.hpp"
|
||||||
|
#include "CGuiWidget.hpp"
|
||||||
|
#include "Graphics/Shaders/CTextSupportShader.hpp"
|
||||||
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
|
@ -23,6 +24,7 @@ using CTextColor = zeus::CColor;
|
||||||
class CTextRenderBuffer
|
class CTextRenderBuffer
|
||||||
{
|
{
|
||||||
friend class CGuiTextSupport;
|
friend class CGuiTextSupport;
|
||||||
|
friend class CTextSupportShader;
|
||||||
public:
|
public:
|
||||||
enum class Command
|
enum class Command
|
||||||
{
|
{
|
||||||
|
@ -64,50 +66,27 @@ private:
|
||||||
|
|
||||||
#else
|
#else
|
||||||
/* Boo-specific text-rendering functionality */
|
/* Boo-specific text-rendering functionality */
|
||||||
struct BooUniform
|
hecl::UniformBufferPool<CTextSupportShader::Uniform>::Token m_uniBuf;
|
||||||
{
|
|
||||||
zeus::CMatrix4f m_mvp;
|
|
||||||
zeus::CColor m_uniformColor;
|
|
||||||
};
|
|
||||||
boo::IGraphicsBufferD* m_uniBuf;
|
|
||||||
|
|
||||||
struct BooCharacterInstance
|
|
||||||
{
|
|
||||||
zeus::CVector3f m_pos[4];
|
|
||||||
zeus::CVector2f m_uv[4];
|
|
||||||
zeus::CColor m_fontColor;
|
|
||||||
zeus::CColor m_outlineColor;
|
|
||||||
void SetMetrics(const CGlyph& glyph, const zeus::CVector2i& offset);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BooImageInstance
|
|
||||||
{
|
|
||||||
zeus::CVector3f m_pos[4];
|
|
||||||
zeus::CVector2f m_uv[4];
|
|
||||||
zeus::CColor m_color;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BooFontCharacters
|
struct BooFontCharacters
|
||||||
{
|
{
|
||||||
TToken<CRasterFont> m_font;
|
TLockedToken<CRasterFont> m_font;
|
||||||
boo::IGraphicsBufferD* m_instBuf = nullptr;
|
hecl::VertexBufferPool<CTextSupportShader::CharacterInstance>::Token m_instBuf;
|
||||||
boo::IShaderDataBinding* m_dataBinding = nullptr;
|
boo::IShaderDataBinding* m_dataBinding = nullptr;
|
||||||
std::vector<BooCharacterInstance> m_charData;
|
std::vector<CTextSupportShader::CharacterInstance> m_charData;
|
||||||
u32 m_charCount = 0;
|
u32 m_charCount = 0;
|
||||||
bool m_dirty = true;
|
bool m_dirty = true;
|
||||||
BooFontCharacters(const CToken& token)
|
BooFontCharacters(const CToken& token)
|
||||||
: m_font(token)
|
: m_font(token) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
std::vector<BooFontCharacters> m_fontCharacters;
|
std::vector<BooFontCharacters> m_fontCharacters;
|
||||||
|
|
||||||
struct BooImage
|
struct BooImage
|
||||||
{
|
{
|
||||||
CFontImageDef m_imageDef;
|
CFontImageDef m_imageDef;
|
||||||
boo::IGraphicsBufferD* m_instBuf = nullptr;
|
hecl::VertexBufferPool<CTextSupportShader::ImageInstance>::Token m_instBuf;
|
||||||
std::vector<boo::IShaderDataBinding*> m_dataBinding;
|
std::vector<boo::IShaderDataBinding*> m_dataBinding;
|
||||||
BooImageInstance m_imageData;
|
CTextSupportShader::ImageInstance m_imageData;
|
||||||
bool m_dirty = true;
|
bool m_dirty = true;
|
||||||
BooImage(const CFontImageDef& imgDef, const zeus::CVector2i& offset);
|
BooImage(const CFontImageDef& imgDef, const zeus::CVector2i& offset);
|
||||||
};
|
};
|
||||||
|
@ -129,12 +108,14 @@ private:
|
||||||
zeus::CColor m_main;
|
zeus::CColor m_main;
|
||||||
zeus::CColor m_outline;
|
zeus::CColor m_outline;
|
||||||
|
|
||||||
|
CGuiWidget::EGuiModelDrawFlags m_drawFlags;
|
||||||
|
|
||||||
bool m_committed = false;
|
bool m_committed = false;
|
||||||
void CommitResources();
|
void CommitResources();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTextRenderBuffer(EMode mode);
|
CTextRenderBuffer(EMode mode, CGuiWidget::EGuiModelDrawFlags df);
|
||||||
#if 0
|
#if 0
|
||||||
void SetPrimitive(const Primitive&, int);
|
void SetPrimitive(const Primitive&, int);
|
||||||
Primitive GetPrimitive(int) const;
|
Primitive GetPrimitive(int) const;
|
||||||
|
@ -150,7 +131,7 @@ public:
|
||||||
void SetMode(EMode mode);
|
void SetMode(EMode mode);
|
||||||
void Render(const zeus::CColor& col, float) const;
|
void Render(const zeus::CColor& col, float) const;
|
||||||
void AddImage(const zeus::CVector2i& offset, const CFontImageDef& image);
|
void AddImage(const zeus::CVector2i& offset, const CFontImageDef& image);
|
||||||
void AddCharacter(const zeus::CVector2i& offset, wchar_t ch, const zeus::CColor& color);
|
void AddCharacter(const zeus::CVector2i& offset, char16_t ch, const zeus::CColor& color);
|
||||||
void AddPaletteChange(const zeus::CColor& main, const zeus::CColor& outline);
|
void AddPaletteChange(const zeus::CColor& main, const zeus::CColor& outline);
|
||||||
void AddFontChange(const TToken<CRasterFont>& font);
|
void AddFontChange(const TToken<CRasterFont>& font);
|
||||||
|
|
||||||
|
|
|
@ -175,6 +175,7 @@ void CFrontEndUI::SNewFileSelectFrame::Update(float dt)
|
||||||
}
|
}
|
||||||
if (x10c_saveReady)
|
if (x10c_saveReady)
|
||||||
SetupFrameContents();
|
SetupFrameContents();
|
||||||
|
|
||||||
x1c_loadedFrame->Update(dt);
|
x1c_loadedFrame->Update(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1246,7 +1247,7 @@ CFrontEndUI::SNesEmulatorFrame::SNesEmulatorFrame()
|
||||||
ETextDirection::Horizontal);
|
ETextDirection::Horizontal);
|
||||||
xc_textSupport = std::make_unique<CGuiTextSupport>(deface->id, props, zeus::CColor::skWhite,
|
xc_textSupport = std::make_unique<CGuiTextSupport>(deface->id, props, zeus::CColor::skWhite,
|
||||||
zeus::CColor::skBlack, zeus::CColor::skWhite,
|
zeus::CColor::skBlack, zeus::CColor::skWhite,
|
||||||
0, 0, g_SimplePool);
|
0, 0, g_SimplePool, CGuiWidget::EGuiModelDrawFlags::Alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFrontEndUI::SNesEmulatorFrame::SetMode(EMode mode)
|
void CFrontEndUI::SNesEmulatorFrame::SetMode(EMode mode)
|
||||||
|
@ -2002,7 +2003,7 @@ void CFrontEndUI::Draw() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xdc_saveUI)
|
if (0 && xdc_saveUI)
|
||||||
{
|
{
|
||||||
/* Render memory card feedback strings */
|
/* Render memory card feedback strings */
|
||||||
if ((CanShowSaveUI() && !xdc_saveUI->IsHiddenFromFrontEnd()) ||
|
if ((CanShowSaveUI() && !xdc_saveUI->IsHiddenFromFrontEnd()) ||
|
||||||
|
|
|
@ -20,13 +20,15 @@ CSlideShow::CSlideShow()
|
||||||
xc4_textA = std::make_unique<CGuiTextSupport>(font->id, propsA,
|
xc4_textA = std::make_unique<CGuiTextSupport>(font->id, propsA,
|
||||||
g_tweakSlideShow->GetFontColor(),
|
g_tweakSlideShow->GetFontColor(),
|
||||||
g_tweakSlideShow->GetOutlineColor(),
|
g_tweakSlideShow->GetOutlineColor(),
|
||||||
zeus::CColor::skWhite, 640, 480, g_SimplePool);
|
zeus::CColor::skWhite, 640, 480, g_SimplePool,
|
||||||
|
CGuiWidget::EGuiModelDrawFlags::Alpha);
|
||||||
|
|
||||||
CGuiTextProperties propsB(false, true, EJustification::Right, EVerticalJustification::Bottom);
|
CGuiTextProperties propsB(false, true, EJustification::Right, EVerticalJustification::Bottom);
|
||||||
xc8_textB = std::make_unique<CGuiTextSupport>(font->id, propsB,
|
xc8_textB = std::make_unique<CGuiTextSupport>(font->id, propsB,
|
||||||
g_tweakSlideShow->GetFontColor(),
|
g_tweakSlideShow->GetFontColor(),
|
||||||
g_tweakSlideShow->GetOutlineColor(),
|
g_tweakSlideShow->GetOutlineColor(),
|
||||||
zeus::CColor::skWhite, 640, 480, g_SimplePool);
|
zeus::CColor::skWhite, 640, 480, g_SimplePool,
|
||||||
|
CGuiWidget::EGuiModelDrawFlags::Alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
xf8_stickTextures.reserve(18);
|
xf8_stickTextures.reserve(18);
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
|
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
|
||||||
#include "Graphics/Shaders/CCameraBlurFilter.hpp"
|
#include "Graphics/Shaders/CCameraBlurFilter.hpp"
|
||||||
#include "Graphics/Shaders/CXRayBlurFilter.hpp"
|
#include "Graphics/Shaders/CXRayBlurFilter.hpp"
|
||||||
|
#include "Graphics/Shaders/CTextSupportShader.hpp"
|
||||||
#include "Character/CCharLayoutInfo.hpp"
|
#include "Character/CCharLayoutInfo.hpp"
|
||||||
#include "Audio/CStreamAudioManager.hpp"
|
#include "Audio/CStreamAudioManager.hpp"
|
||||||
#include "CGBASupport.hpp"
|
#include "CGBASupport.hpp"
|
||||||
|
@ -23,6 +24,7 @@ URDE_DECL_SPECIALIZE_SHADER(CXRayBlurFilter)
|
||||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
|
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
|
||||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
|
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
|
||||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilterAlpha)
|
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilterAlpha)
|
||||||
|
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTextSupportShader)
|
||||||
|
|
||||||
namespace MP1
|
namespace MP1
|
||||||
{
|
{
|
||||||
|
@ -46,8 +48,8 @@ CGameArchitectureSupport::CGameArchitectureSupport(CMain& parent, boo::IAudioVoi
|
||||||
CStreamAudioManager::Initialize();
|
CStreamAudioManager::Initialize();
|
||||||
m->ResetGameState();
|
m->ResetGameState();
|
||||||
|
|
||||||
std::shared_ptr<CIOWin> splash = std::make_shared<CSplashScreen>(CSplashScreen::ESplashScreen::Nintendo);
|
//std::shared_ptr<CIOWin> splash = std::make_shared<CSplashScreen>(CSplashScreen::ESplashScreen::Nintendo);
|
||||||
x58_ioWinManager.AddIOWin(splash, 1000, 10000);
|
//x58_ioWinManager.AddIOWin(splash, 1000, 10000);
|
||||||
|
|
||||||
std::shared_ptr<CIOWin> mf = std::make_shared<CMainFlow>();
|
std::shared_ptr<CIOWin> mf = std::make_shared<CMainFlow>();
|
||||||
x58_ioWinManager.AddIOWin(mf, 0, 0);
|
x58_ioWinManager.AddIOWin(mf, 0, 0);
|
||||||
|
@ -201,6 +203,7 @@ CMain::BooSetter::BooSetter(boo::IGraphicsDataFactory* factory,
|
||||||
TMultiBlendShader<CColoredQuadFilter>::Initialize();
|
TMultiBlendShader<CColoredQuadFilter>::Initialize();
|
||||||
TMultiBlendShader<CTexturedQuadFilter>::Initialize();
|
TMultiBlendShader<CTexturedQuadFilter>::Initialize();
|
||||||
TMultiBlendShader<CTexturedQuadFilterAlpha>::Initialize();
|
TMultiBlendShader<CTexturedQuadFilterAlpha>::Initialize();
|
||||||
|
TMultiBlendShader<CTextSupportShader>::Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMain::RegisterResourceTweaks()
|
void CMain::RegisterResourceTweaks()
|
||||||
|
@ -303,6 +306,7 @@ void CMain::Shutdown()
|
||||||
TMultiBlendShader<CColoredQuadFilter>::Shutdown();
|
TMultiBlendShader<CColoredQuadFilter>::Shutdown();
|
||||||
TMultiBlendShader<CTexturedQuadFilter>::Shutdown();
|
TMultiBlendShader<CTexturedQuadFilter>::Shutdown();
|
||||||
TMultiBlendShader<CTexturedQuadFilterAlpha>::Shutdown();
|
TMultiBlendShader<CTexturedQuadFilterAlpha>::Shutdown();
|
||||||
|
TMultiBlendShader<CTextSupportShader>::Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MP1_USE_BOO
|
#if MP1_USE_BOO
|
||||||
|
|
|
@ -385,7 +385,7 @@ void CWorldTransManager::EnableTransition(ResId fontId, ResId stringId, bool b1,
|
||||||
EVerticalJustification::Center, ETextDirection::Horizontal);
|
EVerticalJustification::Center, ETextDirection::Horizontal);
|
||||||
x8_textData.reset(new CGuiTextSupport(fontId, props, zeus::CColor::skWhite,
|
x8_textData.reset(new CGuiTextSupport(fontId, props, zeus::CColor::skWhite,
|
||||||
zeus::CColor::skBlack, zeus::CColor::skWhite,
|
zeus::CColor::skBlack, zeus::CColor::skWhite,
|
||||||
640, 448, g_SimplePool));
|
640, 448, g_SimplePool, CGuiWidget::EGuiModelDrawFlags::Alpha));
|
||||||
|
|
||||||
x8_textData->SetTypeWriteEffectOptions(true, chFadeTime, chFadeRate);
|
x8_textData->SetTypeWriteEffectOptions(true, chFadeTime, chFadeRate);
|
||||||
xc_strTable = g_SimplePool->GetObj(SObjectTag{FOURCC('STRG'), stringId});
|
xc_strTable = g_SimplePool->GetObj(SObjectTag{FOURCC('STRG'), stringId});
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit cef5e394b9f29850e2ec299bf39f33bc0f9f5a10
|
Subproject commit d4fd78673feebcc5b29eba53178e545cee695891
|
2
specter
2
specter
|
@ -1 +1 @@
|
||||||
Subproject commit 661b391cd0277bb6de3aeb74d53c990e6ec07099
|
Subproject commit ba23dd8d9449076c1ebf7c010c1b45c599456792
|
Loading…
Reference in New Issue