Jump to content

[1.9.x] Textures Unlimited - PBR-Shader, Texture Set, and Model Loading API


Shadowmage

Recommended Posts

@Manwith Noname

Glad I could help shed some light on the situation a bit. 

I really wish it was as simple as 'just allow for recoloring of existing textures', but as can be seen, there are a lot of technical difficulties to overcome -- the largest of which is the requirement for additional data in order to color things properly while keeping the original texture details.

 

1 hour ago, Manwith Noname said:

My initial concern from reading what the required textures to set this all up need to look like was that you might need to redistribute modified textures of others work.

If using the 'grayscale' mode, then yes, you would need to convert the existing textures and redistribute the modified versions.  This mode was intended for original mod developers, to author the textures in that method right from the start, and really isn't very well suited to stock/mod conversion use. 

If using 'tingting' mode -- well, you are familiar with that setup and all of its pitfalls.  No extra textures needed beyond the masks, but the actual recoloring output is fraught with problems.  I would really prefer to drop this mode entirely -- it is broken by nature, with no real possibility to fix it.

If using the proposed 'mapped' mode -- you would create a -new- texture based on the original texture.  This would be a fairly simple setup -- flat colors, with no details, with the areas for each color lining up to the different areas in the diffuse texture / mask texture.  While it would be loosely 'based on' the original textures, it would be neither a modified version, nor what I would term as a derivative work (though technically, it might qualify as such).

If using the proposed 'hybrid-mapped' mode (using shader color parameter inputs for base colors ) -- you would only need the mask texture, but you would be very limited in the setup -- the textures could contain at most three main colors for any given textureset/mesh.  If the diffuse texture contained more than 3 main colors, at least some of them would end up being recolored incorrectly.

(I'll try and work up some examples/samples of what the 'mapped' mode and 'hybrid-mapped' mode textures + configs would look like)

 

1 hour ago, Manwith Noname said:

To be clearer, I'm not expecting to make no textures and magically see exactly what I want.

Indeed. 

The current 'tinting' mode setup is about the best you are going to get without additional texture work.  The 'grayscale' mode, as mentioned, will run into problems if you are trying to adapt existing mods to use it due to licensing (unless you author entirely new textures for the parts, which is a ton of work).

I'll give some hard thought to the two proposed modes (mapped, hybrid-mapped), as I think those might be the best way to move forward with a system that will actually work for recoloring of existing parts/textures, with the minimal additional work needed.

 

1 hour ago, Manwith Noname said:

I think I'm getting muddled up in the procedure to use when actually creating a mod and integrating this system and the much simpler, "let's take what a modder has done and add colour masks".

As mentioned above -- the current/existing 'tinting' setup is as close as you will get currently to that (adding recoloring to existing mods).

Now, from the 'mod author' perspective, there are a few additional options for both recoloring setup and PBR shader use -- a lot easier to 'do it right' the first time, than to try and adapt it after the fact.

 

So please be patient... and perhaps here in a few weeks (maybe less, if I can find some sanity) I'll have some work done on the 'mapped' and 'hybrid-mapped' shader variants.

 

Link to comment
Share on other sites

8 hours ago, Shadowmage said:

Contrary to my original beliefs, this actually is the single most requested feature from this mod.  I thought that reflections and proper PBR would have been the bigger feature and driver of adoption... but no... its people who want recoloring. 

well, i myself am interested moreso in the metal aspect, but the colors did catch my eye, it'd be amazing to have both, @Shadowmage

Link to comment
Share on other sites

9 hours ago, Shadowmage said:

So please be patient...

If at any point I have come across otherwise, I apologise. It's not my intention to make you feel like I am pressuring you in any way. I only passed on my thoughts for what I personally would like to see because you mentioned things were getting a re-write for KSP 1.4. I am in no rush. Furthermore...

STOP THE PRESS!

I have to say, I think I might just be happy with things the way they are...

Spoiler

CF917C7C3295723FFBB92CB873725853B78217D7

I donned my drinking thinking cap, stopped using sliders and put values in manually. BINGO! With that in mind, might it be possible to add a 2x multiplier toggle beside the sliders? Not required mind you, just a thought.

This has really made my day!

Link to comment
Share on other sites

18 hours ago, Manwith Noname said:

I have to say, I think I might just be happy with things the way they are...

  Hide contents

CF917C7C3295723FFBB92CB873725853B78217D7

I donned my drinking thinking cap, stopped using sliders and put values in manually. BINGO! With that in mind, might it be possible to add a 2x multiplier toggle beside the sliders? Not required mind you, just a thought.

This has really made my day!

wow, these look amazing.

Link to comment
Share on other sites

On 1/5/2018 at 5:04 PM, stuChris said:

well, i myself am interested moreso in the metal aspect, but the colors did catch my eye, it'd be amazing to have both, @Shadowmage

:)

Regardless of which way the recoloring / stock conversion stuff goes, this mod will always offer the option of using PBR textures/shading.  Was the whole point of it, and that certainly won't be going anywhere.

On 1/5/2018 at 10:14 PM, Manwith Noname said:

