mirror of https://github.com/AxioDL/metaforce.git
Reflection sampler fixes
This commit is contained in:
parent
2e824b6bb5
commit
3698199403
|
@ -1 +1 @@
|
||||||
Subproject commit 7d1be415c6fd83468ede3641ffc07cfc06a6e9f9
|
Subproject commit 9d91cd459ed9cf302e4e4ce2a43485d3b9b2733a
|
|
@ -129,9 +129,9 @@ std::string HLSL::GenerateReflectionExpr(ReflectionType type) const
|
||||||
default:
|
default:
|
||||||
return "float3(0.0, 0.0, 0.0)";
|
return "float3(0.0, 0.0, 0.0)";
|
||||||
case ReflectionType::Simple:
|
case ReflectionType::Simple:
|
||||||
return "reflectionTex.Sample(samp, vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha";
|
return "reflectionTex.Sample(reflectSamp, vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha";
|
||||||
case ReflectionType::Indirect:
|
case ReflectionType::Indirect:
|
||||||
return "reflectionTex.Sample(samp, (reflectionIndTex.Sample(samp, vtf.reflectTcgs[0]).rg - "
|
return "reflectionTex.Sample(reflectSamp, (reflectionIndTex.Sample(samp, vtf.reflectTcgs[0]).rg - "
|
||||||
"float2(0.5, 0.5)) * float2(0.5, 0.5) + vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha";
|
"float2(0.5, 0.5)) * float2(0.5, 0.5) + vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,8 @@ std::string HLSL::makeFrag(size_t blockCount, const char** blockNames,
|
||||||
m_texMapEnd);
|
m_texMapEnd);
|
||||||
std::string retval =
|
std::string retval =
|
||||||
"SamplerState samp : register(s0);\n"
|
"SamplerState samp : register(s0);\n"
|
||||||
"SamplerState clampSamp : register(s1);\n" +
|
"SamplerState clampSamp : register(s1);\n"
|
||||||
|
"SamplerState reflectSamp : register(s2);\n" +
|
||||||
GenerateVertToFragStruct(0, reflectionType != ReflectionType::None) +
|
GenerateVertToFragStruct(0, reflectionType != ReflectionType::None) +
|
||||||
texMapDecl + "\n" +
|
texMapDecl + "\n" +
|
||||||
lightingSrc + "\n" +
|
lightingSrc + "\n" +
|
||||||
|
@ -315,7 +316,8 @@ std::string HLSL::makeFrag(size_t blockCount, const char** blockNames,
|
||||||
|
|
||||||
std::string retval =
|
std::string retval =
|
||||||
"SamplerState samp : register(s0);\n"
|
"SamplerState samp : register(s0);\n"
|
||||||
"SamplerState clampSamp : register(s1);\n" +
|
"SamplerState clampSamp : register(s1);\n"
|
||||||
|
"SamplerState reflectSamp : register(s2);\n" +
|
||||||
GenerateVertToFragStruct(extTexCount, reflectionType != ReflectionType::None) +
|
GenerateVertToFragStruct(extTexCount, reflectionType != ReflectionType::None) +
|
||||||
texMapDecl + "\n" +
|
texMapDecl + "\n" +
|
||||||
lightingSrc + "\n" +
|
lightingSrc + "\n" +
|
||||||
|
|
|
@ -133,9 +133,9 @@ std::string Metal::GenerateReflectionExpr(ReflectionType type) const
|
||||||
default:
|
default:
|
||||||
return "float3(0.0, 0.0, 0.0)";
|
return "float3(0.0, 0.0, 0.0)";
|
||||||
case ReflectionType::Simple:
|
case ReflectionType::Simple:
|
||||||
return "reflectionTex.sample(samp, vtf.reflectTcgs1).rgb * vtf.reflectAlpha";
|
return "reflectionTex.sample(reflectSamp, vtf.reflectTcgs1).rgb * vtf.reflectAlpha";
|
||||||
case ReflectionType::Indirect:
|
case ReflectionType::Indirect:
|
||||||
return "reflectionTex.sample(samp, (reflectionIndTex.sample(samp, vtf.reflectTcgs0).rg - "
|
return "reflectionTex.sample(reflectSamp, (reflectionIndTex.sample(samp, vtf.reflectTcgs0).rg - "
|
||||||
"float2(0.5, 0.5)) * float2(0.5, 0.5) + vtf.reflectTcgs1).rgb * vtf.reflectAlpha";
|
"float2(0.5, 0.5)) * float2(0.5, 0.5) + vtf.reflectTcgs1).rgb * vtf.reflectAlpha";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@ std::string Metal::makeFrag(size_t blockCount, const char** blockNames, bool alp
|
||||||
GenerateFragOutStruct() + "\n" +
|
GenerateFragOutStruct() + "\n" +
|
||||||
lightingSrc + "\n" +
|
lightingSrc + "\n" +
|
||||||
"fragment FragOut fmain(VertToFrag vtf [[ stage_in ]],\n"
|
"fragment FragOut fmain(VertToFrag vtf [[ stage_in ]],\n"
|
||||||
"sampler samp [[ sampler(0) ]], sampler clampSamp [[ sampler(1) ]]" + texMapDecl + ")\n"
|
"sampler samp [[ sampler(0) ]], sampler clampSamp [[ sampler(1) ]], sampler reflectSamp [[ sampler(2) ]]" + texMapDecl + ")\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" FragOut out;\n";
|
" FragOut out;\n";
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ std::string Metal::makeFrag(size_t blockCount, const char** blockNames, bool alp
|
||||||
lightingSrc + "\n" +
|
lightingSrc + "\n" +
|
||||||
postSrc + "\n" +
|
postSrc + "\n" +
|
||||||
"fragment FragOut fmain(VertToFrag vtf [[ stage_in ]],\n"
|
"fragment FragOut fmain(VertToFrag vtf [[ stage_in ]],\n"
|
||||||
"sampler samp [[ sampler(0) ]], sampler clampSamp [[ sampler(1) ]]" + texMapDecl + ")\n"
|
"sampler samp [[ sampler(0) ]], sampler clampSamp [[ sampler(1) ]], sampler reflectSamp [[ sampler(2) ]]" + texMapDecl + ")\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" FragOut out;\n";
|
" FragOut out;\n";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue