Texturing Concepts

Questions specific to OpenMW-CS can be asked, and content development related topics can be discussed here
Post Reply
User avatar
Ravenwing
Posts: 335
Joined: 02 Jan 2016, 02:51

Texturing Concepts

Post by Ravenwing »

Hey all, based on some conversations I've been having on Discord, wanted to make sure I understood some of the basic concepts to make sure we're all on the same page. Thought it would be easier here so there's a record that other people (and me when I forget) can look up.

Why? I've been trying to teach myself how to use Substance Designer in an effort to start texture modding and more specifically learn the PBR workflow.

List of definitions as I understand them:
  • Diffuse maps - RGB map of the color of the texture.
  • Specular maps - A map of how shiny a texture is. Can be greyscale or RGBA, but in OpenMW it's greyscale and stored in the diffuse map alpha channel.
  • Normal maps - RGB map of angles, suitable only for small scale details because no height information is actually stored.
  • Height maps - greyscale map of height information, can be used for large and small details. Same as bump maps and displacement maps (I've read conflicting info on these and they all seem to come down to the same thing).
  • Parallax mapping - a shader technique that interprets height maps by faking depth within the mesh.
  • Tessellation - a different shader technique that interprets height maps by actually adjusting the surface of the mesh.
OpenMW uses parallax mapping instead of tessellation and can use either normal maps or normal maps with height maps (in the alpha channel).

I have several questions about all of this, so bear with me. I'd appreciate as much detail as possible and links to reading material is welcome as long as a relative beginner can understand most of it.
  1. Why do we use parallax mapping over tessellation? It seems like the added realism would be better.
  2. Is there an actual difference between tessellation height mapped detail and higher detail meshes besides the fact that height maps can be turned off at greater distances via LOD?
  3. Since height maps are greyscale, how is the range of values normalized in OpenMW? I.e. is there a value that modders should know about that will allow us to accurately view the height while designing the texture?
  4. Why do we combine height in with the normal maps in our texture rather than having them separate in a 3 channel file and a 1 channel file? Is the mere fact of having multiple maps open more resource intensive, because it seems like the actual size difference would be the same.
  5. In experimenting with Project Atlas, the batch files require all maps to be of the same type. Would there be a downfall to having a map with just normals also have an empty alpha channel, apart from slightly larger file size? Wouldn't the compression make this negligible for the un-atlased textures as it would all be one color and still be worth it for the atlased versions.
  6. Do we have any ambient occlusion maps? Or do we just bake that into the diffuse map?
  7. Do we have glow maps or any other kind of map available to us?
  8. Are there any .dds compression formats that OpenMW can't read?
  9. Are there any alternatives to .dds that are similar in performance?
  10. I know PBR rendering is very much a post-1.0 task, but if it's ever to become a thing, we'll have to figure out some way of transitioning. Remaking every. single. texture. is going to be quite the task, and people may not want to switch over anyway. Is there a way to allow both at the same time?
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: Texturing Concepts

Post by AnyOldName3 »

  1. Parallax mapping runs much faster than tesselation on a lot of hardware. It's also easier to apply to badly-made meshes, which Bethesda are great at producing.
  2. In an ideal system, tessellation is used to take a 'template' mesh and produce a new mesh which has an appropriate level of detail for the current situation (e.g. so there's one triangle per pixel, or triangles average out to cover four pixels each, or no triangle has a slope of more than 5° relative to its neighbours). Any handmade mesh is going to hit a limit at some point, even if it's so detailed that you could never hope to use it in real life. That said, it's rare to make a tessellated mesh keep getting more detailed as you zoom in as once you've included all the detail in your heightmap, there's no more you can add. In real life, the artists will create a high-quality mesh, then simplify it and put the difference in a heightmap. This is smaller than the original mesh, so is easier to distribute, and can be used to reconstruct the original mesh if needed, or anything in between.
  3. I don't know this one. It might be something like a one Morrowind unit range or it might not.
  4. Single-channel compressed textures are a pretty new thing. Also, a lot of GPUs treat textures without four channels as if they had four channels, so you're potentially doubling VRAM usage and lowering performance by using multiple textures. Also, Morrowind already gets close to the maximum number of textures old versions of OpenGL like to use, so adding more is to be avoided.
  5. Having a pure white or pure black height channel should produce what the parallax system sees as a flat surface, so that should be fine. One thing to bear in mind is that certain DDS formats with alpha channels achieve it by sacrificing colour channel detail, so you might find that you lose some quality. You should look into the different types to determine this.
  6. Right now, it should be baked into the diffuse. If you're redoing things, though, maybe keep a version where things are separate in case things change.
  7. If vanilla Morrowind supported it, it can be done (although one type is definitely done badly as either very few things or nothing actually used it so we have no test data).
  8. Whether or not it can do the DirectX 10 formats (BC4-7) might be dependent on your GPU driver or might be dependent on OSG's support. If it's the latter, it can't do them.
  9. There are some similar things from Kronos and some are more widely supported than others. I don't know if OSG (and therefore OpenMW) has any support for any of these.
  10. There'll probably be a way to allow both at the same time.
User avatar
lysol
Posts: 1513
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Texturing Concepts

Post by lysol »

Ravenwing wrote: 10 Feb 2019, 07:02
  • Specular maps - A map of how shiny a texture is. Can be greyscale or RGBA, but in OpenMW it's greyscale and stored in the diffuse map alpha channel.
Hmm, a bit of a mixup here. OpenMW uses RGBA specular maps. The alpha channel in a diffuse map defines transparency, so if you put a greyscale specular map into the alpha channel of a diffuse map, you'd get very... wierd looking stuff. ;)
User avatar
Capostrophic
Posts: 794
Joined: 22 Feb 2016, 20:32

Re: Texturing Concepts

Post by Capostrophic »

6. Right now, it should be baked into the diffuse. If you're redoing things, though, maybe keep a version where things are separate in case things change.
7. If vanilla Morrowind supported it, it can be done (although one type is definitely done badly as either very few things or nothing actually used it so we have no test data).
9. There are some similar things from Kronos and some are more widely supported than others. I don't know if OSG (and therefore OpenMW) has any support for any of these.
To clarify:
"Ambient occlusion" maps technically exist in the form of detail and dark maps, like in Morrowind. This is how they are used in On The Rocks mod.

Glow (emissive) maps have already been a thing for a while in both Morrowind and OpenMW. This is how Windows Glow-like mods work. Out of Morrowind's assortment, detail, dark, decal, emissive and spherical environment are directly compatible while gloss and bump maps are not.

KTX is the "main" alternative to DDS.
User avatar
Ravenwing
Posts: 335
Joined: 02 Jan 2016, 02:51

Re: Texturing Concepts

Post by Ravenwing »

Thank you all for the clarifications! They are extremely helpful. I was going to respond to each thing but takes too long, so I'll try and limit what I'm asking for clarification on.
AnyOldName3 wrote: 11 Feb 2019, 00:51 3. I don't know this one. It might be something like a one Morrowind unit range or it might not.
If anyone knows or can find an answer to this it would be super handy reference material. Would prefer to not have to make a million adjustments and keep checking in-game, but I suppose it only would need to be figured out once.
AnyOldName3 wrote: 11 Feb 2019, 00:51 Single-channel compressed textures are a pretty new thing. Also, a lot of GPUs treat textures without four channels as if they had four channels, so you're potentially doubling VRAM usage and lowering performance by using multiple textures. Also, Morrowind already gets close to the maximum number of textures old versions of OpenGL like to use, so adding more is to be avoided.
That. is. CRAZY. I'm sure there's a good reason, but weird that it would be like that from an outside view. I was worried about the different PBR channels but I guess those would mostly be baked into a single file anyway. Good thing about metallness is it's basically either on or off, so the DDS compression that only allows two states for alpha should be perfect.
AnyOldName3 wrote: 11 Feb 2019, 00:51 Having a pure white or pure black height channel should produce what the parallax system sees as a flat surface, so that should be fine. One thing to bear in mind is that certain DDS formats with alpha channels achieve it by sacrificing colour channel detail, so you might find that you lose some quality. You should look into the different types to determine this.
Hmm, I'll look into this and post what I find. @lysol, this is what you'll have to do for your textures I think to use the Project Atlas .bat so it stitches things correctly. Probably best to release two versions, one for vanilla, and one for PA.
AnyOldName3 wrote: 11 Feb 2019, 00:51 10. There'll probably be a way to allow both at the same time.
Any idea what workflow we'd prefer? I tend to think in metalness because I'm a materials engineer, but would like to get into the other headspace well in advance of any actual support so I can start working on things ahead of time.
lysol wrote: 11 Feb 2019, 05:49 Hmm, a bit of a mixup here. OpenMW uses RGBA specular maps. The alpha channel in a diffuse map defines transparency, so if you put a greyscale specular map into the alpha channel of a diffuse map, you'd get very... wierd looking stuff.
Thank you! I think I must have read our terrain texture wiki page and thought it was universal. Apparently we do it differently for terrain and standard textures. (Does this seem needlessly confusing? Is this just what Vanilla did?
Capostrophic wrote: 11 Feb 2019, 12:59 "Ambient occlusion" maps technically exist in the form of detail and dark maps, like in Morrowind. This is how they are used in On The Rocks mod.
I mean, doesn't AO not really have a meaning in a system that didn't even have normal maps or shadows? In a more rigorous system they should be telling the shader to not apply as much light with those kinds of effects right?
Capostrophic wrote: 11 Feb 2019, 12:59 Glow (emissive) maps have already been a thing for a while in both Morrowind and OpenMW. This is how Windows Glow-like mods work. Out of Morrowind's assortment, detail, dark, decal, emissive and spherical environment are directly compatible while gloss and bump maps are not.
Really?!? I've never even heard of most of these. What objects use these so I know what to think of? Is there a list somewhere of these, would like to look into them more.
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: Texturing Concepts

Post by AnyOldName3 »

Any idea what workflow we'd prefer? I tend to think in metalness because I'm a materials engineer, but would like to get into the other headspace well in advance of any actual support so I can start working on things ahead of time.
Metalness is good for things which work with metalness, but not everything does, so we'll definitely have to support non-metalness. It's not much extra work to support metalness, and either way, metalness can be baked into anything else, so if you're making stuff, metalness is fine (until you hit skin or gemstones or something else non-metal with a non-0.03 IOR).
Good thing about metallness is it's basically either on or off, so the DDS compression that only allows two states for alpha should be perfect.
50% metalness is a meaningful value - it means that over the region the current texel represents, half of the surface is metallic and half isn't. This might not be much of a concern with detailed textures, but their mipmaps will definitely have regions where one texel covers some metal and dielectric.
Post Reply