OSG shaders

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
User avatar
psi29a
Posts: 4801
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: OSG shaders

Post by psi29a » 18 Feb 2016, 15:53

Just one shader or combination of shaders?

This was a very interesting read:
http://www.marmoset.co/toolbag/learn/pbr-practice
http://www.codinglabs.net/article_physi ... ering.aspx

User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: OSG shaders

Post by scrawl » 20 Feb 2016, 20:07

Managed to dig out PeterBitt's old normal maps from my hard drive, looks nice. If I remember correctly, these were auto-generated with Photoshop.

Image

A feature that was requested before, but never implemented in the Ogre version (due to Ogre's resource queries being too slow), is having the game automatically use normal maps when they have an appropriate file name. This is now implemented. For example, for the color texture foo.dds, the game will automatically use foo_n.dds as a normal map (if it exists). The benefit is that you don't have to go around modifying (and distributing) all the .nif files / mesh files. To use this feature, you'll need to enable the following in settings.cfg:

Code: Select all

auto use terrain normal maps = true
auto use terrain specular maps = true
auto use object normal maps = true 
auto use object specular maps = true
normal map pattern = _n
specular map pattern = _spec
Specular maps are now supported again, but I couldn't find any textures to showcase this.

Terrain shaders are done, also supporting normal maps and specular maps.

All that's left to do is to update the wiki documentation on how to actually use these features.

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

Re: OSG shaders

Post by psi29a » 20 Feb 2016, 20:30

awesome work! :D

under what sections do these settings go? can they by default be on/set instead of having to turn them on?

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

Re: OSG shaders

Post by raevol » 20 Feb 2016, 20:42

Excited to try this!

User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: OSG shaders

Post by scrawl » 21 Feb 2016, 00:34

under what sections do these settings go? can they by default be on/set instead of having to turn them on?
See the wiki that I just wrote:
These settings are not enabled by default, to prevent incompatibilities with mods that may be inadvertently using these naming schemes.

User avatar
ElderTroll
Posts: 499
Joined: 25 Jan 2012, 07:01

Re: OSG shaders

Post by ElderTroll » 21 Feb 2016, 03:54

Great! I saw on the trello board that terrain shaders are done.
“A society grows great when old men plant trees whose shade they know they shall never sit in.”

Chris
Posts: 1575
Joined: 04 Sep 2011, 08:33

Re: OSG shaders

Post by Chris » 21 Feb 2016, 04:54

scrawl wrote:

Code: Select all

auto use terrain normal maps = true
auto use terrain specular maps = true
auto use object normal maps = true 
auto use object specular maps = true
normal map pattern = _n
specular map pattern = _spec
These settings are not enabled by default, to prevent incompatibilities with mods that may be inadvertently using these naming schemes.
Wouldn't it be better to just have one option for automatically using these, if that? As more mods start to make use of auto normal/specular maps, it's unlikely the _n or _spec patterns can really be changed, and having more generic options to control terrain or object normal/specular maps (regardless if it's automatic or defined in the game data) would work just as well.

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

Re: OSG shaders

Post by psi29a » 21 Feb 2016, 08:25

Scrawl, I read this:
Currently shaders have a moderate performance impact, which is to be expected with a hybrid FFP/shader OpenGL2 renderer. Using OpenGL3 features (e.g. UBOs) in place of fixed-function state could mitigate this, but is not in my near future plans. Rather than OpenGL3 it might be a better idea to make the leap to Vulkan instead (which is further off in the future).
In the 'future' will this mean that we can select either in game or in the launcher with which spec to render against?

OpenGL 2
OpenGL 3
Vulkan?

And/or would this be something to be auto-detected for best performance?

CMAugust
Posts: 214
Joined: 10 Jan 2016, 00:13

Re: OSG shaders

Post by CMAugust » 23 Feb 2016, 03:03

scrawl wrote:PBR is just a shader. In theory you should be able to plug it in with a new shader file, there wouldn't be any changes needed to the engine itself.
Now that shaders are implemented, folk like hrndchamd should now have everything they need to bring PBR to OpenMW. :)
I hope there's an interest in doing so, very exciting times ahead.

Post Reply