Page 1 of 2

PBR in OpenMW on reddit

Posted: 12 Sep 2019, 19:34
by Ravenwing
Don’t want this to turn into a rehash of things we’ve discussed at length before, but saw this on reddit and didn’t immediately find any mention here or on discord.

Is this something we have someone actively working on now?

The lanterns and general darkness show just how much work beyond simple texture replacement would need to be done.

Thoughts?

Re: PBR in OpenMW on reddit

Posted: 12 Sep 2019, 20:08
by AnyOldName3
The things stopping PBR existing in OpenMW right now are pretty much all because the game data isn't compatible:
  • The game's materials don't specify the things that PBR shaders take as input. In the video, it looks like they're just pretending old-style diffuse is equivalent to PBR diffuse or albedo and old-style specular power is equivalent to PBR glossiness or (1 - roughness), so things don't look right. This can be fixed one object at a time by making PBR-friendly textures for it.
  • Morrowind does gamma-space lighting (but actually just pretends gamma-space is linear space), which is disgusting and is stopping other improvements we could be making, too. This means that light attenuation needs to work differently and textures need to be different brightnesses to how the things they represent look in real life, and Morrowind's data and assets are set up with this in mind (or more likely, they decided things looked weird and experimented until they didn't). The video being really dark except in bright areas suggests to me that it's doing linear-space lighting and then not converting it to gamma-space. While actual gamma correction of the rendered image is trivial, sorting this out so the result looks right is a huge clusterfuck and potentially requires all textures, materials and lights to be adjusted, as anything automatic is going to change the look of different things in different ways.

Re: PBR in OpenMW on reddit

Posted: 13 Sep 2019, 04:38
by raevol
Video looks awesome though!

The author may not speak english and that may be why they're not posting here? Reddit comments indicates the reddit OP is not the author but knows them.

Re: PBR in OpenMW on reddit

Posted: 13 Sep 2019, 07:56
by TheOneWhoWatches

Re: PBR in OpenMW on reddit

Posted: 13 Sep 2019, 11:47
by psi29a
It looks to be a pet project that is doing multiple things at once:
* modifying OSG to support PBR (stated in their twitter)
* using a neural network to 'guess' about how to handle the default vanilla textures on-the-fly.

So it looks like the vanilla textures are first processed to create the necessary PBR bits that need to be added. This is a brute forced method and error-prone, as indicated from his previous videos he posted. This bit is experimental.

Whatever the results (good or bad), is then fed into his OSG PBR work.

So even take into account that his PBR OSG work becomes public (LGPL), the patches come into OSG itself or we pull into our own fork. The assets themselves (textures) as-is won't work, they need to be either replaced or some sort of pre-processing has to be done like what the author is doing.

Re: PBR in OpenMW on reddit

Posted: 13 Sep 2019, 14:24
by AnyOldName3
There's nothing in OSG that stops it from being PBR-friendly as-is. Things like osg::Material with capture fixed-function state obviously aren't going to work, but there's no fixed-function state for PBR anyway, so it's not like modifying it would get you anywhere. It'd just be a case of OpenMW setting the uniforms and shaders each thing needs for PBR, and it's not OSG's job to do that for us. We already do it ourselves to give our shaders access to some of the fixed-function state that isn't an auto-generated uniform in old GLSL versions.

Re: PBR in OpenMW on reddit

Posted: 13 Sep 2019, 16:59
by Mistahtokyo
I mean that first point is irrelevant imo. If asset limitations prevent engine limitations, which in turn prevent modern assets, then you'll be sticking OpenMW into a stuck chicken and egg situation. At some point to get the looks people just have to dive in and deal with visual oddities while the assets are upgraded.

Re: PBR in OpenMW on reddit

Posted: 13 Sep 2019, 17:46
by AnyOldName3
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.

Re: PBR in OpenMW on reddit

Posted: 13 Sep 2019, 17:47
by AnyOldName3
Also, if we ever resuscitate the MOAR project, we can make PBR-friendly materials a requirement for everything submitted to that.

Re: PBR in OpenMW on reddit

Posted: 17 Sep 2019, 14:27
by Sagacity
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?