Shadowmage

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

Recommended Posts

Unfortunately, looks like no release for this weekend.  There have been a lot of changes that might impact existing configs, and I want to give some additional time to review those changes for side-effects.  Also want to take a run at trying to fix up the atmosphere and skybox reflections in the stock reflection probe, as those add quite a bit of impact to the reflection maps that is currently missing, and take a look at cleaning up Scatterer reflections.  And finally, I want to finish up the external toolset that can be used for normalization data generation, time permitting.

However, for anyone so inclined, the dev branch is being kept up-to-date with the fixes, and you are welcome to download the /GameData folder directly from there if you wanted to give the new stuff a try.  It shouldn't break anything, but please let me know if you encounter any issues, new or otherwise.

Will aim for next weekend for the next release, as that should give sufficient time for review and testing, and hopefully give time for cleaning up some of the reflection stuff.

 

Share this post


Link to post
Share on other sites

Terrifically looking forward to the part recoloring! I never really got the hang of Kerb Paint, and later just used a part color switcher once 1.4's variant switcher apparatus was developed but this was limited to individual variants hand-crafted and configured:

 

Pretty excited to be able to do it from within TU!

Share this post


Link to post
Share on other sites
Posted (edited)
Spoiler
On 7/27/2019 at 3:44 PM, Shadowmage said:

Did a thing last night, see if you can spot it in this GUI :)

kRyYion.png

wMiIXvI.png

 

At one point was an often requested feature, that I just now managed to find a clean way to hook it into the existing code and GUI.  Still a bit more functionality to decide in regards to 'what is the default palette for any given part/module/section'; but the feature is functional and will be available in the next release.  I'll be defining a couple of standard palettes, but other mods/patch sets are free to define their own or edit the existing ones.

As mentioned above the last missing functional bit is 'what palettes are available for any given part'.  Likely will tackle that bit for the next release, after some further thought and discussion.  Currently all defined palettes are visible for every part.

Further, there is a 'FULL' palette that will by default contain all defined preset colors, that will likely be linked to a config option in the in-game settings menu to force it to be available for all parts regardless of what their config defines.

 

Just one more bit of fun coming with the next release (later today maybe?).

 

I'm putting the quote with the screenshots in a spoiler because it's a big post. In the part list on the left the parts appear dimmed - they don't appear to have the reflections visible in the VAB/SPH like they do without using TexturesUnlimted. I'm running my game in DX9 currently (had read about DX11 issues other than textures which this fixes). Does this issue go away when running in DX11? Or is it just something we need to live with? I know it's a pretty minor thing, it's just taking some readjusting when looking at the parts. I'm finding it a little bit harder to see find what I'm looking for because I'm used to the stock reflections being there. What is it about Textures Unlimited that causes this to happen? Mainly curious on that aspect. 

I installed TexturesUnlimited so that I could use the James Webb telescope mod but could happily live without it (although I would love to use the mod). 

I have placed two images inside the spoiler tag which show what the parts list is like in the VAB without and without Textures Unlimited installed in 1.7.3 running on DX9:

Spoiler

With Textures Unlimited Installed DX9:

jGaDmtg.png

Without Textures Unlimited installed DX9:

khVkrjS.png

I'm pretty sure that reflections are enabled properly in game. Only setting I can find is the refresh time one and the one next to it (forgotten the name right now). 

 

One final thing to ask: Are there are extra or required config files needed for stock and mods? Or is everything included with the download? 

Edited by madindehead

Share this post


Link to post
Share on other sites
3 hours ago, madindehead said:

they don't appear to have the reflections visible in the VAB/SPH like they do without using TexturesUnlimted.

What you are seeing there isn't reflections, but the stock icon shader inflating the diffuse lighting.  I don't have access to the stock shader source, so have no reference on what they are doing, or how to duplicate it.

 

3 hours ago, madindehead said:

Does this issue go away when running in DX11?

In order to fix issues with the stock icon-shaders on DX11 (they are flat blue for everything), TU has provided its own replacements; however as mentioned above, they are not entirely equivalent replacements.

 

