mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'master' of https://github.com/AxioDL/urde
This commit is contained in:
commit
df492ff32a
|
@ -7,7 +7,7 @@ import bpy
|
|||
|
||||
# 0 - Modelview Inverse (zero translation)
|
||||
def make_uva0():
|
||||
new_grp = bpy.data.node_groups.new('RetroUVMode0Node', 'ShaderNodeTree')
|
||||
new_grp = bpy.data.node_groups.new('RetroUVMode0NodeN', 'ShaderNodeTree')
|
||||
new_grp.inputs.new('NodeSocketVector', 'UV In')
|
||||
new_grp.outputs.new('NodeSocketVector', 'UV Out')
|
||||
new_grp.use_fake_user = True
|
||||
|
@ -32,7 +32,7 @@ def make_uva0():
|
|||
|
||||
# 1 - Modelview Inverse
|
||||
def make_uva1():
|
||||
new_grp = bpy.data.node_groups.new('RetroUVMode1Node', 'ShaderNodeTree')
|
||||
new_grp = bpy.data.node_groups.new('RetroUVMode1NodeN', 'ShaderNodeTree')
|
||||
new_grp.inputs.new('NodeSocketVector', 'UV In')
|
||||
new_grp.outputs.new('NodeSocketVector', 'UV Out')
|
||||
new_grp.use_fake_user = True
|
||||
|
@ -276,7 +276,7 @@ def make_uva5():
|
|||
|
||||
# 6 - Model Matrix
|
||||
def make_uva6():
|
||||
new_grp = bpy.data.node_groups.new('RetroUVMode6Node', 'ShaderNodeTree')
|
||||
new_grp = bpy.data.node_groups.new('RetroUVMode6NodeN', 'ShaderNodeTree')
|
||||
new_grp.inputs.new('NodeSocketVector', 'UV In')
|
||||
new_grp.outputs.new('NodeSocketVector', 'UV Out')
|
||||
new_grp.use_fake_user = True
|
||||
|
@ -305,7 +305,7 @@ def make_uva6():
|
|||
|
||||
# 7 - Mode Who Must Not Be Named
|
||||
def make_uva7():
|
||||
new_grp = bpy.data.node_groups.new('RetroUVMode7Node', 'ShaderNodeTree')
|
||||
new_grp = bpy.data.node_groups.new('RetroUVMode7NodeN', 'ShaderNodeTree')
|
||||
new_grp.inputs.new('NodeSocketVector', 'UV In')
|
||||
new_grp.inputs.new('NodeSocketFloat', 'ParamA')
|
||||
new_grp.inputs.new('NodeSocketFloat', 'ParamB')
|
||||
|
|
|
@ -73,7 +73,7 @@ void Material::AddTextureAnim(Stream& out,
|
|||
" soc_from = link.from_socket\n"
|
||||
" soc_to = link.to_socket\n"
|
||||
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
|
||||
" node.node_tree = bpy.data.node_groups['RetroUVMode0Node']\n"
|
||||
" node.node_tree = bpy.data.node_groups['RetroUVMode0NodeN']\n"
|
||||
" node.location[0] = link.from_node.location[0] + 50\n"
|
||||
" node.location[1] = link.from_node.location[1] - 50\n"
|
||||
" new_nodetree.links.remove(link)\n"
|
||||
|
@ -88,7 +88,7 @@ void Material::AddTextureAnim(Stream& out,
|
|||
" soc_from = link.from_socket\n"
|
||||
" soc_to = link.to_socket\n"
|
||||
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
|
||||
" node.node_tree = bpy.data.node_groups['RetroUVMode1Node']\n"
|
||||
" node.node_tree = bpy.data.node_groups['RetroUVMode1NodeN']\n"
|
||||
" node.location[0] = link.from_node.location[0] + 50\n"
|
||||
" node.location[1] = link.from_node.location[1] - 50\n"
|
||||
" new_nodetree.links.remove(link)\n"
|
||||
|
@ -175,7 +175,7 @@ void Material::AddTextureAnim(Stream& out,
|
|||
" soc_from = link.from_socket\n"
|
||||
" soc_to = link.to_socket\n"
|
||||
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
|
||||
" node.node_tree = bpy.data.node_groups['RetroUVMode6Node']\n"
|
||||
" node.node_tree = bpy.data.node_groups['RetroUVMode6NodeN']\n"
|
||||
" node.location[0] = link.from_node.location[0] + 50\n"
|
||||
" node.location[1] = link.from_node.location[1] - 50\n"
|
||||
" new_nodetree.links.remove(link)\n"
|
||||
|
@ -190,7 +190,7 @@ void Material::AddTextureAnim(Stream& out,
|
|||
" soc_from = link.from_socket\n"
|
||||
" soc_to = link.to_socket\n"
|
||||
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
|
||||
" node.node_tree = bpy.data.node_groups['RetroUVMode7Node']\n"
|
||||
" node.node_tree = bpy.data.node_groups['RetroUVMode7NodeN']\n"
|
||||
" node.location[0] = link.from_node.location[0] + 50\n"
|
||||
" node.location[1] = link.from_node.location[1] - 50\n"
|
||||
" node.inputs[1].default_value = %f\n"
|
||||
|
@ -1110,19 +1110,8 @@ MaterialSet::Material::Material(const hecl::Backend::GX& gx,
|
|||
target.setType(GX::TG_MTX3x4);
|
||||
target.setSource(tcg.m_src);
|
||||
target.setMtx(tcg.m_mtx);
|
||||
target.setPostMtx(GX::PTIDENTITY);
|
||||
|
||||
if (tcg.m_gameFunction.size() && tcg.m_mtx != GX::IDENTITY)
|
||||
{
|
||||
if (!tcg.m_gameFunction.compare("RetroUVMode0Node") ||
|
||||
!tcg.m_gameFunction.compare("RetroUVMode1Node") ||
|
||||
!tcg.m_gameFunction.compare("RetroUVMode6Node") ||
|
||||
!tcg.m_gameFunction.compare("RetroUVMode7Node"))
|
||||
{
|
||||
target.setNormalize(true);
|
||||
target.setPostMtx(GX::PTTexMtx(GX::PTTEXMTX0 - GX::TEXMTX0 + tcg.m_mtx));
|
||||
}
|
||||
}
|
||||
target.setNormalize(tcg.m_norm);
|
||||
target.setPostMtx(tcg.m_pmtx);
|
||||
}
|
||||
|
||||
uvAnimsSize = 4;
|
||||
|
@ -1240,9 +1229,9 @@ HMDLMaterialSet::Material::Material(hecl::Frontend::Frontend& FE,
|
|||
MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
|
||||
const std::vector<atVec4f>& gameArgs)
|
||||
{
|
||||
if (!gameFunction.compare("RetroUVMode0Node"))
|
||||
if (!gameFunction.compare("RetroUVMode0NodeN"))
|
||||
mode = Mode::MvInvNoTranslation;
|
||||
else if (!gameFunction.compare("RetroUVMode1Node"))
|
||||
else if (!gameFunction.compare("RetroUVMode1NodeN"))
|
||||
mode = Mode::MvInv;
|
||||
else if (!gameFunction.compare("RetroUVMode2Node"))
|
||||
{
|
||||
|
@ -1282,9 +1271,9 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
|
|||
vals[2] = gameArgs[2].vec[0];
|
||||
vals[3] = gameArgs[3].vec[0];
|
||||
}
|
||||
else if (!gameFunction.compare("RetroUVMode6Node"))
|
||||
else if (!gameFunction.compare("RetroUVMode6NodeN"))
|
||||
mode = Mode::Model;
|
||||
else if (!gameFunction.compare("RetroUVMode7Node"))
|
||||
else if (!gameFunction.compare("RetroUVMode7NodeN"))
|
||||
{
|
||||
mode = Mode::WhoMustNotBeNamed;
|
||||
if (gameArgs.size() < 2)
|
||||
|
|
|
@ -86,6 +86,7 @@ void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ)
|
|||
CLight::BuildCustom({0.f, -20.f, 10.f}, {0.f, 1.f, 0.f},
|
||||
{200.f, 200.f, 200.f}, 0.f, 0.f, 1.f, 1.f, 0.f, 0.f),
|
||||
CLight::BuildDirectional({0.f, 0.f, -1.f}, {0.3f, 0.3f, 0.3f})};
|
||||
//lights = {CLight::BuildLocalAmbient({}, {0.0f, 0.0f, 0.0f, 1.f})};
|
||||
m_vm.m_modelTest->GetInstance().ActivateLights(lights);
|
||||
m_vm.m_modelTest->Draw(flags);
|
||||
}
|
||||
|
|
|
@ -329,21 +329,20 @@ void CBooModel::UVAnimationBuffer::ProcessAnimation(u8*& bufOut, const UVAnimati
|
|||
{
|
||||
case UVAnimation::Mode::MvInvNoTranslation:
|
||||
{
|
||||
texMtxOut = (CGraphics::g_ViewMatrix * CGraphics::g_GXModelMatrix).inverse().toMatrix4f();
|
||||
texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f();
|
||||
texMtxOut.vec[3].zeroOut();
|
||||
texMtxOut.vec[3].w = 1.f;
|
||||
postMtxOut.vec[0].x = 0.5f;
|
||||
postMtxOut.vec[1].y = 0.0f;
|
||||
postMtxOut.vec[2].y = 0.5f;
|
||||
postMtxOut.vec[1].y = 0.5f;
|
||||
postMtxOut.vec[3].x = 0.5f;
|
||||
postMtxOut.vec[3].y = 0.5f;
|
||||
break;
|
||||
}
|
||||
case UVAnimation::Mode::MvInv:
|
||||
{
|
||||
texMtxOut = (CGraphics::g_ViewMatrix * CGraphics::g_GXModelMatrix).inverse().toMatrix4f();
|
||||
texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f();
|
||||
postMtxOut.vec[0].x = 0.5f;
|
||||
postMtxOut.vec[1].y = 0.0f;
|
||||
postMtxOut.vec[2].y = 0.5f;
|
||||
postMtxOut.vec[1].y = 0.5f;
|
||||
postMtxOut.vec[3].x = 0.5f;
|
||||
postMtxOut.vec[3].y = 0.5f;
|
||||
break;
|
||||
|
@ -385,7 +384,6 @@ void CBooModel::UVAnimationBuffer::ProcessAnimation(u8*& bufOut, const UVAnimati
|
|||
texMtxOut.vec[3].zeroOut();
|
||||
|
||||
postMtxOut.vec[0].x = 0.5f;
|
||||
postMtxOut.vec[1].y = 0.0f;
|
||||
postMtxOut.vec[2].y = 0.5f;
|
||||
postMtxOut.vec[3].x = CGraphics::g_GXModelMatrix.origin.x * 0.5f;
|
||||
postMtxOut.vec[3].y = CGraphics::g_GXModelMatrix.origin.y * 0.5f;
|
||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
|||
Subproject commit 05c15f053890cb0007f55542976c6704743296fd
|
||||
Subproject commit 239a73cba2f780e0d8e3190806b0f98dae4be626
|
Loading…
Reference in New Issue