Eliminated PipelineInfo.bAlphaBlend as it can be determined from rasterMode
This commit is contained in:
@@ -344,7 +344,7 @@ bool KRMaterial::bind(const KRNode::RenderInfo& ri, const std::vector<KRBone *>
|
|||||||
info.bNormalMapOffset = m_normalMapOffset != default_offset && bNormalMap;
|
info.bNormalMapOffset = m_normalMapOffset != default_offset && bNormalMap;
|
||||||
info.bReflectionMapOffset = m_reflectionMapOffset != default_offset && bReflectionMap;
|
info.bReflectionMapOffset = m_reflectionMapOffset != default_offset && bReflectionMap;
|
||||||
info.bAlphaTest = bAlphaTest;
|
info.bAlphaTest = bAlphaTest;
|
||||||
info.bAlphaBlend = bAlphaBlend;
|
info.rasterMode = bAlphaBlend ? PipelineInfo::RasterMode::kAlphaBlend : PipelineInfo::RasterMode::kOpaque;
|
||||||
info.bRimColor = rim_power != 0.0f;
|
info.bRimColor = rim_power != 0.0f;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ public:
|
|||||||
bool bNormalMapOffset : 1;
|
bool bNormalMapOffset : 1;
|
||||||
bool bReflectionMapOffset : 1;
|
bool bReflectionMapOffset : 1;
|
||||||
bool bAlphaTest : 1;
|
bool bAlphaTest : 1;
|
||||||
bool bAlphaBlend : 1;
|
|
||||||
bool bRimColor : 1;
|
bool bRimColor : 1;
|
||||||
RasterMode rasterMode;
|
RasterMode rasterMode;
|
||||||
KRNode::RenderPass renderPass;
|
KRNode::RenderPass renderPass;
|
||||||
|
|||||||
@@ -127,8 +127,8 @@ KRPipeline *KRPipelineManager::getPipeline(KRSurface& surface, const PipelineInf
|
|||||||
key.second.push_back(light_spot_count);
|
key.second.push_back(light_spot_count);
|
||||||
key.second.push_back(info.pCamera->settings.fog_type);
|
key.second.push_back(info.pCamera->settings.fog_type);
|
||||||
key.second.push_back(info.pCamera->settings.bEnablePerPixel);
|
key.second.push_back(info.pCamera->settings.bEnablePerPixel);
|
||||||
|
key.second.push_back((int)info.rasterMode);
|
||||||
key.second.push_back(info.bAlphaTest);
|
key.second.push_back(info.bAlphaTest);
|
||||||
key.second.push_back(info.bAlphaBlend);
|
|
||||||
key.second.push_back(info.bDiffuseMap);
|
key.second.push_back(info.bDiffuseMap);
|
||||||
key.second.push_back(info.bNormalMap);
|
key.second.push_back(info.bNormalMap);
|
||||||
key.second.push_back(info.bSpecMap);
|
key.second.push_back(info.bSpecMap);
|
||||||
@@ -217,7 +217,8 @@ KRPipeline *KRPipelineManager::getPipeline(KRSurface& surface, const PipelineInf
|
|||||||
stream << "\n#define HAS_REFLECTION_CUBE_MAP " << (info.bReflectionCubeMap ? "1" : "0");
|
stream << "\n#define HAS_REFLECTION_CUBE_MAP " << (info.bReflectionCubeMap ? "1" : "0");
|
||||||
|
|
||||||
stream << "\n#define ALPHA_TEST " << (info.bAlphaTest ? "1" : "0");
|
stream << "\n#define ALPHA_TEST " << (info.bAlphaTest ? "1" : "0");
|
||||||
stream << "\n#define ALPHA_BLEND " << (info.bAlphaBlend ? "1" : "0");
|
stream << "\n#define ALPHA_BLEND " << ((info.rasterMode == PipelineInfo::RasterMode::kAlphaBlend
|
||||||
|
|| info.rasterMode == PipelineInfo::RasterMode::kAdditive) ? "1" : "0");
|
||||||
|
|
||||||
stream << "\n#define ENABLE_PER_PIXEL " << (info.pCamera->settings.bEnablePerPixel ? "1" : "0");
|
stream << "\n#define ENABLE_PER_PIXEL " << (info.pCamera->settings.bEnablePerPixel ? "1" : "0");
|
||||||
stream << "\n#define DEBUG_PSSM " << (info.pCamera->settings.bDebugPSSM ? "1" : "0");
|
stream << "\n#define DEBUG_PSSM " << (info.pCamera->settings.bDebugPSSM ? "1" : "0");
|
||||||
@@ -278,7 +279,7 @@ KRPipeline *KRPipelineManager::getPipeline(KRSurface& surface, const PipelineInf
|
|||||||
Vector4 fade_color = info.pCamera->getFadeColor();
|
Vector4 fade_color = info.pCamera->getFadeColor();
|
||||||
|
|
||||||
char szKey[256];
|
char szKey[256];
|
||||||
sprintf(szKey, "%i_%i_%i_%i_%i_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%i_%s_%i_%d_%d_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f", light_directional_count, light_point_count, light_spot_count, info.bone_count, info.pCamera->settings.fog_type, info.pCamera->settings.bEnablePerPixel, info.bAlphaTest, info.bAlphaBlend, info.bDiffuseMap, info.bNormalMap, info.bSpecMap, info.bReflectionMap, info.bReflectionCubeMap, info.pCamera->settings.bDebugPSSM, iShadowQuality, info.pCamera->settings.bEnableAmbient, info.pCamera->settings.bEnableDiffuse, info.pCamera->settings.bEnableSpecular, info.bLightMap, info.bDiffuseMapScale, info.bSpecMapScale, info.bReflectionMapScale, info.bNormalMapScale, info.bDiffuseMapOffset, info.bSpecMapOffset, info.bReflectionMapOffset, info.bNormalMapOffset, info.pCamera->settings.volumetric_environment_enable && info.pCamera->settings.volumetric_environment_downsample != 0, info.renderPass, info.shader_name->c_str(), info.pCamera->settings.dof_quality, info.pCamera->settings.bEnableFlash, info.pCamera->settings.bEnableVignette, info.pCamera->settings.dof_depth, info.pCamera->settings.dof_falloff, info.pCamera->settings.flash_depth, info.pCamera->settings.flash_falloff, info.pCamera->settings.flash_intensity, info.pCamera->settings.vignette_radius, info.pCamera->settings.vignette_falloff, fade_color.x, fade_color.y, fade_color.z, fade_color.w);
|
sprintf(szKey, "%i_%i_%i_%i_%i_%i_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%d_%i_%s_%i_%d_%d_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f", (int)info.rasterMode, light_directional_count, light_point_count, light_spot_count, info.bone_count, info.pCamera->settings.fog_type, info.pCamera->settings.bEnablePerPixel, info.bAlphaTest, info.bDiffuseMap, info.bNormalMap, info.bSpecMap, info.bReflectionMap, info.bReflectionCubeMap, info.pCamera->settings.bDebugPSSM, iShadowQuality, info.pCamera->settings.bEnableAmbient, info.pCamera->settings.bEnableDiffuse, info.pCamera->settings.bEnableSpecular, info.bLightMap, info.bDiffuseMapScale, info.bSpecMapScale, info.bReflectionMapScale, info.bNormalMapScale, info.bDiffuseMapOffset, info.bSpecMapOffset, info.bReflectionMapOffset, info.bNormalMapOffset, info.pCamera->settings.volumetric_environment_enable && info.pCamera->settings.volumetric_environment_downsample != 0, info.renderPass, info.shader_name->c_str(), info.pCamera->settings.dof_quality, info.pCamera->settings.bEnableFlash, info.pCamera->settings.bEnableVignette, info.pCamera->settings.dof_depth, info.pCamera->settings.dof_falloff, info.pCamera->settings.flash_depth, info.pCamera->settings.flash_falloff, info.pCamera->settings.flash_intensity, info.pCamera->settings.vignette_radius, info.pCamera->settings.vignette_falloff, fade_color.x, fade_color.y, fade_color.z, fade_color.w);
|
||||||
|
|
||||||
pPipeline = new KRPipeline(getContext(), szKey, options, vertSource->getData()->getString(), fragSource->getData()->getString());
|
pPipeline = new KRPipeline(getContext(), szKey, options, vertSource->getData()->getString(), fragSource->getData()->getString());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user