Long story short -- if the icons bug you, you will have to remove TU or disable the icon replacement configs.  It is a side effect of me fixing issues with stock DX11.  Personally I think the stock icon shaders look far too bright and washed out, and the replacements don't bug me.  Combined with lack of access to the stock shaders to know what they are doing to replicate it, the chances of this being fixed are minimal.

If you use ModuleManager to delete these nodes, TU will no longer patch icon shaders: https://github.com/shadowmage45/TexturesUnlimited/blob/master/GameData/000_TexturesUnlimited/Shaders/TUShaders.cfg#L21

E.G.  (or whatever the correct syntax is)

-KSP_SHADER_DATA[*]{}

 

3 hours ago, madindehead said:

One final thing to ask: Are there are extra or required config files needed for stock and mods?

Yes.  TU is only an API and by itself doesn't do much.

3 hours ago, madindehead said:

Or is everything included with the download? 

No.  See above.

I provide configs for my main parts mod (SSTU), but I'm not aware of any other comprehensive sets for stock or other mods.  The closest available is likely:

 

 

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, Shadowmage said:

What you are seeing there isn't reflections, but the stock icon shader inflating the diffuse lighting.  I don't have access to the stock shader source, so have no reference on what they are doing, or how to duplicate it.

 

In order to fix issues with the stock icon-shaders on DX11 (they are flat blue for everything), TU has provided its own replacements; however as mentioned above, they are not entirely equivalent replacements.

 

Long story short -- if the icons bug you, you will have to remove TU or disable the icon replacement configs.  It is a side effect of me fixing issues with stock DX11.  Personally I think the stock icon shaders look far too bright and washed out, and the replacements don't bug me.  Combined with lack of access to the stock shaders to know what they are doing to replicate it, the chances of this being fixed are minimal.

If you use ModuleManager to delete these nodes, TU will no longer patch icon shaders: https://github.com/shadowmage45/TexturesUnlimited/blob/master/GameData/000_TexturesUnlimited/Shaders/TUShaders.cfg#L21

E.G.  (or whatever the correct syntax is)


-KSP_SHADER_DATA[*]{}

 

Yes.  TU is only an API and by itself doesn't do much.

No.  See above.

I provide configs for my main parts mod (SSTU), but I'm not aware of any other comprehensive sets for stock or other mods.  The closest available is likely:

 

 

Ace. Thanks for all of that info :) I will probably get used to the part list icons being different and then end up not noticing it :D

One other thing: If I wanted to remove the TU support from SSTU, is it just a case of deleting the configs? What will that default do texture wise?

Edited by madindehead

Share this post


Link to post
Share on other sites
34 minutes ago, madindehead said:

If I wanted to remove the TU support from SSTU,

Not possible; its a linked-dependency of the SSTU plugin.  You could remove the texture-switching and recoloring GUI functions through careful patching, but it will always require that TU be installed.

Share this post


Link to post
Share on other sites
28 minutes ago, Shadowmage said:

Not possible; its a linked-dependency of the SSTU plugin.  You could remove the texture-switching and recoloring GUI functions through careful patching, but it will always require that TU be installed.

I didn't explain myself very well. 

If I don't want the reflections on SSTU how would I change that? Is that just disabling the reflections in the TU config options? I love the idea of the SSTU parts: not sure about all the reflections though (maybe it needs to grow on me) but I feel like it looks weird. I found a stock config for TU and it also feels weird right now to have all of those chrome parts :/ 

Share this post


Link to post
Share on other sites
Posted (edited)

... and I updated my fiddled ColorPresets.cfg:

Spoiler

GameData\000_TexturesUnlimited\ColorPresets.cfg


//------------------------- SSTU -------------------------
KSP_COLOR_PRESET
{
	name = white
	title = White Paint
	color = 236, 236, 236
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = beige
	title = Beige White Paint
	color = 230, 225, 214
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = ltGray
	title = Light Gray Paint
	color = 183, 183, 183
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = dkGray
	title = Dark Gray Paint
	color = 128, 128, 128
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = black
	title = Black Paint
	color = 46, 46, 46
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = red
	title = Red Paint
	color = 128, 32, 32
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = green
	title = Green Paint
	color = 94, 107, 72
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = blue
	title = Blue Paint
	color = 84, 214, 237
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = brown
	title = Brown Paint
	color = 157, 125, 86
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = dkOlive
	title = Drab Olive Paint
	color = 84, 79, 61
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = olive
	title = Olive Paint
	color = 102, 107, 80
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = orange
	title = Orange
	color = 255, 159, 0
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = foam
	title = Orange Foam
	color = 227, 144, 60
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = ltFoam
	title = Orange Foam (Light)
	color = 227, 175, 80
    specular = 32
    metallic = 0
}