If at any point I have come across otherwise, I apologise. It's not my intention to make you feel like I am pressuring you in any way. I only passed on my thoughts for what I personally would like to see because you mentioned things were getting a re-write for KSP 1.4. I am in no rush. Furthermore...

STOP THE PRESS!

I have to say, I think I might just be happy with things the way they are...

  Reveal hidden contents

CF917C7C3295723FFBB92CB873725853B78217D7

I donned my drinking thinking cap, stopped using sliders and put values in manually. BINGO! With that in mind, might it be possible to add a 2x multiplier toggle beside the sliders? Not required mind you, just a thought.

This has really made my day!

Glad you are making progress with the current system.

Still have some ideas for something that will work better for conversions of existing parts, but its likely going to be at least a few weeks out.

Link to comment
Share on other sites

13 minutes ago, dundun93 said:

That is sooooo good!!! Does it work fast on older computers?(2008-2013)

If you can run KSP, and your hardware is compatible with DX11 (or OpenGL 3.5+), yes.  It does add some additional overhead, but it is minimal compared to many other visual mods.  If you can run TextureReplacer with its reflection stuff enabled, you should be able to use TU without problem.

 

13 minutes ago, dundun93 said:

Does it work with vens stock revamp?

Sure.  Its not going to -change- anything about how the parts look, but there shouldn't be any incompatibilities with most mods (the only known exception being TextureReplacer, which does have issues).

 

Just installing TU by itself isn't going to change anything in your game.  You need to find a mod who's author has decided to actually use TexturesUnlimited -- of which the list is very small.  See the OP for the list of mods that currently use it.  Basically it consists of only SSTU, and a few small part mods by @bcink

 

You can also stop by Electocutor's thread to try out some of the stock/mod conversion patches, which -will- change how stock/other mods' parts look, but keep in mind that they are all WIP, and must be manually installed alongside TU.

 

Link to comment
Share on other sites

1 minute ago, Shadowmage said:

You can also stop by Electocutor's thread to try out some of the stock/mod conversion patches, which -will- change how stock/other mods' parts look, but keep in mind that they are all WIP, and must be manually installed alongside TU.

 

Cool

1 minute ago, Shadowmage said:

Just installing TU by itself isn't going to change anything in your game.  You need to find a mod who's author has decided to actually use TexturesUnlimited -- of which the list is very small.  See the OP for the list of mods that currently use it.  Basically it consists of only SSTU, and a few small part mods by @bcink

Ahh man!

 

2 minutes ago, Shadowmage said:

If you can run KSP, and your hardware is compatible with DX11 (or OpenGL 3.5+), yes.  It does add some additional overhead, but it is minimal compared to many other visual mods.  If you can run TextureReplacer with its reflection stuff enabled, you should be able to use TU without problem.

Ok

3 minutes ago, Shadowmage said:

Sure.  Its not going to -change- anything about how the parts look, but there shouldn't be any incompatibilities with most mods (the only known exception being TextureReplacer, which does have issues).

 

Oh...

Link to comment
Share on other sites

5 hours ago, fourfa said:

It's working fine alongside SigmaReplacements, if you need something like TextureReplacer @dundun93

Are you saying it'll work with VSR(the silver shine and reflection)? I have TextureReplacer. What do I need to do with it to get it to work?

Link to comment
Share on other sites

I've got Ven's Stock Revamp running with TexturesUnlimited for the shiny, and SigmaReplacements for suits, skybox, etc.  Along with GPP and many others.  Seems good to me.  I don't know what you need to do to get it to work if you have particular suits etc you want, I just used the pre-configured ones in the GPP package.  You'll have to go to the Sigma thread

Link to comment
Share on other sites

14 hours ago, bcink said:

Trying to increase that list! :D

I see that :)

Making good progress I would say.  You are churning out parts far faster than I am, and probably faster than I ever could.  Very nice looking parts even.

(I've just been watching, waiting for you to take the plunge to full PBR textures... :wink: )

Link to comment
Share on other sites

1 hour ago, Shadowmage said:

I see that :)

Making good progress I would say.  You are churning out parts far faster than I am, and probably faster than I ever could.  Very nice looking parts even.

(I've just been watching, waiting for you to take the plunge to full PBR textures... :wink: )

hehehe - That will likely be something I try and play with following the release of the KA-330 tonight. I did slap on a very general reflective surface option for this one just as a test / base.

yvMqT9A.png

Link to comment
Share on other sites

17 hours ago, dundun93 said:

Are you saying it'll work with VSR(the silver shine and reflection)? I have TextureReplacer. What do I need to do with it to get it to work?

Install Textures Unlimited and then get the VSR config from Electorcutors thread, stick the config in GameData and you are good to go

Link to comment
Share on other sites

I got some time to sit down and try and learn how the PBR setup works in depth. Not terrible for night one:

ZBpcDbB.png

I wasn't able to get it to load in-game though...

S2OazlS.png

Don't know where the hang up is.... Using the SolarShader

Link to comment
Share on other sites

Greetings,

Excellent work! I have a newbie question - what mod did you use for the example screenshots? I'd like to see if the reflections are working on my setup, but none of the parts in SSTU have a "mirror" finish. I'm wondering if my graphics settings are configured properly.

Thanks!

Jamie

Link to comment
Share on other sites

Off-topic, but...

You need to have the SSTU_PBR pack installed as well, plus run on DirectX 11 (KSP runs default on DX9).

1.) Force DirectX 11
"E:\Kerbal\KSP 1.3.1 RSS\KSP_x64.exe" -force-d3d11

