PBR in OpenMW on reddit

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

PBR in OpenMW on reddit

Post by Ravenwing » 12 Sep 2019, 19:34

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?

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

Re: PBR in OpenMW on reddit

Post by AnyOldName3 » 12 Sep 2019, 20:08

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.
AnyOldName3, Master of Shadows

User avatar
raevol
Posts: 3014
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: PBR in OpenMW on reddit

Post by raevol » 13 Sep 2019, 04:38

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.


User avatar
psi29a
Posts: 4629
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: PBR in OpenMW on reddit

Post by psi29a » 13 Sep 2019, 11:47

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.

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

Re: PBR in OpenMW on reddit

Post by AnyOldName3 » 13 Sep 2019, 14:24

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.
AnyOldName3, Master of Shadows

User avatar
Mistahtokyo
Posts: 119
Joined: 07 Sep 2013, 18:31

Re: PBR in OpenMW on reddit

Post by Mistahtokyo » 13 Sep 2019, 16:59

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.

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

Re: PBR in OpenMW on reddit

Post by AnyOldName3 » 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.
AnyOldName3, Master of Shadows

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

Re: PBR in OpenMW on reddit

Post by AnyOldName3 » 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.
AnyOldName3, Master of Shadows

Sagacity
Posts: 19
Joined: 05 Mar 2019, 12:58

Re: PBR in OpenMW on reddit

Post by Sagacity » 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?

Post Reply