//------------------------- stock colors -------------------------
KSP_COLOR_PRESET
{
	name = stockWhite
	title = Stock White
	color = 180, 180, 180
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = stockLightGrey
	title = Stock Light Grey
	color = 120, 120, 120
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = stockDarkGrey
	title = Stock Dark Grey
	color = 90, 90, 90
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = stockBlack
	title = Stock Black
	color = 30, 30, 30
    specular = 32
    metallic = 0
}
KSP_COLOR_PRESET
{
	name = stockOrange
	title = Stock Orange
	color = 244, 152, 65
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = stockGreen
	title = Stock Green
	color = 115, 123, 87
	specular = 95
	metallic = 0
}

//------------------------- metallics -------------------------
KSP_COLOR_PRESET
{
	name = silver
	title = Silver
	color = 183, 183, 183
    specular = 176
    metallic = 255
}
KSP_COLOR_PRESET
{
	name = steel1
	title = Steel 1
	color = 128, 128, 128
    specular = 176
    metallic = 255
}
KSP_COLOR_PRESET
{
	name = steel2
	title = Steel 2
	color = 127, 127, 127
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = polishedSteel
	title = Polished Steel
	color = 127, 127, 127
	specular = 239
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = gold1
	title = Gold 1
	color = 212, 175, 55
    specular = 176
    metallic = 255
}
KSP_COLOR_PRESET
{
	name = gold2
	title = Gold 2
	color = 255, 215, 0
	specular = 239
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = bronze1
	title = Bronze 2
	color = 191, 149, 99
    specular = 176
    metallic = 255
}
KSP_COLOR_PRESET
{
	name = bronze2
	title = Bronze 2
	color = 102, 93, 30
	specular = 191
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = brass1
	title = Brass 1
	color = 250, 230, 150
    specular = 176
    metallic = 255
}
KSP_COLOR_PRESET
{
	name = brass2
	title = Brass 2
	color = 181, 166, 66
	specular = 191
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = platinum
	title = Platinum
	color = 213, 208, 200
    specular = 176
    metallic = 255
}
KSP_COLOR_PRESET
{
	name = copper
	title = Copper
	color = 184, 115, 51
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = aluminium
	title = Aluminium
	color = 191, 191, 191
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = polishedAluminium
	title = Polished Aluminium
	color = 191, 191, 191
	specular = 239
	metallic = 255
}

//------------------------- Soyuz -------------------------
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
}

//------------------------- NCS - Anodized -------------------------
KSP_COLOR_PRESET
{
	name = ncsWhite
	title = NCS White
	color = 255, 255, 255
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = polishedWhite
	title = Polished White
	color = 255, 255, 255
	specular = 239
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = ncsBlack
	title = NCS Black
	color = 0, 0, 0
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = polishedBlack
	title = Polished Black
	color = 0, 0, 0
	specular = 239
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = ncsBrown
	title = NCS Brown
	color = 151, 116, 80
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = anodizedBrown
	title = Anodized Brown
	color = 151, 116, 80
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = ncsRed
	title = NCS Red
	color = 196, 2, 51
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = anodizedRed
	title = Anodized Red
	color = 196, 2, 51
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = ncsOrange
	title = NCS Orange
	color = 225, 106, 25
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = anodizedOrange
	title = Anodized Orange
	color = 225, 106, 25
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = ncsYellow
	title = NCS Yellow
	color = 255, 211, 0
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = anodizedYellow
	title = Anodized Yellow
	color = 255, 211, 0
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET {
	name = ncsGreen
	title = NCS Green
	color = 0, 159, 107
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = anodizedGreen
	title = Anodized Green
	color = 0, 159, 107
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = ncsTeal
	title = NCS Teal
	color = 0, 147, 148
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = anodizedTeal
	title = Anodized Teal
	color = 0, 147, 148
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = ncsBlue
	title = NCS Blue
	color = 0, 135, 189
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = anodizedBlue
	title = Anodized Blue
	color = 0, 135, 189
	specular = 127
	metallic = 255
}
KSP_COLOR_PRESET
{
	name = ncsPurple
	title = NCS Purple
	color = 98, 68, 120
	specular = 95
	metallic = 0
}
KSP_COLOR_PRESET
{
	name = anodizedPurple
	title = Anodized Purple
	color = 98, 68, 120
	specular = 127
	metallic = 255
}

//------------------------- color groups -------------------------
PRESET_COLOR_GROUP
{
	name = SSTU
	color = white
	color = beige
	color = ltGray
	color = dkGray
	color = black
	color = red
	color = green
	color = blue
	color = brown
	color = dkOlive
	color = olive
	color = orange
	color = foam
	color = ltFoam
}
PRESET_COLOR_GROUP
{
	name = Stock
	color = stockWhite
	color = stockLightGrey
	color = stockDarkGrey
	color = stockBlack
	color = stockOrange
	color = stockGreen
}
PRESET_COLOR_GROUP
{
	name = Soyuz
	color = soyuzGrey
	color = soyuzOrange
	color = soyuzGreen
	color = soyuzWhite
}
PRESET_COLOR_GROUP
{
	name = Metallics
	color = silver
	color = steel1
	color = steel2
	color = polishedSteel
	color = gold1
	color = gold2
	color = bronze1
	color = bronze2
	color = brass1
	color = brass2
	color = platinum
	color = copper
	color = aluminium
	color = polishedAluminium
}
PRESET_COLOR_GROUP
{
	name = NCS - Anodized
	color = ncsWhite
	color = polishedWhite
	color = ncsBlack
	color = polishedBlack
	color = ncsBrown
	color = anodizedBrown
	color = ncsRed
	color = anodizedRed
	color = ncsOrange
	color = anodizedOrange
	color = ncsYellow
	color = anodizedYellow
	color = ncsGreen
	color = anodizedGreen
	color = ncsTeal
	color = anodizedTeal
	color = ncsBlue
	color = anodizedBlue
	color = ncsPurple
	color = anodizedPurple
}

 

 

Edited by Gordon Dry

Share this post


Link to post
Share on other sites
On 8/2/2019 at 8:29 PM, madindehead said:

If I don't want the reflections on SSTU how would I change that? 

Open recolor GUI, set specular to 0?

Share this post


Link to post
Share on other sites
Posted (edited)
1 hour ago, Buflak said:

Open recolor GUI, set specular to 0?

Good, functional.  I'll raise you one though.

@madindehead

Open the stock in-game settings, find the stuff that deals with reflections, and turn it off :)    TU uses the stock reflection probes and stock reflection system, and the reflections can be disabled that way, globally, across the entire mod (and entire game).

(note though:  anything that should be metal/chrome will instead show a solid color instead of reflections, whatever stock has specified that color to be, and is entirely out of my control).

Edited by Shadowmage

Share this post


Link to post
Share on other sites

So is this just the modern replacement of PlanetShine with some extra on the side?

Edited by Lo Var Lachland

Share this post


Link to post
Share on other sites

EDIT: nvm... seems I myself got my mods mixed up in my reply to Lo Var Lachland :face_palm:

Edited by Stone Blue

Share this post


Link to post
Share on other sites
4 hours ago, Lo Var Lachland said:

So is this just the modern replacement of PlanetShine with some extra on the side?

Not really.

TexturesUnlimited is a nearly-full implementation of Unity Standard shaders in KSP, bringing the option to use Physically Based Rendering methods and basic Global Illumination.  With some extra features on the side for the 'recoloring' system.

PlanetShine simply introduced colored ambient (maybe it was directional?) light depending upon what body you orbited, using preconfigured color maps or values taken from the celestial body data constructs.

TexturesUnlimited unlocks the full potential of environment-mapped reflections, which uses the actual rendered environment to determine what lights and colors will show on your craft; up-to and including fully reflective surfaces with pixel-accurate reflections of the surroundings.

 

So, yes, TU does duplicate the visible function of PlanetShine, but only as a side-effect of its more modern rendering techniques and shaders.

 

Share this post


Link to post
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.