mirror of https://github.com/AxioDL/metaforce.git
GLSL macros
This commit is contained in:
parent
6db378ea45
commit
488de1bdb9
|
@ -201,7 +201,7 @@ void ViewManager::pushRecentFile(const HECL::SystemString& path)
|
||||||
|
|
||||||
void ViewManager::init(boo::IApplication* app)
|
void ViewManager::init(boo::IApplication* app)
|
||||||
{
|
{
|
||||||
m_mainWindow = std::unique_ptr<boo::IWindow>(app->newWindow(_S("URDE")));
|
m_mainWindow = std::unique_ptr<boo::IWindow>(app->newWindow(_S("URDE"), 1));
|
||||||
m_mainWindow->showWindow();
|
m_mainWindow->showWindow();
|
||||||
m_mainWindow->setWaitCursor(true);
|
m_mainWindow->setWaitCursor(true);
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,12 @@ namespace pshag
|
||||||
|
|
||||||
static const char* VS_GLSL_TEX =
|
static const char* VS_GLSL_TEX =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"layout(location=0) in vec4 posIn;\n"
|
"layout(location=0) in vec4 posIn;\n"
|
||||||
"layout(location=1) in vec4 colorIn;\n"
|
"layout(location=1) in vec4 colorIn;\n"
|
||||||
"layout(location=2) in vec4 uvIn;\n"
|
"layout(location=2) in vec4 uvIn;\n"
|
||||||
"\n"
|
"\n"
|
||||||
"uniform LineUniform\n"
|
"UBINDING0 uniform LineUniform\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec4 moduColor;\n"
|
" vec4 moduColor;\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
|
@ -31,6 +32,7 @@ static const char* VS_GLSL_TEX =
|
||||||
|
|
||||||
static const char* FS_GLSL_TEX =
|
static const char* FS_GLSL_TEX =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"struct VertToFrag\n"
|
"struct VertToFrag\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec4 color;\n"
|
" vec4 color;\n"
|
||||||
|
@ -39,7 +41,7 @@ static const char* FS_GLSL_TEX =
|
||||||
"\n"
|
"\n"
|
||||||
"in VertToFrag vtf;\n"
|
"in VertToFrag vtf;\n"
|
||||||
"layout(location=0) out vec4 colorOut;\n"
|
"layout(location=0) out vec4 colorOut;\n"
|
||||||
"uniform sampler2D texs[1];\n"
|
"TBINDING0 uniform sampler2D texs[1];\n"
|
||||||
"void main()\n"
|
"void main()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" colorOut = vtf.color * texture(texs[0], vtf.uv);\n"
|
" colorOut = vtf.color * texture(texs[0], vtf.uv);\n"
|
||||||
|
@ -47,10 +49,11 @@ static const char* FS_GLSL_TEX =
|
||||||
|
|
||||||
static const char* VS_GLSL_NOTEX =
|
static const char* VS_GLSL_NOTEX =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"layout(location=0) in vec4 posIn;\n"
|
"layout(location=0) in vec4 posIn;\n"
|
||||||
"layout(location=1) in vec4 colorIn;\n"
|
"layout(location=1) in vec4 colorIn;\n"
|
||||||
"\n"
|
"\n"
|
||||||
"uniform LineUniform\n"
|
"UBINDING0 uniform LineUniform\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec4 moduColor;\n"
|
" vec4 moduColor;\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
|
|
|
@ -224,7 +224,7 @@ void CMain::LoadAudio()
|
||||||
int CMain::appMain(boo::IApplication* app)
|
int CMain::appMain(boo::IApplication* app)
|
||||||
{
|
{
|
||||||
Zeus::detectCPU();
|
Zeus::detectCPU();
|
||||||
mainWindow = app->newWindow(_S("Metroid Prime 1 Reimplementation vZygote"));
|
mainWindow = app->newWindow(_S("Metroid Prime 1 Reimplementation vZygote"), 1);
|
||||||
mainWindow->showWindow();
|
mainWindow->showWindow();
|
||||||
TOneStatic<CGameGlobalObjects> globalObjs;
|
TOneStatic<CGameGlobalObjects> globalObjs;
|
||||||
InitializeSubsystems();
|
InitializeSubsystems();
|
||||||
|
@ -238,7 +238,7 @@ int CMain::appMain(boo::IApplication* app)
|
||||||
|
|
||||||
boo::IGraphicsCommandQueue* gfxQ = mainWindow->getCommandQueue();
|
boo::IGraphicsCommandQueue* gfxQ = mainWindow->getCommandQueue();
|
||||||
boo::SWindowRect windowRect = mainWindow->getWindowFrame();
|
boo::SWindowRect windowRect = mainWindow->getWindowFrame();
|
||||||
boo::ITextureR* renderTex = mainWindow->getMainContextDataFactory()->newRenderTexture(windowRect.size[0], windowRect.size[1], 1);
|
boo::ITextureR* renderTex = mainWindow->getMainContextDataFactory()->newRenderTexture(windowRect.size[0], windowRect.size[1]);
|
||||||
float rgba[4] = { 0.2f, 0.2f, 0.2f, 1.0f};
|
float rgba[4] = { 0.2f, 0.2f, 0.2f, 1.0f};
|
||||||
gfxQ->setClearColor(rgba);
|
gfxQ->setClearColor(rgba);
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,12 @@ namespace pshag
|
||||||
|
|
||||||
static const char* VS_GLSL_TEX =
|
static const char* VS_GLSL_TEX =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"layout(location=0) in vec4 posIn[4];\n"
|
"layout(location=0) in vec4 posIn[4];\n"
|
||||||
"layout(location=4) in vec4 colorIn;\n"
|
"layout(location=4) in vec4 colorIn;\n"
|
||||||
"layout(location=5) in vec4 uvsIn[4];\n"
|
"layout(location=5) in vec4 uvsIn[4];\n"
|
||||||
"\n"
|
"\n"
|
||||||
"uniform ParticleUniform\n"
|
"UBINDING0 uniform ParticleUniform\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" mat4 mvp;\n"
|
" mat4 mvp;\n"
|
||||||
" vec4 moduColor;\n"
|
" vec4 moduColor;\n"
|
||||||
|
@ -36,6 +37,7 @@ static const char* VS_GLSL_TEX =
|
||||||
|
|
||||||
static const char* FS_GLSL_TEX =
|
static const char* FS_GLSL_TEX =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"struct VertToFrag\n"
|
"struct VertToFrag\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec4 color;\n"
|
" vec4 color;\n"
|
||||||
|
@ -44,7 +46,7 @@ static const char* FS_GLSL_TEX =
|
||||||
"\n"
|
"\n"
|
||||||
"in VertToFrag vtf;\n"
|
"in VertToFrag vtf;\n"
|
||||||
"layout(location=0) out vec4 colorOut;\n"
|
"layout(location=0) out vec4 colorOut;\n"
|
||||||
"uniform sampler2D texs[1];\n"
|
"TBINDING0 uniform sampler2D texs[1];\n"
|
||||||
"void main()\n"
|
"void main()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" colorOut = vtf.color * texture(texs[0], vtf.uv);\n"
|
" colorOut = vtf.color * texture(texs[0], vtf.uv);\n"
|
||||||
|
@ -52,6 +54,7 @@ static const char* FS_GLSL_TEX =
|
||||||
|
|
||||||
static const char* FS_GLSL_TEX_REDTOALPHA =
|
static const char* FS_GLSL_TEX_REDTOALPHA =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"struct VertToFrag\n"
|
"struct VertToFrag\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec4 color;\n"
|
" vec4 color;\n"
|
||||||
|
@ -60,7 +63,7 @@ static const char* FS_GLSL_TEX_REDTOALPHA =
|
||||||
"\n"
|
"\n"
|
||||||
"in VertToFrag vtf;\n"
|
"in VertToFrag vtf;\n"
|
||||||
"layout(location=0) out vec4 colorOut;\n"
|
"layout(location=0) out vec4 colorOut;\n"
|
||||||
"uniform sampler2D texs[1];\n"
|
"TBINDING0 uniform sampler2D texs[1];\n"
|
||||||
"void main()\n"
|
"void main()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" colorOut = vtf.color * texture(texs[0], vtf.uv);\n"
|
" colorOut = vtf.color * texture(texs[0], vtf.uv);\n"
|
||||||
|
@ -69,12 +72,13 @@ static const char* FS_GLSL_TEX_REDTOALPHA =
|
||||||
|
|
||||||
static const char* VS_GLSL_INDTEX =
|
static const char* VS_GLSL_INDTEX =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"layout(location=0) in vec4 posIn[4];\n"
|
"layout(location=0) in vec4 posIn[4];\n"
|
||||||
"layout(location=4) in vec4 colorIn;\n"
|
"layout(location=4) in vec4 colorIn;\n"
|
||||||
"layout(location=5) in vec4 uvsInTexrTind[4];\n"
|
"layout(location=5) in vec4 uvsInTexrTind[4];\n"
|
||||||
"layout(location=9) in vec2 uvsInScene[4];\n"
|
"layout(location=9) in vec2 uvsInScene[4];\n"
|
||||||
"\n"
|
"\n"
|
||||||
"uniform ParticleUniform\n"
|
"UBINDING0 uniform ParticleUniform\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" mat4 mvp;\n"
|
" mat4 mvp;\n"
|
||||||
" vec4 moduColor;\n"
|
" vec4 moduColor;\n"
|
||||||
|
@ -100,6 +104,7 @@ static const char* VS_GLSL_INDTEX =
|
||||||
|
|
||||||
static const char* FS_GLSL_INDTEX =
|
static const char* FS_GLSL_INDTEX =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"struct VertToFrag\n"
|
"struct VertToFrag\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec4 color;\n"
|
" vec4 color;\n"
|
||||||
|
@ -110,7 +115,7 @@ static const char* FS_GLSL_INDTEX =
|
||||||
"\n"
|
"\n"
|
||||||
"in VertToFrag vtf;\n"
|
"in VertToFrag vtf;\n"
|
||||||
"layout(location=0) out vec4 colorOut;\n"
|
"layout(location=0) out vec4 colorOut;\n"
|
||||||
"uniform sampler2D texs[3];\n"
|
"TBINDING0 uniform sampler2D texs[3];\n"
|
||||||
"void main()\n"
|
"void main()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec2 tindTexel = texture(texs[2], vtf.uvTind).ba;\n"
|
" vec2 tindTexel = texture(texs[2], vtf.uvTind).ba;\n"
|
||||||
|
@ -122,6 +127,7 @@ static const char* FS_GLSL_INDTEX =
|
||||||
|
|
||||||
static const char* FS_GLSL_CINDTEX =
|
static const char* FS_GLSL_CINDTEX =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"struct VertToFrag\n"
|
"struct VertToFrag\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec4 color;\n"
|
" vec4 color;\n"
|
||||||
|
@ -132,7 +138,7 @@ static const char* FS_GLSL_CINDTEX =
|
||||||
"\n"
|
"\n"
|
||||||
"in VertToFrag vtf;\n"
|
"in VertToFrag vtf;\n"
|
||||||
"layout(location=0) out vec4 colorOut;\n"
|
"layout(location=0) out vec4 colorOut;\n"
|
||||||
"uniform sampler2D texs[3];\n"
|
"TBINDING0 uniform sampler2D texs[3];\n"
|
||||||
"void main()\n"
|
"void main()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec2 tindTexel = texture(texs[2], vtf.uvTind).ba;\n"
|
" vec2 tindTexel = texture(texs[2], vtf.uvTind).ba;\n"
|
||||||
|
@ -142,10 +148,11 @@ static const char* FS_GLSL_CINDTEX =
|
||||||
|
|
||||||
static const char* VS_GLSL_NOTEX =
|
static const char* VS_GLSL_NOTEX =
|
||||||
"#version 330\n"
|
"#version 330\n"
|
||||||
|
BOO_GLSL_BINDING_HEAD
|
||||||
"layout(location=0) in vec4 posIn[4];\n"
|
"layout(location=0) in vec4 posIn[4];\n"
|
||||||
"layout(location=4) in vec4 colorIn;\n"
|
"layout(location=4) in vec4 colorIn;\n"
|
||||||
"\n"
|
"\n"
|
||||||
"uniform ParticleUniform\n"
|
"UBINDING0 uniform ParticleUniform\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" mat4 mvp;\n"
|
" mat4 mvp;\n"
|
||||||
" vec4 moduColor;\n"
|
" vec4 moduColor;\n"
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 2ff161839491dd42362a680221f5ef4bc95f32cc
|
Subproject commit 5fa984eba8c87a974fba3c5f621747f2cd6982fc
|
|
@ -1 +1 @@
|
||||||
Subproject commit c83c1f0b939115497f4a15cfbc2669445e07bdb7
|
Subproject commit 019cb96a24828ddd2304c3a05ab6cd124a94c4b7
|
Loading…
Reference in New Issue