Converting MGE shader code to OpenMW format

Everything about development and the OpenMW source code.
Post Reply
zimonov
Posts: 1
Joined: 06 Nov 2017, 03:21

Converting MGE shader code to OpenMW format

Post by zimonov » 06 Nov 2017, 03:47

Hello everyone! I have been following this rebuild for a few years and decided to finally dig into it. I also am Swedish so please pardon my poor English.

So anyway, i decided that my first question shall be one of curiosity. how viable is it to convert shader code from MGEXE to OpenMW? i took a quick look at the water shaders and saw some simillarities between them. so how viable is this to do?

personally i'd love to for an example have Vtastek's water shader in openmw haha
Link to the shader code:
https://pastebin.com/vpdQLNdZ

i understand about post processing shaders like godrays and such. but how about those shaders that already have a basic shader in openMW?

Thanks in advance!

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

Re: Converting MGE shader code to OpenMW format

Post by AnyOldName3 » 06 Nov 2017, 14:22

For a start, this is HLSL code because Morrowind uses DirectX, but OpenMW needs GLSL code because it uses OpenGL. For the most part, converting it should be pretty easy. The next step is to figure out which uniforms and attributes this shader needs, and which, if any, of these have an equivalent in OpenMW's existing water shader. If you tweak the shader so it can access the OpenMW versions of the things they both use, and set the other ones based on something else you can find in the shader or set them as constants, you then just need to drop it in as a replacement for OpenMW's existing water shader.

Before you embark on this, though, are you sure that this shader is actually any better than OpenMW's bundled water shader? It's possible that you've just not turned on the OpenMW one and so are seeing the basic water instead.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests