Skip to content

MV Shaders

aufau edited this page Jun 30, 2016 · 2 revisions

Keywords

JK2MV 1.2 and newer provide few additional shader keywords. In order to not break other JK2 clients please use them only in shader files with .shader_mv extension.

General Keywords

textureMode
Force OpenGL magnifying/minifying mode for this texture. Should be used only in special cases.
uiElement
noMipMaps keyword alias. Disables lighting, picmip and generating mip maps. Use for low resolution UI/2D textures.
uiElementHD
Same as uiElement other than that it generates mip maps. Use for high resolution UI/2D textures so they scale down nicely on smaller screens.

Stage Keywords

glow
Enables dynamic glow for this stage

Shader Overriding

Singular shaders can be reliably overridden according to the following rules:

  1. Shaders found in .shader_mv files always take precedence.
  2. If there are two shaders sharing the same name, one that was found in a file later on JK2 file list (phone book order) takes precedence. For example if there is a shader called gfx/2d/charsgrid_med in both shaders/original.shader and shaders/fonts.shader only the script found in shaders/original.shader will be used then.

Keep in mind this scheme isn't backwards compatible with original JK2 clients.

Custom Mip Maps

For a given texture, it is possible to replace specific mip level with custom image. If your main image is called gfx/2d/my_picture.tga save your custom mip map as gfx/2d/my_picture_mip1.tga etc., down to _mip9 suffix. They don't need to be in mip level order, just make sure there are no gaps in the suffix numbering. It's not advised to distribute full set of pre-generated mipmaps with normal textures as it may actually slow down load times.