Jump to content

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


Shadowmage

Recommended Posts

6 hours ago, Shadowmage said:

^^^ is why there is not a functional (and properly implemented) TU patch/recoloring mod for stock -- nobody wants to redo all those terrible stock textures.

That's bad news actually

As suggested by Electrocutor, I have replaced the unsupported patch mod that I had told you about a few weeks ago with  Textures Unlimited Recolour Depot. Unfortunately the result was disappointing. I was mostly looking for advanced shaders and for the metallic reflections which I had on stock parts with the previous config mod, but without the side effects that I had experienced while using it; what I obtained after switching to the other mod, is that many parts now are rendered completely black, and metallic reflections are absent... I don't know wheter I am doing something wrong or maybe that's the way Noname's mod is intended :confused:

Link to comment
Share on other sites

1 minute ago, gap said:

I don't know wheter I am doing something wrong or maybe that's the way Noname's mod is intended

Unfortunately, I really couldn't say one way or another.  I never stayed up-to-date with the TU-patch sets, so not really sure where they ended up functionality wise.

IIRC -- the problem you were encountering was just on a single part (a parachute)?    Likely much easier ways to solve that then by switching to a different patch set.  If your original set was mostly working but you wanted, probably much easier to fix the specific issues you were encountering (in this case, might just be a single line needing to be changed.... might require a bit more complex solution though).

Link to comment
Share on other sites

3 minutes ago, Shadowmage said:

Unfortunately, I really couldn't say one way or another.  I never stayed up-to-date with the TU-patch sets, so not really sure where they ended up functionality wise.

IIRC -- the problem you were encountering was just on a single part (a parachute)?    Likely much easier ways to solve that then by switching to a different patch set.  If your original set was mostly working but you wanted, probably much easier to fix the specific issues you were encountering (in this case, might just be a single line needing to be changed.... might require a bit more complex solution though).

In the meanwhile I met several other problem: indicators on the navball are rendered as solid squares rather than cross-hairs, lights on some core modules can't be switched on anymore, and in cockpit view window glasses have become so glossy that one can hardly see through them. Other than that (and the parachute bug that curiously seems to affect only the Mk 16 chute), I must say that the genera effect is very cool!

Unfortunately I couldn't find any contact for the mod author, but if you are interested into looking into that mod, I can send you a list with pictures of all the bugs I have noticed so far and the name of the affected parts :)

 

Link to comment
Share on other sites

  • 2 weeks later...
On 6/4/2019 at 4:42 PM, Shadowmage said:

TU only works with KSPTextureSwitch.

The issue is that in order to support recoloring the textures have to be authored for recoloring from the start.  Those parts were not created for recoloring, and thus to get it working, you would have to redo the textures.  No other way around it.

^^^ is why there is not a functional (and properly implemented) TU patch/recoloring mod for stock -- nobody wants to redo all those terrible stock textures.

What would need to be done exactly?
I mean, besides the fact that I'm unsure of what would need to be done to textures for each shader type, you also have a lot of different shaders.

Is it like "every texture needs to be treated in [this] way and if that is done TU can play around with whatever it wants"?

In other words: What's the minimum viable product? :P

Link to comment
Share on other sites

20 hours ago, Jognt said:

What would need to be done exactly?
I mean, besides the fact that I'm unsure of what would need to be done to textures for each shader type, you also have a lot of different shaders.

Is it like "every texture needs to be treated in [this] way and if that is done TU can play around with whatever it wants"?

In other words: What's the minimum viable product? :P

Take a look at SSTU and how its textures are setup.  That mod uses the intended use of the texture switch setup in its entirety (and is the ONLY mod that uses TU correctly for recoloring).   https://github.com/shadowmage45/SSTULabs/tree/master/GameData/SSTU/Assets

Notably for recoloring -- textures need to be authored in grayscale for the DIFF/MET/GLOSS maps, and an additional 'recoloring' mask provided.  Alternatively, you can use existing textures and provide a 'normalization mask' in addition to the recoloring mask.  Either way works, but this is the important step nobody wants to do, because it requires real, and hard, work in order to create these masks (and configs).

E.G.  Here is the diffuse texture used for SSTUs fuel tanks, and its recoloring mask (one of them; lots of masks)

https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU/Assets/SC-TANKS-DIFF-WHITE-P.dds

https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU/Assets/SC-TANKS-MASK-STRIPES1.dds

 

Basically the system takes the 'grayscale diffuse texture' and uses it for adding details on top of a user-selected color.  If the original texture is not grayscale with a base of 127,127,127, the details cannot be extracted correctly, and the output visual will not match the recoloring selections in the UI.

 

