1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-25 22:09:35 +00:00

Remove texture.forceBilinear option.

Add texture.bilinearMode option:
- standard hardware bilinear filter
- N64 3 point filter
This commit is contained in:
Sergey Lipskiy 2015-03-06 12:20:25 +06:00
parent cd3a1b3d4d
commit 4bea76d962
8 changed files with 68 additions and 21 deletions

View File

@ -5,7 +5,11 @@
#include "Types.h"
#define CONFIG_VERSION_ONE 1U
#define CONFIG_VERSION_CURRENT CONFIG_VERSION_ONE
#define CONFIG_VERSION_TWO 2U
#define CONFIG_VERSION_CURRENT CONFIG_VERSION_TWO
#define BILINEAR_3POINT 0
#define BILINEAR_STANDARD 1
const u32 gc_uMegabyte = 1024U * 1024U;
@ -26,7 +30,7 @@ struct Config
{
u32 maxAnisotropy;
f32 maxAnisotropyF;
u32 forceBilinear;
u32 bilinearMode;
u32 maxBytes;
u32 screenShotFormat;
} texture;
@ -96,7 +100,7 @@ struct Config
video.verticalSync = 0;
texture.maxAnisotropy = 0;
texture.forceBilinear = 0;
texture.bilinearMode = BILINEAR_STANDARD;
texture.maxBytes = 500 * gc_uMegabyte;
texture.screenShotFormat = 0;

View File

@ -873,7 +873,7 @@ void ShaderCombiner::updateColors(bool _bForce)
void ShaderCombiner::updateTextureInfo(bool _bForce) {
_setIUniform(m_uniforms.uTexturePersp, gDP.otherMode.texturePersp, _bForce);
_setIUniform(m_uniforms.uTextureFilterMode, config.texture.forceBilinear == 0 ? gDP.otherMode.textureFilter | (gSP.objRendermode&G_OBJRM_BILERP) : 0, _bForce);
_setIUniform(m_uniforms.uTextureFilterMode, config.texture.bilinearMode == BILINEAR_3POINT ? gDP.otherMode.textureFilter | (gSP.objRendermode&G_OBJRM_BILERP) : 0, _bForce);
_setFV2Uniform(m_uniforms.uTexScale, gSP.texture.scales, gSP.texture.scalet, _bForce);
int nFB0 = 0, nFB1 = 0;
TextureCache & cache = textureCache();

View File

@ -34,7 +34,7 @@ void loadSettings()
settings.beginGroup("texture");
config.texture.maxAnisotropy = settings.value("maxAnisotropy", 0).toInt();
config.texture.forceBilinear = settings.value("forceBilinear", 0).toInt();
config.texture.bilinearMode = settings.value("bilinearMode", BILINEAR_STANDARD).toInt();
config.texture.maxBytes = settings.value("maxBytes", 500 * gc_uMegabyte).toInt();
config.texture.screenShotFormat = settings.value("screenShotFormat", 0).toInt();
settings.endGroup();
@ -116,7 +116,7 @@ void writeSettings()
settings.beginGroup("texture");
settings.setValue("maxAnisotropy", config.texture.maxAnisotropy);
settings.setValue("forceBilinear", config.texture.forceBilinear);
settings.setValue("bilinearMode", config.texture.bilinearMode);
settings.setValue("maxBytes", config.texture.maxBytes);
settings.setValue("screenShotFormat", config.texture.screenShotFormat);
settings.endGroup();

View File

@ -84,9 +84,17 @@ void ConfigDialog::_init()
ui->aliasingSlider->setValue(config.video.multisampling);
ui->anisotropicSlider->setValue(config.texture.maxAnisotropy);
ui->forceBilinearCheckBox->setChecked(config.texture.forceBilinear != 0);
ui->cacheSizeSpinBox->setValue(config.texture.maxBytes / gc_uMegabyte);
switch (config.texture.bilinearMode) {
case BILINEAR_3POINT:
ui->blnr3PointRadioButton->setChecked(true);
break;
case BILINEAR_STANDARD:
ui->blnrStandardRadioButton->setChecked(true);
break;
}
switch (config.texture.screenShotFormat) {
case 0:
ui->bmpRadioButton->setChecked(true);
@ -207,9 +215,13 @@ void ConfigDialog::accept()
config.video.multisampling = ui->aliasingSlider->value();
config.texture.maxAnisotropy = ui->anisotropicSlider->value();
config.texture.forceBilinear = ui->forceBilinearCheckBox->isChecked();
config.texture.maxBytes = ui->cacheSizeSpinBox->value() * gc_uMegabyte;
if (ui->blnrStandardRadioButton->isChecked())
config.texture.bilinearMode = BILINEAR_STANDARD;
else if (ui->blnr3PointRadioButton->isChecked())
config.texture.bilinearMode = BILINEAR_3POINT;
if (ui->bmpRadioButton->isChecked())
config.texture.screenShotFormat = 0;
else if (ui->jpegRadioButton->isChecked())

View File

@ -326,14 +326,44 @@
</layout>
</item>
<item>
<widget class="QCheckBox" name="forceBilinearCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Bilinear filtering:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Off - filter exactly how the N64 specifies.&lt;br/&gt;On - apply bilinear filtering to all textures to make them appear more smooth.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;off&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Force texture bilinear filtering</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_13">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Bilinear filtering:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;[standard] - standard texture filtering provided by PC hardware.&lt;/p&gt;&lt;p&gt;[N64 3point]- emulation of 3 point texture filtering used by the original hardware. Provides less smooth but more authentic look.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Texture bilinear filtering:</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="blnrStandardRadioButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Bilinear filtering:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;[standard] - standard texture filtering provided by PC hardware.&lt;/p&gt;&lt;p&gt;[N64 3point]- emulation of 3 point texture filtering used by the original hardware. Provides less smooth but more authentic look.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>standard</string>
</property>
<attribute name="buttonGroup">
<string notr="true">bilinearButtonGroup</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="blnr3PointRadioButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Bilinear filtering:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;[standard] - standard texture filtering provided by PC hardware.&lt;/p&gt;&lt;p&gt;[N64 3point]- emulation of 3 point texture filtering used by the original hardware. Provides less smooth but more authentic look.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>N64 3point</string>
</property>
<attribute name="buttonGroup">
<string notr="true">bilinearButtonGroup</string>
</attribute>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
@ -1295,7 +1325,8 @@
</connections>
<buttongroups>
<buttongroup name="screenshotButtonGroup"/>
<buttongroup name="aspectButtonGroup"/>
<buttongroup name="bloomBlendModeButtonGroup"/>
<buttongroup name="aspectButtonGroup"/>
<buttongroup name="bilinearButtonGroup"/>
</buttongroups>
</ui>

View File

@ -1154,7 +1154,7 @@ void OGLRender::drawTexturedRect(const TexturedRectParams & _params)
texST[1].t1 *= cache.current[1]->scaleT;
}
if ((gDP.otherMode.cycleType == G_CYC_COPY) && !config.texture.forceBilinear) {
if (gDP.otherMode.cycleType == G_CYC_COPY) {
glActiveTexture( GL_TEXTURE0 );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );

View File

@ -1048,7 +1048,7 @@ void TextureCache::activateTexture(u32 _t, CachedTexture *_pTexture)
glBindTexture( GL_TEXTURE_2D, _pTexture->glName );
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, _pTexture->max_level);
if (config.texture.forceBilinear != 0) {
if (config.texture.bilinearMode == BILINEAR_STANDARD && (gDP.otherMode.textureFilter | (gSP.objRendermode&G_OBJRM_BILERP)) != 0) {
if (_pTexture->max_level > 0)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
else

View File

@ -48,7 +48,7 @@ bool Config_SetDefault()
assert(res == M64ERR_SUCCESS);
//#Texture Settings
res = ConfigSetDefaultBool(g_configVideoGliden64, "ForceBilinear", 0, "Force bilinear texture filter");
res = ConfigSetDefaultBool(g_configVideoGliden64, "bilinearMode", 0, "Bilinear filtering mode (0=N64 3point, 1=standard)");
assert(res == M64ERR_SUCCESS);
res = ConfigSetDefaultBool(g_configVideoGliden64, "MaxAnisotropy", 0, "Max level of Anisotropic Filtering, 0 for off");
assert(res == M64ERR_SUCCESS);
@ -144,7 +144,7 @@ void Config_LoadConfig()
config.frameBufferEmulation.aspect = ConfigGetParamInt(g_configVideoGliden64, "AspectRatio");
//#Texture Settings
config.texture.forceBilinear = ConfigGetParamBool(g_configVideoGliden64, "ForceBilinear");
config.texture.bilinearMode = ConfigGetParamBool(g_configVideoGliden64, "bilinearMode");
config.texture.maxAnisotropy = ConfigGetParamInt(g_configVideoGliden64, "MaxAnisotropy");
config.texture.maxBytes = ConfigGetParamInt(g_configVideoGliden64, "CacheSize") * uMegabyte;
//#Emulation Settings