PBR in OpenMW on reddit

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

PBR in OpenMW on reddit

Post 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?
User avatar
AnyOldName3
Posts: 2667
Joined: 26 Nov 2015, 03:25

Re: PBR in OpenMW on reddit

Post 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.
User avatar
raevol
Posts: 3093
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: PBR in OpenMW on reddit

Post 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.
User avatar
psi29a
Posts: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: PBR in OpenMW on reddit

Post 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.
User avatar
AnyOldName3
Posts: 2667
Joined: 26 Nov 2015, 03:25

Re: PBR in OpenMW on reddit

Post 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.
User avatar
Mistahtokyo
Posts: 139
Joined: 07 Sep 2013, 18:31

Re: PBR in OpenMW on reddit

Post 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.
User avatar
AnyOldName3
Posts: 2667
Joined: 26 Nov 2015, 03:25

Re: PBR in OpenMW on reddit

Post 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.
User avatar
AnyOldName3
Posts: 2667
Joined: 26 Nov 2015, 03:25

Re: PBR in OpenMW on reddit

Post by AnyOldName3 »

Also, if we ever resuscitate the MOAR project, we can make PBR-friendly materials a requirement for everything submitted to that.
Sagacity
Posts: 31
Joined: 05 Mar 2019, 12:58

Re: PBR in OpenMW on reddit

Post 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?
Post Reply