Coder Social home page Coder Social logo

Comments (1)

Baker7 avatar Baker7 commented on August 11, 2024

I did this in Zircon Beta #48, however it is ugly. I'll describe the annoying barriers.

wall

So everything that is painful about implementing this in DarkPlaces ...

  1. Cvars like r_nearest_2d and r_nearest_conchars -- gl_texturemode command does not play nice with those, and will want to override them. So if you honor those 2 cvars, you need to do a 2d pass.
  2. Now, gl_texturemode command sort of works and sort of doesn't .. you really need to add the "force" command line parameter for it to affect the map textures. Like mentioned above, it will also affect the 2D draw pics like the menu. DarkPlaces texture flags and how they are set on the textures are not friendly to switching the texturemode.

The short version .. I created an extra cvar -- called _gl_texture_mode that stores a value from 0 to 5 that is the index of the texture filtering "table" .. the default value must be set to the default value of 5 because of this .. (you could default 0 = NEAREST if you change defaults of gl_filter_min, etc.)

Changing cvar _gl_texture_mode will fire off the equivalent of "gl_texturemode" command with FORCE. And then force an update of the 2D pics based on the values of cvars r_nearest_2d and r_nearest_conchars.

(This 2nd update of the 2D pics must be done otherwise gl_texturemode will apply itself to the menu you are using an make it look muddy or not or just "wrong").

qbool	gl_filter_force = false;
int		gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
int		gl_filter_mag = GL_LINEAR;

static glmode_t gl_texture_modes[6] =
{
	{"GL_NEAREST",					GL_NEAREST,					GL_NEAREST},
	{"GL_LINEAR",					GL_LINEAR,					GL_LINEAR},
	{"GL_NEAREST_MIPMAP_NEAREST",	GL_NEAREST_MIPMAP_NEAREST,	GL_NEAREST},
	{"GL_LINEAR_MIPMAP_NEAREST",	GL_LINEAR_MIPMAP_NEAREST,	GL_LINEAR},
	{"GL_NEAREST_MIPMAP_LINEAR",	GL_NEAREST_MIPMAP_LINEAR,	GL_NEAREST},
	{"GL_LINEAR_MIPMAP_LINEAR",		GL_LINEAR_MIPMAP_LINEAR,	GL_LINEAR}
};

End results are great, but you don't really want to see how the "hotdog factory" makes the hotdogs. 😉

Note another secret sauce component ... Zircon does automatic console scale that tries to get vid_conwidth and vid_conheight to be a clean division of vid.width and vid.height to make the text really nice and sharp.

I'm pointing this out because DarkPlaces, the ratio between vid.width and vid_conwidth might be a non-clean division .. making it difficult to use r_nearest_2d and r_nearest_conchars because the text won't look crisp.

Zircon Beta #48: https://www.moddb.com/mods/zircon-engine/downloads/zircon-beta-release-48-win64-binary-source

from darkplaces.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.