2.) SSTU_PBR
https://github.com/shadowmage45/SSTULabs/releases/tag/PBR-0.1.0.6

3.) Latest TexturesUnlimited (updated since last SSTU release)
https://github.com/shadowmage45/TexturesUnlimited/releases/tag/1.0.0.7

4.) Make sure to use the Specular and Metallic sliders in the SSTU recoloring GUI


Presto!

pbr_14.jpg

 

 

@bcink  Sorry for the hijack :wink:

Edited by Jimbodiah
Link to comment
Share on other sites

9 hours ago, bcink said:

I got some time to sit down and try and learn how the PBR setup works in depth. Not terrible for night one:

ZBpcDbB.png

I wasn't able to get it to load in-game though...

S2OazlS.png

Don't know where the hang up is.... Using the SolarShader

Pink generally means that the shader wasn't loaded properly (white/gray means the texture wasn't loaded).

This is one of the cases where you'll need to create a config file to force-assign the shader and textures.  Please send me a PM if you need help/tips on setting it up (should be able to use the configs from the JWST as examples).  (or check here, is a patch, but is about the only config I have using that shader -- https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU-PBR/PBRConversions/DefaultShaderAssignments-DSP-ISS.cfg#L1-L49  )

 

Tip:  The solar shader is really only useful if you supply it with its 'thickness map', which drives the back-lit glow effects.  It is under the hood simply a metallic shader with some subsurf-scattering functions.  Pretty much based on this implementation -- https://www.alanzucconi.com/2017/08/30/fast-subsurface-scattering-1/

It also has some additional parameters that must be specified through PARAMETER blocks in the config for best use / to enable the SSS effects.  If you don't need/want the glow effects, you can simply use the SSTU/PBR/Metallic shader -- exact same PBR rendering code minus the subsurface scattering (faster for rendering).

Link to comment
Share on other sites

2 hours ago, Jimbodiah said:

Off-topic, but...

You need to have the SSTU_PBR pack installed as well, plus run on DirectX 11 (KSP runs default on DX9).

1.) Force DirectX 11
"E:\Kerbal\KSP 1.3.1 RSS\KSP_x64.exe" -force-d3d11

2.) SSTU_PBR
https://github.com/shadowmage45/SSTULabs/releases/tag/PBR-0.1.0.6

3.) Latest TexturesUnlimited (updated since last SSTU release)
https://github.com/shadowmage45/TexturesUnlimited/releases/tag/1.0.0.7

4.) Make sure to use the Specular and Metallic sliders in the SSTU recoloring GUI


Presto

@bcink  Sorry for the hijack :wink:

Thanks so much! I can see it now. Glad to know that my machine is still capable, at least in this regard. :) 

Link to comment
Share on other sites

7 hours ago, Jimbodiah said:

Off-topic, but...

You need to have the SSTU_PBR pack installed as well, plus run on DirectX 11 (KSP runs default on DX9).

1.) Force DirectX 11
"E:\Kerbal\KSP 1.3.1 RSS\KSP_x64.exe" -force-d3d11

2.) SSTU_PBR
https://github.com/shadowmage45/SSTULabs/releases/tag/PBR-0.1.0.6

3.) Latest TexturesUnlimited (updated since last SSTU release)
https://github.com/shadowmage45/TexturesUnlimited/releases/tag/1.0.0.7

4.) Make sure to use the Specular and Metallic sliders in the SSTU recoloring GUI


Presto!

pbr_14.jpg

 

 

@bcink  Sorry for the hijack :wink:

Heyo, just wondering what requires the d3d11? I haven't flagged that ever but have not had any trouble loading reflective previously, just the solar shader

Link to comment
Share on other sites

20 minutes ago, bcink said:

Heyo, just wondering what requires the d3d11?

Oh, the shaders will load fine under DX9.  But they look terrible (at least anything with any sort of metallic or specular reflections).

(technical bits:  Unity never bothered to fix up their cubemap convolution routines to work under DX9 properly, so you end up with different faces in the highly blurred cubemap MIP levels with vastly different colors, which makes the seams between edges extremely visible, resulting in this disgusting sort of 'shiny film' that moves across the surface of the reflective mesh)

Link to comment
Share on other sites

28 minutes ago, Shadowmage said:

Oh, the shaders will load fine under DX9.  But they look terrible (at least anything with any sort of metallic or specular reflections).

(technical bits:  Unity never bothered to fix up their cubemap convolution routines to work under DX9 properly, so you end up with different faces in the highly blurred cubemap MIP levels with vastly different colors, which makes the seams between edges extremely visible, resulting in this disgusting sort of 'shiny film' that moves across the surface of the reflective mesh)

Oh cool. I have to check that out then. Also - that recoloring tool looks amazing. Is that code only or does that actually adjust the texture files?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...