Link to comment
Share on other sites

Few words about the upcoming release (later this week/week-end):

  • TU now uses the stock reflection probe and stock reflection system; to edit reflection quality, use the stock settings in the in-game options menu.  This means that TU no longer has any 'runtime' component (e.g. no possibility for memory leaks; any runtime leaks now are due to stock code).
  • Removed DX9 API check and warning.  If people want their stuff to look terrible, go for it.
  • Scatterer no longer present in reflections (changes to Scatterer code) (EVE still works).  This is a stock/scatterer problem, and not one that TU can fix.
  • Stock skybox not present in reflections (changes to stock skybox code -- they don't support the skybox with their own reflection probe, so not something I can fix).
Link to comment
Share on other sites

On 6/16/2019 at 5:37 PM, Shadowmage said:

Take a look at SSTU and how its textures are setup.  That mod uses the intended use of the texture switch setup in its entirety (and is the ONLY mod that uses TU correctly for recoloring).   https://github.com/shadowmage45/SSTULabs/tree/master/GameData/SSTU/Assets

Notably for recoloring -- textures need to be authored in grayscale for the DIFF/MET/GLOSS maps, and an additional 'recoloring' mask provided.  Alternatively, you can use existing textures and provide a 'normalization mask' in addition to the recoloring mask.  Either way works, but this is the important step nobody wants to do, because it requires real, and hard, work in order to create these masks (and configs).

E.G.  Here is the diffuse texture used for SSTUs fuel tanks, and its recoloring mask (one of them; lots of masks)

https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU/Assets/SC-TANKS-DIFF-WHITE-P.dds

https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU/Assets/SC-TANKS-MASK-STRIPES1.dds

 

Basically the system takes the 'grayscale diffuse texture' and uses it for adding details on top of a user-selected color.  If the original texture is not grayscale with a base of 127,127,127, the details cannot be extracted correctly, and the output visual will not match the recoloring selections in the UI.

 

 

:/ I was hoping it was the type of tedious thing I understood, unfortunately I don’t :( 

Link to comment
Share on other sites

I just added this block to GameData\000_TexturesUnlimited\ColorPresets.cfg

KSP_COLOR_PRESET
{
	name = soyuzGrey
	title = Soyuz Grey
	color = 103, 100, 83
    specular = 100
    metallic = 5
}
KSP_COLOR_PRESET
{
	name = soyuzOrange
	title = Soyuz Orange
	color = 253, 145, 21
    specular = 100
    metallic = 5
}
KSP_COLOR_PRESET
{
	name = soyuzGreen
	title = Soyuz Green
	color = 27, 88, 46
    specular = 100
    metallic = 5
}
KSP_COLOR_PRESET
{
	name = soyuzWhite
	title = Soyuz White
	color = 255, 255, 255
    specular = 100
    metallic = 5
}

Correct me if I'm wrong.

Update:
Could it need more specular?

Results in VAB (using ROTanks core and booster with 3 TU recolor areas each and ROEngines):
vsI4T9U.jpg
zJoHjOb.jpg

It looks a little shinier, but not too much, with this setup:

KSP_COLOR_PRESET
{
	name = soyuzGrey
	title = Soyuz Grey
	color = 103, 100, 83
    specular = 140
    metallic = 10
}
KSP_COLOR_PRESET
{
	name = soyuzOrange
	title = Soyuz Orange
	color = 253, 145, 21
    specular = 140
    metallic = 10
}
KSP_COLOR_PRESET
{
	name = soyuzGreen
	title = Soyuz Green
	color = 27, 88, 46
    specular = 140
    metallic = 10
}
KSP_COLOR_PRESET
{
	name = soyuzWhite
	title = Soyuz White
	color = 255, 255, 255
    specular = 140
    metallic = 10
}


 

Edited by Gordon Dry
updated with less specular
Link to comment
Share on other sites

16 hours ago, torchard96 said:

For anyone needing a list of all their models in an install, I wrote a quick python script that walks through the gamedata directory and prints out all model files in the textures unlimited format.

https://github.com/torchard96/General_Portfolio/blob/master/python/model lister.py

Great! I'll look into it

Link to comment
Share on other sites

On 7/2/2019 at 6:05 PM, torchard96 said:

For anyone needing a list of all their models in an install, I wrote a quick python script that walks through the gamedata directory and prints out all model files in the textures unlimited format.

https://github.com/torchard96/General_Portfolio/blob/master/python/model lister.py

Huh, how do I use this?

Link to comment
Share on other sites

3 hours ago, juanml82 said:

Huh, how do I use this?

First copy the text into a python text editor (I personally use Python Shell).

Then were it says

'enter gamedata directory'

replace that with the location of your gamedata directory

ie 'C:/Steam/steamapps/common/Kerbal Space Program/GameData'

run and it should print out a list of all model files in that save.

Link to comment
Share on other sites

4 hours ago, juanml82 said:

Huh, how do I use this?

Print it out on paper, then fold it into a paper snake. That's why it's called Python. :cool:

On a more serious note: I had no idea either, so thanks for asking because now I know too.

Link to comment
Share on other sites

2 hours ago, torchard96 said:

First copy the text into a python text editor (I personally use Python Shell).

Then were it says

'enter gamedata directory'

replace that with the location of your gamedata directory

ie 'C:/Steam/steamapps/common/Kerbal Space Program/GameData'

run and it should print out a list of all model files in that save.

So, if I got this right, I download the stuff from https://www.python.org/shell/ and use the "IDLE" software installed with the bundle

I got a "SyntaxError: multiple statements found while compiling a single statement" when I click enter at the end of the text

6TvBUIa.png

Link to comment
Share on other sites

6 minutes ago, torchard96 said:

Sorry first go to new file, paste in the code then save the file (python won't run if it isn't).

Then hit f5 to run the program.

Sorry for the confusion, hope it works.

Cool, now it worked

Link to comment
Share on other sites

Is it normal that the TU colored white is darker than the white from a non-TU texture?
Or that the part still got some specular left over when specular is set to 0, so it "reflects" the dark corners of the VAB interior? :D

Screenshot, top is a stockish-textured part (left PAW), bottom is a TU-colored part (right PAW and TU recolor UI):
VaJ2XAF.jpg

This is KSP 1.6.1 on -force-glcore - using the 1.4.8.22 but it was the same with 1.3.6.20

Link to comment
Share on other sites

On 7/11/2019 at 9:25 AM, Gordon Dry said:

Is it normal that the TU colored white is darker than the white from a non-TU texture?

Define 'white'.  Good luck :)

TLDR:  There is no standard definition for 'white'.  What KSP calls 'white', I call 'mushy grey'.  What I would call 'white' is pure white (255,255,255), and not used often in texturing or game graphics.  There is also massive differences in the exact same color when rendered using legacy shaders compared to the PBR shaders used by TU.  What you are seeing could be any of those.

I cannot control how others create their textures, or define their colors, nor would I want to.  I have created a default color palette and set of preset colors that works for me, but notably it is not the same palette used by stock or other mods (it is close to the old KW rocketry palette, but not exact).  Notably the TU 'white' is brighter than stock/most mods 'white', and the TU 'black' is darker than stock/most mods 'black'.

Also, you can change the TU colors to whatever you want them to be.  Want to match a specific mods coloring scheme?  Go ahead and edit the color presets file (or patch it), or add new presets in an entirely new file;  you could even create one set of preset colors per mod, for extreme mod-color-matching-craziness.

Link to comment
Share on other sites

I already added color presets, I just wonder how a preset that is 255,255,255 can look darker than an "un-TUed" texture ...

After setting specular and metallic to 0 there is still a slightly specular effect that seems to show a reflection of the surroundings, so the dark corners of the VAB make the part appear darker.

Link to comment
Share on other sites

47 minutes ago, Gordon Dry said:

I already added color presets, I just wonder how a preset that is 255,255,255 can look darker than an "un-TUed" texture ...

In a (two) word(s):  Normalization Values.  (most likely this, or related)

The way that TU manipulates textures relies on some patch-author-provided 'normalization' values, so it knows how to pull just the details out of a texture.  If those values are off, even slightly,  (or completely omitted as is often the case), the result can be output colors that do not match the user-specified RGB values in the UI.

What TU'd fuel tank are you adjusting that has color issues?  (Or more importantly, where can I take a look at the TU configs for that part?)   Likely that the author has not included any normalization data, and/or is using 'tinting' mode (aka color multiply), which relies on the original provided texture colors, and can only ever make textures equal-to-or-darker than they were originally.

 

Really, the 'standard candle' for TU recoloring implementation should be SSTU -- it is the only place where the recoloring setup of the mod is used as intended.  On SSTU parts, setting something to 255,255,255 results in blindingly-bright-white, as it should be, and setting something to 0,0,0 results in pure black (again, as it should be).

 

Link to comment
Share on other sites

I'm still pretty confused as to how to install and get this thing working. I've put 000_TexturesUnlimited and KSPF from Electrocutor's thread into my GameData, but I don't see any button on my toolbar to open up the Part Recoloring GUI. Have I installed something wrong, am I missing a keybinding, am I just blind and forgot something? Please help out here, thanks.

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...