Correct indirect texture sampling swizzle

This commit is contained in:
Jack Andersen 2019-03-07 17:33:50 -10:00
parent 3759bf1b3d
commit 72b14a78a0
4 changed files with 5 additions and 4 deletions

View File

@ -141,7 +141,7 @@ std::string GLSL::GenerateReflectionExpr(ReflectionType type) const {
case ReflectionType::Simple:
return "texture(reflectionTex, vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha";
case ReflectionType::Indirect:
return "texture(reflectionTex, (texture(reflectionIndTex, vtf.reflectTcgs[0]).rg - "
return "texture(reflectionTex, (texture(reflectionIndTex, vtf.reflectTcgs[0]).ab - "
"vec2(0.5, 0.5)) * vec2(0.5, 0.5) + vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha";
}
}

View File

@ -137,7 +137,7 @@ std::string HLSL::GenerateReflectionExpr(ReflectionType type) const {
case ReflectionType::Simple:
return "reflectionTex.Sample(reflectSamp, vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha";
case ReflectionType::Indirect:
return "reflectionTex.Sample(reflectSamp, (reflectionIndTex.Sample(samp, vtf.reflectTcgs[0]).rg - "
return "reflectionTex.Sample(reflectSamp, (reflectionIndTex.Sample(samp, vtf.reflectTcgs[0]).ab - "
"float2(0.5, 0.5)) * float2(0.5, 0.5) + vtf.reflectTcgs[1]).rgb * vtf.reflectAlpha";
}
}

View File

@ -137,7 +137,7 @@ std::string Metal::GenerateReflectionExpr(ReflectionType type) const {
case ReflectionType::Simple:
return "reflectionTex.sample(reflectSamp, vtf.reflectTcgs1).rgb * vtf.reflectAlpha";
case ReflectionType::Indirect:
return "reflectionTex.sample(reflectSamp, (reflectionIndTex.sample(samp, vtf.reflectTcgs0).rg - "
return "reflectionTex.sample(reflectSamp, (reflectionIndTex.sample(samp, vtf.reflectTcgs0).ab - "
"float2(0.5, 0.5)) * float2(0.5, 0.5) + vtf.reflectTcgs1).rgb * vtf.reflectAlpha";
}
}

View File

@ -481,7 +481,8 @@ Connection::Connection(int verbosityLevel) {
BlenderLog.report(logvisor::Fatal, _SYS_STR("Unable to find blender at '%s'"), DEFAULT_BLENDER_BIN);
} else if (!strcmp(lineBuf, "NOADDON")) {
_closePipe();
InstallAddon(blenderAddonPath.c_str());
if (blenderAddonPath != _SYS_STR("SKIPINSTALL"))
InstallAddon(blenderAddonPath.c_str());
++installAttempt;
if (installAttempt >= 2)
BlenderLog.report(logvisor::Fatal, _SYS_STR("unable to install blender addon using '%s'"),