PBR in OpenMW on reddit

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
User avatar
Ravenwing
Posts: 334
Joined: 02 Jan 2016, 02:51

Re: PBR in OpenMW on reddit

Post by Ravenwing » 17 Sep 2019, 22:00

AnyOldName3 wrote:
13 Sep 2019, 17:46
MGE XE has a PBR prototype, and a few things have been made for it. Once that settles down, it becomes more viable to start making similar changes in OpenMW.
My only concern with this is people expecting PBR assets made for MGE XE to look the same in OpenMW, which is not necessarily the case. I would be afraid of something similar to the whole normal map nonsense happening with PBR. I know that was kind of a special case, but as we've discussed before, just because something is made using PBR workflow doesn't mean it will appear the same in different applications. (Still, weird PBR assets are better than none, and the MGE implementation may be very good, I don't know.)
AnyOldName3 wrote:
13 Sep 2019, 17:47
Also, if we ever resuscitate the MOAR project, we can make PBR-friendly materials a requirement for everything submitted to that.
I've been thinking a lot about this, and I think that this is inevitable. But the more we can guide it, the better the results will be. I have lots of thoughts on this so I think I'll bring them up in another thread. I do think the sooner we restart this the better. Just recently we had someone volunteer to start working on this as they didn't feel comfortable contributing in other ways. It would be nice to at least have guidelines to give people when they pop up and seem interested.

The neural network being used in the linked example is an interesting place to start, but as with so many things, it seems better to simply start from scratch. (He seems to be having fun though, so more power to him)
Sagacity wrote:
17 Sep 2019, 14:27
I'm really confused. I thought we already had a legacy lighting/material treatment system in place, as is used with the various "force $feature" settings. Aren't we already using two different lighting/shading models?
I suspect it's more an issue of maintenance, but that seems like a good point. It may be worth starting on the gamma correct lighting if for no other reason than to start experimenting?

User avatar
AnyOldName3
Posts: 1598
Joined: 26 Nov 2015, 03:25

Re: PBR in OpenMW on reddit

Post by AnyOldName3 » 17 Sep 2019, 22:07

I'm not really worried about PBR assets intended for MGE XE looking wrong in OpenMW. If it's PBR, it'll have the right data to be convertible, and if we don't natively support it, an automatic converter can be made. There are at least two automatic fake-bumpmap-to-normal-map tools floating around, even if no one actually uses them.

Getting gamma-correct lighting in OpenMW should only be like a three-line change. All that needs doing is turning on OpenGL gamma correction and swapping the internal texture formats to their SRGB variants when they're loaded.
AnyOldName3, Master of Shadows

User avatar
Uradamus
Posts: 7
Joined: 03 Jul 2016, 18:10

Re: PBR in OpenMW on reddit

Post by Uradamus » 25 Nov 2019, 14:39

I would love to see a PBR setup in OpenMW, it would certainly get me a lot more interested in modding Morrowind again. It is basically the standard these days, even Blender defaults to a PBR workflow for both Eevee and Cycles now. It isn't that hard to make maps for it manually. Metalness is nearly always a binary thing, pixels should be either black or white. Black when they aren't metal, white when they are metal. It's best to think of it as a switch that's either on or off. Stuff like rust and dirt are not metal, and should be black. You can have a little variation in the near white end of the spectrum, it isn't strictly accurate, but it some times look good to lower the value a bit for older metals, but you want to keep metal stuff above 0.8 (0 is black, 1.0 is white). You will have to make it a point to look up the base color value for the given metal you are working with to use with the albedo, this is probably the least intuitive aspect of all of this for newcomers, but luckily there are really good color charts out there for PBR metal colors.

Albedo is the replacement for diffuse, it is basically just pure material color without any baked in lighting. So the general way to convert existing diffuse maps is to level them out, using like the levels or curve color adjustment tools in your preferred image editor of choice. You just want to get rid of the really dark and light areas of baked in shadows/lights. But you don't have to go crazy with this, most game engines end up allowing to mix in an AO map, which again isn't strictly accurate, but often looks quite good. Just keep in mind the above point about metal color.

Roughness is pretty simple to generate. You can look up the roughness value for a given physical material. A mirror would have a near 0 value, a dry dirty coarse stone would be close to 1.0. So the way I go about it is to take the albedo, convert to grayscale (you may also want to invert it, depending on if you want the lighter or darker areas of the albedo to be shinier). Then open up the levels tool, I leave the top part alone and focus exclusively on the bottom output range (in GIMP). And say I find out the material I am working on says it should be around 0.6 roughness, I would set the lower bounds of the output to say 0.55 or 0.6 and the top end to something like 0.7 or 0.8. That will compress the gray scale values to a range that is a bit below and above the target. This can take some testing to find an ideal output range for a given material, but its fairly reliable and gives pretty good results.

Anything beyond those is mostly optional, and most other supported channels can often be handled with flat values. But a subsurface scattering (SSS) map can be useful for flesh and such. If you want to support some sort of glowing effect, usually emission maps are colored so that black is no emission and the color used is the color of the glow. This can also be done with a simple black and white mask, so black areas again don't glow and white areas use the color of the albedo to decide the glow color. For that to work you would basically mix the albedo and the mask and feed the result into the emission.

Anyhow, I'll wrap this up by saying that PBR support would make the post 1.0 OpenMW a lot more attractive for those considering using the engine for more extensive modding projects, like graphical overhauls, or potentially for all new games.

Post Reply