mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix per game setting and pack setting in vec4
This commit is contained in:
parent
6c9eb4764c
commit
b07874cd00
13 changed files with 63 additions and 155 deletions
|
@ -768,30 +768,6 @@ static ConfigSetting graphicsSettings[] = {
|
|||
ReportedConfigSetting("HardwareTessellation", &g_Config.bHardwareTessellation, false, true, true),
|
||||
ReportedConfigSetting("PostShader", &g_Config.sPostShaderName, "Off", true, true),
|
||||
|
||||
ReportedConfigSetting("PostShaderSettingName1", &g_Config.sPostShaderSettingName1, "", true, true),
|
||||
ReportedConfigSetting("PostShaderSettingValue1", &g_Config.fPostShaderSettingValue1, 0.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingMaxValue1", &g_Config.fPostShaderMaxSettingValue1, 1.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingMinValue1", &g_Config.fPostShaderMinSettingValue1, -1.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingStep1", &g_Config.fPostShaderSettingStep1, 0.01f, true, true),
|
||||
|
||||
ReportedConfigSetting("PostShaderSettingName2", &g_Config.sPostShaderSettingName2, "", true, true),
|
||||
ReportedConfigSetting("PostShaderSettingValue2", &g_Config.fPostShaderSettingValue2, 0.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingMaxValue2", &g_Config.fPostShaderMaxSettingValue2, 1.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingMinValue2", &g_Config.fPostShaderMinSettingValue2, -1.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingStep2", &g_Config.fPostShaderSettingStep2, 0.01f, true, true),
|
||||
|
||||
ReportedConfigSetting("PostShaderSettingName3", &g_Config.sPostShaderSettingName3, "", true, true),
|
||||
ReportedConfigSetting("PostShaderSettingValue3", &g_Config.fPostShaderSettingValue3, 0.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingMaxValue3", &g_Config.fPostShaderMaxSettingValue3, 1.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingMinValue3", &g_Config.fPostShaderMinSettingValue3, -1.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingStep3", &g_Config.fPostShaderSettingStep3, 0.01f, true, true),
|
||||
|
||||
ReportedConfigSetting("PostShaderSettingName4", &g_Config.sPostShaderSettingName4, "", true, true),
|
||||
ReportedConfigSetting("PostShaderSettingValue4", &g_Config.fPostShaderSettingValue4, 0.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingMaxValue4", &g_Config.fPostShaderMaxSettingValue4, 1.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingMinValue4", &g_Config.fPostShaderMinSettingValue4, -1.0f, true, true),
|
||||
ConfigSetting("PostShaderSettingStep4", &g_Config.fPostShaderSettingStep4, 0.01f, true, true),
|
||||
|
||||
ReportedConfigSetting("MemBlockTransferGPU", &g_Config.bBlockTransferGPU, true, true, true),
|
||||
ReportedConfigSetting("DisableSlowFramebufEffects", &g_Config.bDisableSlowFramebufEffects, false, true, true),
|
||||
ReportedConfigSetting("FragmentTestCache", &g_Config.bFragmentTestCache, true, true, true),
|
||||
|
@ -1216,8 +1192,8 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
|
|||
|
||||
auto postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting")->ToMap();
|
||||
mPostShaderSetting.clear();
|
||||
for (auto it = postShaderSetting.begin(), end = postShaderSetting.end(); it != end; ++it) {
|
||||
mPostShaderSetting.insert(std::pair<std::string, float>(it->first, std::stof(it->second)));
|
||||
for (auto it : postShaderSetting) {
|
||||
mPostShaderSetting[it.first] = std::stof(it.second);
|
||||
}
|
||||
|
||||
// This caps the exponent 4 (so 16x.)
|
||||
|
@ -1615,8 +1591,8 @@ bool Config::loadGameConfig(const std::string &pGameId, const std::string &title
|
|||
|
||||
auto postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting")->ToMap();
|
||||
mPostShaderSetting.clear();
|
||||
for (auto it = postShaderSetting.begin(), end = postShaderSetting.end(); it != end; ++it) {
|
||||
mPostShaderSetting.insert(std::pair<std::string, float>(it->first, std::stof(it->second)));
|
||||
for (auto it : postShaderSetting) {
|
||||
mPostShaderSetting[it.first] = std::stof(it.second);
|
||||
}
|
||||
|
||||
IterateSettings(iniFile, [](IniFile::Section *section, ConfigSetting *setting) {
|
||||
|
@ -1643,6 +1619,12 @@ void Config::unloadGameConfig() {
|
|||
}
|
||||
});
|
||||
|
||||
auto postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting")->ToMap();
|
||||
mPostShaderSetting.clear();
|
||||
for (auto it : postShaderSetting) {
|
||||
mPostShaderSetting[it.first] = std::stof(it.second);
|
||||
}
|
||||
|
||||
LoadStandardControllerIni();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,26 +205,6 @@ public:
|
|||
int iSplineBezierQuality; // 0 = low , 1 = Intermediate , 2 = High
|
||||
bool bHardwareTessellation;
|
||||
std::string sPostShaderName; // Off for off.
|
||||
std::string sPostShaderSettingName1;
|
||||
float fPostShaderSettingValue1;
|
||||
float fPostShaderMaxSettingValue1;
|
||||
float fPostShaderMinSettingValue1;
|
||||
float fPostShaderSettingStep1;
|
||||
std::string sPostShaderSettingName2;
|
||||
float fPostShaderSettingValue2;
|
||||
float fPostShaderMaxSettingValue2;
|
||||
float fPostShaderMinSettingValue2;
|
||||
float fPostShaderSettingStep2;
|
||||
std::string sPostShaderSettingName3;
|
||||
float fPostShaderSettingValue3;
|
||||
float fPostShaderMaxSettingValue3;
|
||||
float fPostShaderMinSettingValue3;
|
||||
float fPostShaderSettingStep3;
|
||||
std::string sPostShaderSettingName4;
|
||||
float fPostShaderSettingValue4;
|
||||
float fPostShaderMaxSettingValue4;
|
||||
float fPostShaderMinSettingValue4;
|
||||
float fPostShaderSettingStep4;
|
||||
std::map<std::string, float> mPostShaderSetting;
|
||||
bool bGfxDebugOutput;
|
||||
bool bGfxDebugSplitSubmit;
|
||||
|
|
|
@ -130,6 +130,16 @@ void LoadPostShaderInfo(std::vector<std::string> directories) {
|
|||
section.Get("SettingMinValue4", &info.minSettingValue4, -1.0f);
|
||||
section.Get("SettingMaxValue4", &info.maxSettingValue4, 1.0f);
|
||||
section.Get("SettingStep4", &info.settingStep4, 0.01f);
|
||||
|
||||
if (g_Config.mPostShaderSetting.find(info.section + "SettingValue1") == g_Config.mPostShaderSetting.end())
|
||||
g_Config.mPostShaderSetting.insert(std::pair<std::string, float>(info.section + "SettingValue1", info.settingValue1));
|
||||
if (g_Config.mPostShaderSetting.find(info.section + "SettingValue2") == g_Config.mPostShaderSetting.end())
|
||||
g_Config.mPostShaderSetting.insert(std::pair<std::string, float>(info.section + "SettingValue2", info.settingValue2));
|
||||
if (g_Config.mPostShaderSetting.find(info.section + "SettingValue3") == g_Config.mPostShaderSetting.end())
|
||||
g_Config.mPostShaderSetting.insert(std::pair<std::string, float>(info.section + "SettingValue3", info.settingValue3));
|
||||
if (g_Config.mPostShaderSetting.find(info.section + "SettingValue4") == g_Config.mPostShaderSetting.end())
|
||||
g_Config.mPostShaderSetting.insert(std::pair<std::string, float>(info.section + "SettingValue4", info.settingValue4));
|
||||
|
||||
// Let's ignore shaders we can't support. TODO: Not a very good check
|
||||
if (gl_extensions.IsGLES && !gl_extensions.GLES3) {
|
||||
bool requiresIntegerSupport;
|
||||
|
|
|
@ -164,10 +164,10 @@ void PresentationCommon::CalculatePostShaderUniforms(int bufferWidth, int buffer
|
|||
uniforms->gl_HalfPixel[0] = u_pixel_delta * 0.5f;
|
||||
uniforms->gl_HalfPixel[1] = v_pixel_delta * 0.5f;
|
||||
|
||||
uniforms->setting1 = g_Config.fPostShaderSettingValue1;
|
||||
uniforms->setting2 = g_Config.fPostShaderSettingValue2;
|
||||
uniforms->setting3 = g_Config.fPostShaderSettingValue3;
|
||||
uniforms->setting4 = g_Config.fPostShaderSettingValue4;
|
||||
uniforms->setting[0] = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue1"];;
|
||||
uniforms->setting[1] = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue2"];
|
||||
uniforms->setting[2] = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue3"];
|
||||
uniforms->setting[3] = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue4"];
|
||||
}
|
||||
|
||||
static std::string ReadShaderSrc(const std::string &filename) {
|
||||
|
@ -218,11 +218,8 @@ bool PresentationCommon::UpdatePostShader() {
|
|||
{ "u_texelDelta", 1, 1, Draw::UniformType::FLOAT2, offsetof(PostShaderUniforms, texelDelta) },
|
||||
{ "u_pixelDelta", 2, 2, Draw::UniformType::FLOAT2, offsetof(PostShaderUniforms, pixelDelta) },
|
||||
{ "u_time", 3, 3, Draw::UniformType::FLOAT4, offsetof(PostShaderUniforms, time) },
|
||||
{ "u_video", 4, 4, Draw::UniformType::FLOAT1, offsetof(PostShaderUniforms, video) },
|
||||
{ "u_setting1", 5, 5, Draw::UniformType::FLOAT1, offsetof(PostShaderUniforms, setting1) },
|
||||
{ "u_setting2", 6, 6, Draw::UniformType::FLOAT1, offsetof(PostShaderUniforms, setting2) },
|
||||
{ "u_setting3", 7, 7, Draw::UniformType::FLOAT1, offsetof(PostShaderUniforms, setting3) },
|
||||
{ "u_setting4", 8, 8, Draw::UniformType::FLOAT1, offsetof(PostShaderUniforms, setting4) },
|
||||
{ "u_setting", 4, 4, Draw::UniformType::FLOAT4, offsetof(PostShaderUniforms, setting) },
|
||||
{ "u_video", 5, 5, Draw::UniformType::FLOAT1, offsetof(PostShaderUniforms, video) },
|
||||
} };
|
||||
Draw::Pipeline *pipeline = CreatePipeline({ vs, fs }, true, &postShaderDesc);
|
||||
if (!pipeline)
|
||||
|
|
|
@ -31,12 +31,8 @@ struct CardboardSettings {
|
|||
struct PostShaderUniforms {
|
||||
float texelDelta[2]; float pixelDelta[2];
|
||||
float time[4];
|
||||
float video;
|
||||
float setting1;
|
||||
float setting2;
|
||||
float setting3;
|
||||
float setting4;
|
||||
float pad[3];
|
||||
float setting[4];
|
||||
float video; float pad[3];
|
||||
// Used on Direct3D9.
|
||||
float gl_HalfPixel[4];
|
||||
};
|
||||
|
|
|
@ -86,11 +86,8 @@ cbuffer data : register(b0) {
|
|||
float2 u_texelDelta;
|
||||
float2 u_pixelDelta;
|
||||
float4 u_time;
|
||||
float4 u_setting;
|
||||
float u_video;
|
||||
float u_setting1;
|
||||
float u_setting2;
|
||||
float u_setting3;
|
||||
float u_setting4;
|
||||
};
|
||||
)";
|
||||
|
||||
|
@ -105,11 +102,8 @@ layout (std140, set = 0, binding = 0) uniform Data {
|
|||
vec2 u_texelDelta;
|
||||
vec2 u_pixelDelta;
|
||||
vec4 u_time;
|
||||
vec4 u_setting;
|
||||
float u_video;
|
||||
float u_setting1;
|
||||
float u_setting2;
|
||||
float u_setting3;
|
||||
float u_setting4;
|
||||
};
|
||||
)";
|
||||
|
||||
|
@ -118,11 +112,8 @@ float4 gl_HalfPixel : register(c0);
|
|||
float2 u_texelDelta : register(c1);
|
||||
float2 u_pixelDelta : register(c2);
|
||||
float4 u_time : register(c3);
|
||||
float u_video : register(c4);
|
||||
float u_setting1 : register(c5);
|
||||
float u_setting2 : register(c6);
|
||||
float u_setting3 : register(c7);
|
||||
float u_setting4 : register(c8);
|
||||
float4 u_setting : register(c4);
|
||||
float u_video : register(c5);
|
||||
)";
|
||||
|
||||
// SPIRV-Cross' HLSL output has some deficiencies we need to work around.
|
||||
|
|
|
@ -290,34 +290,24 @@ void GameSettingsScreen::CreateViews() {
|
|||
return g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
|
||||
});
|
||||
|
||||
if (g_Config.sPostShaderSettingName1 != "") {
|
||||
graphicsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fPostShaderSettingValue1, g_Config.fPostShaderMinSettingValue1, g_Config.fPostShaderMaxSettingValue1,
|
||||
g_Config.sPostShaderSettingName1, g_Config.fPostShaderSettingStep1, screenManager()))->OnChange.Add([=](EventParams &e) {
|
||||
g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue1"] = g_Config.fPostShaderSettingValue1;
|
||||
return UI::EVENT_CONTINUE;
|
||||
});;
|
||||
const ShaderInfo *shaderInfo = GetPostShaderInfo(g_Config.sPostShaderName);
|
||||
if (shaderInfo && !shaderInfo->settingName1.empty()) {
|
||||
auto &value = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue1"];
|
||||
graphicsSettings->Add(new PopupSliderChoiceFloat(&value, shaderInfo->minSettingValue1, shaderInfo->maxSettingValue1, shaderInfo->settingName1, shaderInfo->settingStep1, screenManager()));
|
||||
}
|
||||
if (g_Config.sPostShaderSettingName2 != "") {
|
||||
graphicsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fPostShaderSettingValue2, g_Config.fPostShaderMinSettingValue2, g_Config.fPostShaderMaxSettingValue2,
|
||||
g_Config.sPostShaderSettingName2, g_Config.fPostShaderSettingStep2, screenManager()))->OnChange.Add([=](EventParams &e) {
|
||||
g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue2"] = g_Config.fPostShaderSettingValue2;
|
||||
return UI::EVENT_CONTINUE;
|
||||
});;
|
||||
if (shaderInfo && !shaderInfo->settingName2.empty()) {
|
||||
auto &value = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue2"];
|
||||
graphicsSettings->Add(new PopupSliderChoiceFloat(&value, shaderInfo->minSettingValue2, shaderInfo->maxSettingValue2, shaderInfo->settingName2, shaderInfo->settingStep2, screenManager()));
|
||||
}
|
||||
if (g_Config.sPostShaderSettingName3 != "") {
|
||||
graphicsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fPostShaderSettingValue3, g_Config.fPostShaderMinSettingValue3, g_Config.fPostShaderMaxSettingValue3,
|
||||
g_Config.sPostShaderSettingName3, g_Config.fPostShaderSettingStep3, screenManager()))->OnChange.Add([=](EventParams &e) {
|
||||
g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue3"] = g_Config.fPostShaderSettingValue3;
|
||||
return UI::EVENT_CONTINUE;
|
||||
});;
|
||||
if (shaderInfo && !shaderInfo->settingName3.empty()) {
|
||||
auto &value = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue3"];
|
||||
graphicsSettings->Add(new PopupSliderChoiceFloat(&value, shaderInfo->minSettingValue3, shaderInfo->maxSettingValue3, shaderInfo->settingName3, shaderInfo->settingStep3, screenManager()));
|
||||
}
|
||||
if (g_Config.sPostShaderSettingName4 != "") {
|
||||
graphicsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fPostShaderSettingValue4, g_Config.fPostShaderMinSettingValue4, g_Config.fPostShaderMaxSettingValue4,
|
||||
g_Config.sPostShaderSettingName4, g_Config.fPostShaderSettingStep4, screenManager()))->OnChange.Add([=](EventParams &e) {
|
||||
g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue4"] = g_Config.fPostShaderSettingValue4;
|
||||
return UI::EVENT_CONTINUE;
|
||||
});;
|
||||
if (shaderInfo && !shaderInfo->settingName4.empty()) {
|
||||
auto &value = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue4"];
|
||||
graphicsSettings->Add(new PopupSliderChoiceFloat(&value, shaderInfo->minSettingValue4, shaderInfo->maxSettingValue4, shaderInfo->settingName4, shaderInfo->settingStep4, screenManager()));
|
||||
}
|
||||
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
graphicsSettings->Add(new CheckBox(&g_Config.bFullScreen, gr->T("FullScreen", "Full Screen")))->OnClick.Handle(this, &GameSettingsScreen::OnFullscreenChange);
|
||||
if (System_GetPropertyInt(SYSPROP_DISPLAY_COUNT) > 1) {
|
||||
|
|
|
@ -317,39 +317,6 @@ void PostProcScreen::OnCompleted(DialogResult result) {
|
|||
if (result != DR_OK)
|
||||
return;
|
||||
g_Config.sPostShaderName = shaders_[listView_->GetSelected()].section;
|
||||
|
||||
if (g_Config.mPostShaderSetting.find(g_Config.sPostShaderName + "SettingValue1") == g_Config.mPostShaderSetting.end())
|
||||
g_Config.mPostShaderSetting.insert(std::pair<std::string, float>(g_Config.sPostShaderName + "SettingValue1", shaders_[listView_->GetSelected()].settingValue1));
|
||||
if (g_Config.mPostShaderSetting.find(g_Config.sPostShaderName + "SettingValue2") == g_Config.mPostShaderSetting.end())
|
||||
g_Config.mPostShaderSetting.insert(std::pair<std::string, float>(g_Config.sPostShaderName + "SettingValue2", shaders_[listView_->GetSelected()].settingValue2));
|
||||
if (g_Config.mPostShaderSetting.find(g_Config.sPostShaderName + "SettingValue3") == g_Config.mPostShaderSetting.end())
|
||||
g_Config.mPostShaderSetting.insert(std::pair<std::string, float>(g_Config.sPostShaderName + "SettingValue3", shaders_[listView_->GetSelected()].settingValue3));
|
||||
if (g_Config.mPostShaderSetting.find(g_Config.sPostShaderName + "SettingValue4") == g_Config.mPostShaderSetting.end())
|
||||
g_Config.mPostShaderSetting.insert(std::pair<std::string, float>(g_Config.sPostShaderName + "SettingValue4", shaders_[listView_->GetSelected()].settingValue4));
|
||||
|
||||
g_Config.sPostShaderSettingName1 = shaders_[listView_->GetSelected()].settingName1;
|
||||
g_Config.fPostShaderSettingValue1 = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue1"];
|
||||
g_Config.fPostShaderMaxSettingValue1 = shaders_[listView_->GetSelected()].maxSettingValue1;
|
||||
g_Config.fPostShaderMinSettingValue1 = shaders_[listView_->GetSelected()].minSettingValue1;
|
||||
g_Config.fPostShaderSettingStep1 = shaders_[listView_->GetSelected()].settingStep1;
|
||||
|
||||
g_Config.sPostShaderSettingName2 = shaders_[listView_->GetSelected()].settingName2;
|
||||
g_Config.fPostShaderSettingValue2 = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue2"];
|
||||
g_Config.fPostShaderMaxSettingValue2 = shaders_[listView_->GetSelected()].maxSettingValue2;
|
||||
g_Config.fPostShaderMinSettingValue2 = shaders_[listView_->GetSelected()].minSettingValue2;
|
||||
g_Config.fPostShaderSettingStep2 = shaders_[listView_->GetSelected()].settingStep2;
|
||||
|
||||
g_Config.sPostShaderSettingName3 = shaders_[listView_->GetSelected()].settingName3;
|
||||
g_Config.fPostShaderSettingValue3 = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue3"];
|
||||
g_Config.fPostShaderMaxSettingValue3 = shaders_[listView_->GetSelected()].maxSettingValue3;
|
||||
g_Config.fPostShaderMinSettingValue3 = shaders_[listView_->GetSelected()].minSettingValue3;
|
||||
g_Config.fPostShaderSettingStep3 = shaders_[listView_->GetSelected()].settingStep3;
|
||||
|
||||
g_Config.sPostShaderSettingName4 = shaders_[listView_->GetSelected()].settingName4;
|
||||
g_Config.fPostShaderSettingValue4 = g_Config.mPostShaderSetting[g_Config.sPostShaderName + "SettingValue4"];
|
||||
g_Config.fPostShaderMaxSettingValue4 = shaders_[listView_->GetSelected()].maxSettingValue4;
|
||||
g_Config.fPostShaderMinSettingValue4 = shaders_[listView_->GetSelected()].minSettingValue4;
|
||||
g_Config.fPostShaderSettingStep4 = shaders_[listView_->GetSelected()].settingStep4;
|
||||
}
|
||||
|
||||
NewLanguageScreen::NewLanguageScreen(const std::string &title) : ListPopupScreen(title) {
|
||||
|
|
|
@ -10,8 +10,7 @@ precision mediump int;
|
|||
uniform sampler2D sampler0;
|
||||
varying vec2 v_texcoord0;
|
||||
|
||||
uniform float u_setting1; // float amount = 0.60; // suitable range = 0.00 - 1.00
|
||||
uniform float u_setting2; // float power = 0.5; // suitable range = 0.0 - 1.0
|
||||
uniform vec4 u_setting;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
@ -21,9 +20,9 @@ void main()
|
|||
|
||||
for(int i= -3 ;i < 3; i++)
|
||||
{
|
||||
sum += texture2D(sampler0, v_texcoord0 + vec2(-1, i)*0.004) * u_setting1;
|
||||
sum += texture2D(sampler0, v_texcoord0 + vec2(0, i)*0.004) * u_setting1;
|
||||
sum += texture2D(sampler0, v_texcoord0 + vec2(1, i)*0.004) * u_setting1;
|
||||
sum += texture2D(sampler0, v_texcoord0 + vec2(-1, i)*0.004) * u_setting.x;
|
||||
sum += texture2D(sampler0, v_texcoord0 + vec2(0, i)*0.004) * u_setting.x;
|
||||
sum += texture2D(sampler0, v_texcoord0 + vec2(1, i)*0.004) * u_setting.x;
|
||||
}
|
||||
|
||||
if (color.r < 0.3 && color.g < 0.3 && color.b < 0.3)
|
||||
|
@ -42,7 +41,7 @@ void main()
|
|||
}
|
||||
}
|
||||
|
||||
bloom = mix(color, bloom, u_setting2);
|
||||
bloom = mix(color, bloom, u_setting.y);
|
||||
gl_FragColor.rgb = bloom;
|
||||
gl_FragColor.a = 1.0;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ precision mediump float;
|
|||
precision mediump int;
|
||||
#endif
|
||||
|
||||
uniform float u_setting1; // const float bb = 0.5; // effects black border sensitivity; from 0.0 to 1.0
|
||||
uniform vec4 u_setting;
|
||||
|
||||
uniform sampler2D sampler0;
|
||||
|
||||
|
@ -39,7 +39,7 @@ void main()
|
|||
float d2=dot(abs(c20-c02),dt);
|
||||
float hl=dot(abs(c01-c21),dt);
|
||||
float vl=dot(abs(c10-c12),dt);
|
||||
float d = u_setting1*(d1+d2+hl+vl)/(dot(c11,dt)+0.15);
|
||||
float d = u_setting.x*(d1+d2+hl+vl)/(dot(c11,dt)+0.15);
|
||||
|
||||
float lc = 4.0*length(c11);
|
||||
float f = fract(lc); f*=f;
|
||||
|
|
|
@ -8,16 +8,13 @@ precision mediump int;
|
|||
uniform sampler2D sampler0;
|
||||
varying vec2 v_texcoord0;
|
||||
|
||||
uniform float u_setting1; // brightness - default: 1.0, range = 0.1 - 2.0
|
||||
uniform float u_setting2; // saturation - default: 1.0, range = 0.0 - 2.0
|
||||
uniform float u_setting3; // contrast - default: 1.0, range = 0.1 - 3.0
|
||||
uniform float u_setting4; // gamma - default: 1.0, range = 0.1 - 2.0
|
||||
uniform vec4 u_setting;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 rgb = texture2D( sampler0, v_texcoord0 ).xyz;
|
||||
rgb = vec3(mix(vec3(dot(rgb, vec3(0.299, 0.587, 0.114))), rgb, u_setting2));
|
||||
rgb = (rgb-0.5)*u_setting3+0.5+u_setting1-1.0;
|
||||
gl_FragColor.rgb = pow(rgb, vec3(1.0/u_setting4));
|
||||
rgb = vec3(mix(vec3(dot(rgb, vec3(0.299, 0.587, 0.114))), rgb, u_setting.y));
|
||||
rgb = (rgb-0.5)*u_setting.z+0.5+u_setting.x-1.0;
|
||||
gl_FragColor.rgb = pow(rgb, vec3(1.0/u_setting.w));
|
||||
gl_FragColor.a = 1.0;
|
||||
}
|
||||
|
|
|
@ -8,13 +8,12 @@ precision mediump int;
|
|||
uniform sampler2D sampler0;
|
||||
varying vec2 v_texcoord0;
|
||||
|
||||
uniform float u_setting1; // float amount = 1.0; // suitable range = 0.0 - 1.0
|
||||
uniform float u_setting2; // float intensity = 0.5; // suitable range = 0.0 - 1.0
|
||||
uniform vec4 u_setting;
|
||||
|
||||
void main()
|
||||
{
|
||||
float pos0 = ((v_texcoord0.y + 1.0) * 170.0*u_setting1);
|
||||
float pos1 = cos((fract( pos0 ) - 0.5)*3.1415926*u_setting2)*1.5;
|
||||
float pos0 = ((v_texcoord0.y + 1.0) * 170.0*u_setting.x);
|
||||
float pos1 = cos((fract( pos0 ) - 0.5)*3.1415926*u_setting.y)*1.5;
|
||||
vec4 rgb = texture2D( sampler0, v_texcoord0 );
|
||||
|
||||
// slight contrast curve
|
||||
|
|
|
@ -8,12 +8,12 @@ precision mediump int;
|
|||
uniform sampler2D sampler0;
|
||||
varying vec2 v_texcoord0;
|
||||
|
||||
uniform float u_setting1; float amount = 1.5;
|
||||
uniform vec4 u_setting;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 color = texture2D(sampler0, v_texcoord0.xy).xyz;
|
||||
color -= texture2D(sampler0, v_texcoord0.xy+0.0001).xyz*7.0*u_setting1;
|
||||
color += texture2D(sampler0, v_texcoord0.xy-0.0001).xyz*7.0*u_setting1;
|
||||
color -= texture2D(sampler0, v_texcoord0.xy+0.0001).xyz*7.0*u_setting.x;
|
||||
color += texture2D(sampler0, v_texcoord0.xy-0.0001).xyz*7.0*u_setting.x;
|
||||
gl_FragColor.rgb = color;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue