From: Rudolf Polzer Date: Fri, 6 Aug 2010 12:07:11 +0000 (+0200) Subject: texture compression: add a checkbox for the new cvars X-Git-Tag: xonotic-v0.1.0preview~266^2~9^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d5a02affa909e5af00489a1400d663a9428925dc;p=xonotic%2Fxonotic-data.pk3dir.git texture compression: add a checkbox for the new cvars --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index c40da7257..b8cb1d689 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -848,6 +848,10 @@ set g_deathglow 1.25 "when enabled, players stop glowing after they die (the val // effects r_picmipsprites 0 // Xonotic uses sprites that should never be picmipped (team mate, typing, waypoints) +r_picmipworld 1 +gl_picmip_world 0 +gl_picmip_sprites 0 +gl_picmip_other 2 // so, picmip -2 is best possible quality r_mipsprites 1 r_mipskins 1 r_shadow_realtime_world_lightmaps 1 diff --git a/effects-high.cfg b/effects-high.cfg index 676e958df..7b7358cd9 100644 --- a/effects-high.cfg +++ b/effects-high.cfg @@ -2,7 +2,7 @@ cl_decals 1 cl_decals_time 4 cl_particles_quality 1 gl_flashblend 0 -gl_picmip 1 +gl_picmip -1 gl_texture_anisotropy 16 mod_q3bsp_nolightmaps 0 r_bloom 1 @@ -16,7 +16,6 @@ r_glsl_offsetmapping 1 r_glsl_offsetmapping_reliefmapping 0 r_hdr 0 r_motionblur 0.5 -r_picmipworld 0 r_shadow_gloss 1 r_shadow_realtime_dlight 1 r_shadow_realtime_dlight_shadows 0 @@ -26,6 +25,7 @@ r_shadow_shadowmapping 0 r_shadow_usenormalmap 1 r_showsurfaces 0 r_subdivisions_tolerance 3 +r_texture_dds_load 1 r_water 1 r_water_resolutionmultiplier 0.5 vid_samples 2 diff --git a/effects-low.cfg b/effects-low.cfg index 82da91797..79d56951f 100644 --- a/effects-low.cfg +++ b/effects-low.cfg @@ -2,7 +2,7 @@ cl_decals 1 cl_decals_time 2 cl_particles_quality 0.4 gl_flashblend 1 -gl_picmip 2 +gl_picmip 1 gl_texture_anisotropy 1 mod_q3bsp_nolightmaps 1 r_bloom 0 @@ -16,7 +16,6 @@ r_glsl_offsetmapping 0 r_glsl_offsetmapping_reliefmapping 0 r_hdr 0 r_motionblur 0 -r_picmipworld 1 r_shadow_gloss 0 r_shadow_realtime_dlight 0 r_shadow_realtime_dlight_shadows 0 @@ -26,6 +25,7 @@ r_shadow_shadowmapping 0 r_shadow_usenormalmap 0 r_showsurfaces 0 r_subdivisions_tolerance 8 +r_texture_dds_load 1 r_water 0 r_water_resolutionmultiplier 0.5 vid_samples 1 diff --git a/effects-med.cfg b/effects-med.cfg index 9b2a8b38d..0914dac60 100644 --- a/effects-med.cfg +++ b/effects-med.cfg @@ -2,7 +2,7 @@ cl_decals 1 cl_decals_time 2 cl_particles_quality 1 gl_flashblend 0 -gl_picmip 1 +gl_picmip 0 gl_texture_anisotropy 1 mod_q3bsp_nolightmaps 0 r_bloom 0 @@ -16,7 +16,6 @@ r_glsl_offsetmapping 0 r_glsl_offsetmapping_reliefmapping 0 r_hdr 0 r_motionblur 0 -r_picmipworld 0 r_shadow_gloss 0 r_shadow_realtime_dlight 1 r_shadow_realtime_dlight_shadows 0 @@ -26,6 +25,7 @@ r_shadow_shadowmapping 0 r_shadow_usenormalmap 0 r_showsurfaces 0 r_subdivisions_tolerance 4 +r_texture_dds_load 1 r_water 0 r_water_resolutionmultiplier 0.5 vid_samples 1 diff --git a/effects-normal.cfg b/effects-normal.cfg index 7c49b57c6..02796ca30 100644 --- a/effects-normal.cfg +++ b/effects-normal.cfg @@ -2,7 +2,7 @@ cl_decals 1 cl_decals_time 2 cl_particles_quality 1 gl_flashblend 0 -gl_picmip 1 +gl_picmip 0 gl_texture_anisotropy 1 mod_q3bsp_nolightmaps 0 r_bloom 0 @@ -16,7 +16,6 @@ r_glsl_offsetmapping 0 r_glsl_offsetmapping_reliefmapping 0 r_hdr 0 r_motionblur 0 -r_picmipworld 0 r_shadow_gloss 1 r_shadow_realtime_dlight 1 r_shadow_realtime_dlight_shadows 0 @@ -26,6 +25,7 @@ r_shadow_shadowmapping 0 r_shadow_usenormalmap 1 r_showsurfaces 0 r_subdivisions_tolerance 3 +r_texture_dds_load 1 r_water 0 r_water_resolutionmultiplier 0.5 vid_samples 1 diff --git a/effects-omg.cfg b/effects-omg.cfg index 8bae286c3..cf105ba2b 100644 --- a/effects-omg.cfg +++ b/effects-omg.cfg @@ -16,7 +16,6 @@ r_glsl_offsetmapping 0 r_glsl_offsetmapping_reliefmapping 0 r_hdr 0 r_motionblur 0 -r_picmipworld 1 r_shadow_gloss 0 r_shadow_realtime_dlight 0 r_shadow_realtime_dlight_shadows 0 @@ -26,6 +25,7 @@ r_shadow_shadowmapping 0 r_shadow_usenormalmap 0 r_showsurfaces 3 r_subdivisions_tolerance 16 +r_texture_dds_load 1 r_water 0 r_water_resolutionmultiplier 0.5 vid_samples 1 diff --git a/effects-ultimate.cfg b/effects-ultimate.cfg index 123600875..f6e002ba6 100644 --- a/effects-ultimate.cfg +++ b/effects-ultimate.cfg @@ -2,7 +2,7 @@ cl_decals 1 cl_decals_time 10 cl_particles_quality 1 gl_flashblend 0 -gl_picmip 0 +gl_picmip -2 gl_texture_anisotropy 16 mod_q3bsp_nolightmaps 0 r_bloom 1 @@ -16,7 +16,6 @@ r_glsl_offsetmapping 1 r_glsl_offsetmapping_reliefmapping 1 r_hdr 2 r_motionblur 0.5 -r_picmipworld 0 r_shadow_gloss 1 r_shadow_realtime_dlight 1 r_shadow_realtime_dlight_shadows 1 @@ -26,6 +25,7 @@ r_shadow_shadowmapping 1 r_shadow_usenormalmap 1 r_showsurfaces 0 r_subdivisions_tolerance 1 +r_texture_dds_load 0 r_water 1 r_water_resolutionmultiplier 1 vid_samples 4 diff --git a/effects-ultra.cfg b/effects-ultra.cfg index 359f03575..e9f7b0cc7 100644 --- a/effects-ultra.cfg +++ b/effects-ultra.cfg @@ -2,7 +2,7 @@ cl_decals 1 cl_decals_time 10 cl_particles_quality 1 gl_flashblend 0 -gl_picmip 0 +gl_picmip -2 gl_texture_anisotropy 16 mod_q3bsp_nolightmaps 0 r_bloom 1 @@ -16,7 +16,6 @@ r_glsl_offsetmapping 1 r_glsl_offsetmapping_reliefmapping 0 r_hdr 0 r_motionblur 0.5 -r_picmipworld 0 r_shadow_gloss 1 r_shadow_realtime_dlight 1 r_shadow_realtime_dlight_shadows 1 @@ -26,6 +25,7 @@ r_shadow_shadowmapping 1 r_shadow_usenormalmap 1 r_showsurfaces 0 r_subdivisions_tolerance 2 +r_texture_dds_load 0 r_water 1 r_water_resolutionmultiplier 0.5 vid_samples 4 diff --git a/qcsrc/menu/gamecommand.qc b/qcsrc/menu/gamecommand.qc index d2ef18766..4b2b9cf0c 100644 --- a/qcsrc/menu/gamecommand.qc +++ b/qcsrc/menu/gamecommand.qc @@ -94,6 +94,12 @@ void GameCommand(string theCommand) return; } + if(argv(0) == "setcompression") + { + updateCompression(); + return; + } + #if 0 if(argv(0) == "tokentest") { diff --git a/qcsrc/menu/xonotic/dialog_settings_effects.c b/qcsrc/menu/xonotic/dialog_settings_effects.c index fcb2b8ccf..9bc68e435 100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.c +++ b/qcsrc/menu/xonotic/dialog_settings_effects.c @@ -7,6 +7,7 @@ CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab) ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.5) ENDCLASS(XonoticEffectsSettingsTab) entity makeXonoticEffectsSettingsTab(); +float updateCompression(); #endif #ifdef IMPLEMENTATION @@ -29,6 +30,33 @@ float someShadowCvarIsEnabled(entity box) return FALSE; } +float updateCompression() +{ + float have_dds, have_jpg, have_tga; + if((have_dds = (fh = fopen("dds/particles/particlefont.dds", FILE_READ) >= 0))) + fclose(fh); + if((have_jpg = (fh = fopen("jpg/particles/particlefont.jpg", FILE_READ) >= 0))) + fclose(fh); + if((have_tga = (fh = fopen("tga/particles/particlefont.tga", FILE_READ) >= 0))) + fclose(fh); + if(have_dds && (have_jpg || have_tga)) + { + cvar_set("gl_texturecompression", "0"); + return 1; + } + else if(have_dds) + { + cvar_set("gl_texturecompression", "0"); + cvar_set("r_texture_dds_load", "1"); + return 0; + } + else + { + cvar_set("gl_texturecompression", cvar_string("r_texture_dds_load")); + return 2; + } +} + void XonoticEffectsSettingsTab_fill(entity me) { entity e, s; @@ -66,20 +94,35 @@ void XonoticEffectsSettingsTab_fill(entity me) e.configureXonoticTextSliderValues(e); me.TR(me); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Texture quality:")); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Texture resolution:")); me.TD(me, 1, 2, e = makeXonoticTextSlider("gl_picmip")); if(cvar("developer")) e.addValue(e, "Leet", "1337"); - e.addValue(e, "Lowest", "4"); - e.addValue(e, "Low", "3"); - e.addValue(e, "Normal", "2"); - e.addValue(e, "Good", "1"); - e.addValue(e, "Best", "0"); + e.addValue(e, "Lowest", "2"); + e.addValue(e, "Low", "1"); + e.addValue(e, "Normal", "0"); + e.addValue(e, "Good", "-1"); + e.addValue(e, "Best", "-2"); e.configureXonoticTextSliderValues(e); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_picmipworld", "Reduce model texture quality only")); - setDependent(e, "gl_picmip", 0.5, -0.5); + { + // detect texture compression method + float f; + f = updateCompression(); + switch(f) + { + case 0: + break; + case 1: + me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", "Avoid lossy texture compression")); + break; + case 2: + me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", "Avoid lossy texture compression")); + makeMulti(e, "gl_texturecompression"); + break; + } + } me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Anisotropy:")); me.TD(me, 1, 2, e = makeXonoticTextSlider("gl_texture_anisotropy")); diff --git a/qcsrc/menu/xonotic/dialog_settings_video.c b/qcsrc/menu/xonotic/dialog_settings_video.c index dd2f960c7..0aa5e68cc 100644 --- a/qcsrc/menu/xonotic/dialog_settings_video.c +++ b/qcsrc/menu/xonotic/dialog_settings_video.c @@ -41,17 +41,13 @@ void XonoticVideoSettingsTab_fill(entity me) me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Color depth:")); me.TD(me, 1, 2, e = makeXonoticSlider(16, 32, 16, "vid_bitsperpixel")); - me.TR(me); - me.TD(me, 1, 1.5, e = makeXonoticTextLabel(0, "Texture compression")); - me.TD(me, 1, 0.5, e = makeXonoticRadioButton(2, "gl_texturecompression", "0", "None")); - me.TD(me, 1, 0.5, e = makeXonoticRadioButton(2, "gl_texturecompression", "1", "Fast")); - me.TD(me, 1, 0.5, e = makeXonoticRadioButton(2, "gl_texturecompression", "2", "Good")); me.TR(me); me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", "Full screen")); me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "vid_vsync", "Vertical Synchronization")); me.TR(me); me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", "Use OpenGL 2.0 shaders (GLSL)")); + me.TR(me); me.TR(me); me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", "Use Occlusion Queries")); me.TR(me);