Replies: 1 comment
-
Just going to leave this here as an additional reference: https://github.com/Hirato/lamiae/wiki/Textures It's kind of old in various ways, and doesn't cover texcmds i.e. prefixing your texture with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Texturing in Red Eclipse and its Tesseract engine does more than apply images to surfaces. The game relies on several visual tricks to cheaply simulate real texture depth and albedo (shininess) which are best used when well understood. The game already provides sensible defaults to these textures, but they are not optimal in all circumstances.
Shader Overview
Diffuse mapping (
stdworld
)This is the standard color image of the texture, and what the texture browser displays in its tiles. All other shaders also implicity present the diffuse map.
Normal mapping (
bumpworld
)This is mapping the surface normals (the actual orientation of the surfaces) and calculating how the diffuse map's irradiated light changes because of the orientation of the texture (regions pointing away from you are going to have less area to shine light at you)
Specular highlights (
specworld
)This creates a specular reflection (where the surface reflects light sources like a mirror) over the entire surface uniformly. The specular reflection borrows none of its color from the underlying texture, and all of it from the light it originally came from.
Specular mapping (
specmapworld
)This maps out certain areas of the texture to have more specular reflection than others: some parts of a texture, e.g. metal parts or areas worn smooth, are going to specularly reflect more than other parts of a texture.
A specular map is a single channel grayscale file encoding how reflective an area is for all locations on the surface.
Parallax mapping (
bumpparallaxworld
)*Parallax mapping changes how visible parts of the texture are depending on the observers' position relative to them. This is different than normal mapping in that normal mapping merely reduces the intensity of light from regions facing away from you, while parallax mapping reduces its visible size. Together, parallax and normal mapping can create a fairly convincing substitute for actual geometry, though both have visible issues in their approximations at shallow angles.
A parallax map (also called a heightmap, as it encodes vertical position) is a single channel, which can be either its own grayscale file or the alpha channel of the normal map.
Note how the size of the dark regions changes depending on the observer's viewpoint.
Triplanar mapping (
triplanarworld
)Triplanar mapping involves mapping the texture from three directions (x,y,z) rather than one and using the information from those three orientations to allow the texture to be mapped accurately at any orientation (rather than having significant error at any orientation other than that of the cube face it occupies). This is most useful for patching seams in compound curvature where no patching of the seam with
voffset
orvrotate
is possible.Because triplanar mapping is fairly expensive, it is not recommended to be used unless it is visibly needed.
Note that the left cube has a seam running down the middle while the triplanar'd right cube does not.
Triplanar detail mapping (
triplanardetailworld
)While standard triplanar mapping is useful for blending a texture with itself, blending a texture with another according to angle is possibly useful (maybe???) to smoothly transition without blendmaps.
The most plausible use case for
triplanardetailworld
would be to blend three textures together on rough terrain, using the two textures for triplanar detail mapping and laying a blendmap over the top of it for the third. Otherwise, just using blendmap is preferable unless under some very strict map size restrictions or consistency of the blend with respect to angle is critical.To add the triplanar detail shader to a texture, setting the shader to
triplanardetail*world
and declaring any normal/spec/etc. maps should be done as usual.The vslot to be blended should then be declared using
texdetail <vslot>
along with other texture commands (e.g.texscale
) at the end.Glow mapping (
glowworld
)Glow mapping makes certain of the textures always be lit. This is typical for lights fixtures and computer equipment textures as well as other objects which are always lit.
The glow map is an intensity map of the areas for the engine to glow. It can be given in full RGB color for colored glow effects.
Note how the light itself in the texture is lit, but the surrounding frame for the light is not, since it is not in the glow map for the texture.
Using Shaders Ingame
Shader parameters can be changed with the
vshaderparam
command, which has an index in the REEE for easy reference. Note that only one shader can be modified with this command; extensive modifications need to be done in the configuration file.Note that if you are setting the scale of a shader to 0 with
vshaderparam
you are not disabling it; physically removing the shader from the config file is the only way to get your lost performance back. This means that e.g.vshaderparam specscale 0 0 0
is not recommended as it leaves performance on the table.vshaderparam
has the following modifications available:Configuring Shaders
The shaders applied to the currently selected texture are included in the texture stats HUD element, and understanding when and how to change these to better suit your map is important. While the default shaders for most textures are sensible and useful, having the power to change them to help work around specific map issues or provide specific effects is a powerful tool in creating a realistic map.
Maps have their texture list saved in their configuration file, with the textures taking up the entries above the decals, mapmodels, and sounds. They will always be formatted in this way:
The commented number besides the
texture 0 ...
line is the index in the file (in this case, it's the 43rd texture in the list). It will automatically reset itself once the map is saved, so don't bother messing with it.The correct order for the
setshader
argument is listed inconfig/glsl/world.cfg
where the aliases are defined. However, this format is fairly readable and understandable: this texture here has normals (bumps), specmaps, parallax, and glow enabled on top of the normal diffuse. This means that maps for all of these are required, which are listed below, in thetexture ...
entries.The environment and specular shaders alone do not have maps; however,
specmapenvworld
does require a specular map, as does all otherspecmap
shaders.Additionally,
texscale
, which is just thevscale
of the texture, is applied at the end to scale the texture properly. This can be changed without issue ingame so it is advised to leave it (and no, changing this won't grant you smallervscale
values than .125 nor larger than 8)Typical reasons to change default shaders
Beta Was this translation helpful? Give feedback.
All reactions