Jump to content

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


Shadowmage

Recommended Posts

3 minutes ago, Shadowmage said:

No, the system is not extensible.  Nothing that I can make use of.

It's semi-extensible, but not very flexible.  You can register for the variant changed GameEvent and then grab some custom data from the variant.  ModuleProceduralFairing does this for instance.  It's pretty limited though, and unless there's a very compelling need to integrate with stock variants I'd say it's not worth it.

Link to comment
Share on other sites

17 hours ago, blowfish said:

It's semi-extensible, but not very flexible.  You can register for the variant changed GameEvent and then grab some custom data from the variant.  ModuleProceduralFairing does this for instance.  It's pretty limited though, and unless there's a very compelling need to integrate with stock variants I'd say it's not worth it.

ModulePartVariants does allow you to set shader=; so in theory, all of TU could be used within the part module. Unfortunately, it does not search asset bundles for the shader, only the built-in ones, so you have to pick one TU shader and stick with it, having been set via KSP_MODEL_SHADER. You can then use ModulePartVariants to allow different settings. Unfortunately, the mask shader and stock shader are separate; so if you allow the part to look as the artist intended, you cannot also create a variant that uses repainting; vice versa also applies.

An example:

@REFLECTION_CONFIG[default]:NEEDS[TexturesUnlimited] {
	%enabled = true
}
KSP_MODEL_SHADER:NEEDS[TexturesUnlimited] {
	model = (path to model)

	MATERIAL {
		excludeMesh = flagTransform
		shader = SSTU/PBR/StockMetallicBumped
		PROPERTY {
			name = _Metal
			float = 0.0
		}
	}
}

@PART[(part)]:NEEDS[TexturesUnlimited] {
	MODULE {
		name = ModulePartVariants
		baseVariant = Basic
		
		VARIANT {
			name = Basic
			displayName = Basic
			primaryColor = #ffffff
			secondaryColor = #ffffff
		}
		VARIANT {
			name = Metallic
			displayName = Metallic
			primaryColor = #808080
			secondaryColor = #808080

			TEXTURE {
				_Metal = 0.75
			}
		}
		VARIANT {
			name = MetallicShiny
			displayName = Metallic Shiny
			primaryColor = #C0C0C0
			secondaryColor = #C0C0C0

			TEXTURE {
				_Metal = 0.75
				_Smoothness = 1.75
			}
		}
	}
}

 

Link to comment
Share on other sites

On 31-3-2018 at 12:51 AM, Electrocutor said:

For KSP 1.4.0+ you need to use GLCore, not dx11.

You do so by adding a parameter to the shortcut for KSP: .exe -force-glcore

Mage, could you add this to the SSTU and/or TU first post so it is easier to find and more obvious?  I just scoured through 20 pages to find this so I could test a 1.4.x install :)

Link to comment
Share on other sites

1 hour ago, Jimbodiah said:

Mage, could you add this to the SSTU and/or TU first post so it is easier to find and more obvious?  I just scoured through 20 pages to find this so I could test a 1.4.x install :)


There is actually an in-game pop-up now that should, well, pop-up when starting the game that will tell you if you are using the wrong graphics API, as well as giving you the proper command-line option.  (I've also updated the TU-OP with the information)

Link to comment
Share on other sites

Hi @Shadowmage! Come here to ask you a very dumb question, or a nice question and i'm very dumb and can't reach a conclusion by myself. 
on 1.3.1 i've being using your fantastic mod (SSTUparts) and your API (TU and PBR-Shaders) but now on 1.4.2 dunno how make it work, SSTU part just hangs the game on loading, so decided to make a fresh install and try to install TU and just the PBR-shaders for stock only (using Electrocutor's Configs) But the Recoloring GUI doesn't show up, What i'm doing wrong?
I downloaded the lastest PBR and TU, and the configs from Electrocutor's post. Tried first Original Electrocutor's Patch and then the one from Prokjet. but the GUI doesn't show up, tried on dx9 and Opengl (Using -force-glcore)
Can you make me a very little guide about how to install tu pbr and the configs to work on 1.4.2?
If not no problem i will continue trying to see what in the hell i'm doing wrong.
Great API and MOD, thank you for all.

Link to comment
Share on other sites

Updated release is available:

https://github.com/shadowmage45/TexturesUnlimited/releases/tag/1.1.1.13

Several bugfixes and feature enhancements.  See the link for full changelog and downloads.

 

 

1 hour ago, Nitojmg said:

SSTU part just hangs the game on loading,

As @Jimbodiah states, SSTU is not yet usable in KSP 1.4+.  You'll either have to remove it, or downgrade back to KSP 1.3.x.  The rest of my mods should all work for KSP 1.4 though (TU, KSPWheel, etc).

Link to comment
Share on other sites

Thanks for the fast reply @Jimbodiah and @Shadowmage! i knew sstu part doesn't work. but the pbr can work alone without sstu parts? in  that case what's the way to install the files to get it working? or the gui comes with the sstu parts bundle?

In other words: can i have the reflections and recoloring gui without the sstu part bundle?

Im trying to make it work but i can't. Sorry to bother guys

Edited by Nitojmg
Extension of question
Link to comment
Share on other sites

7 minutes ago, Jesusthebird said:

ive had TU installed for quite a while now with no such warning pop up, is this a new change?

The popup is new because people would install TU, but not follow directions and then ask why it wasn't working. With the popup, it will explicitly tell the player what is needed to use TU.

Link to comment
Share on other sites

2 hours ago, juanml82 said:

I'm wondering, with this mod, is it possible to add a more rock-like shader to use, through Kopernicus (I guess) for the planets' surfaces?

OMG OMG OMG....  a chrome planet....   Just sayin' !!!!

Link to comment
Share on other sites

23 hours ago, Electrocutor said:

The popup is new because people would install TU, but not follow directions and then ask why it wasn't working. With the popup, it will explicitly tell the player what is needed to use TU.

Guess I had it installed wrong and just never noticed lol. Since this mod is used in the same way kinda like KSPRC, I just figured it works as long as there was a mod that uses its. To me at least, changing command parameters defiantly isnt a normal way to install mods. But thanks for clarifying my lack of reading when I installed this haha

Edited by Jesusthebird
Link to comment
Share on other sites

On 16.4.2018 at 5:25 PM, Shadowmage said:

There is actually an in-game pop-up now that should, well, pop-up when starting the game

maybe u can make a ``dont show again`` button,in one of the next versions

iam startin ksp dozen time a day,and it one step more for me-to click it away

tryed the open glcore method but had the cutparts* bug -here the threat:

https://forum.kerbalspaceprogram.com/index.php?/topic/171834-14-partial-part-icons-on-first-row-macos/&

but normaly starting ksp works perfect on my sys

*tovOMZU.png

THANKS for the fantastic graphic enhancement-the dont kill ur fps&push ksp to a whole new level

20 hours ago, juanml82 said:

more rock-like shader

GREAT IDEA!

 

17 hours ago, Jimbodiah said:

a chrome planet

WHOOOHHOOWWW and radioactiv glowing moons -head cinema

Link to comment
Share on other sites

On ‎4‎/‎21‎/‎2018 at 9:31 AM, Shadowmage said:

Updated release is available:

Several bugfixes and feature enhancements. 

Man, thanks a lot for this latest update. It's really a great finishing touch to be able to have T.U. working on fairings. :D:D:D 

Link to comment
Share on other sites

14 hours ago, Burning Kan said:

tryed the open glcore method but had the cutparts* bug -here the threat:

https://forum.kerbalspaceprogram.com/index.php?/topic/171834-14-partial-part-icons-on-first-row-macos/&

but normaly starting ksp works perfect on my sys

Unfortunately, it looks like Squad/PrivateDivision is specifically only fixing this per operating system; if that is truly the case, then Mac and Linux will have it fixed, but Windows will remain broken. The Linux fix should be included in 1.4.3, so we'll know then.

Link to comment
Share on other sites

On 4/23/2018 at 2:44 PM, Electrocutor said:

but Windows will remain broken

 as i described without the -open -glcore method idont see any issues-just eyecandy)

or you mean that THATS the bug?(with -force the parts cuted)dont got it sry

sysinfo: win 8.1 64b ,geforce820m,dx 11 ver 6.0.3.9600

started as usual in dx9 on a nearly stock 1.4.2 64b and all works nominal,no red lines no framedrop

just the warning nerv after a time, SORRY @Shadowmage but icant live without it anymore(but can live with the warning)

Its in my Basic ksp zip-so nearly a depency -so i would scream it out when i fund a bug    -just jokin

looks so good and dont kill FPS-just genius,BIG THX @Shadowmage and U @Electrocutor

my little secretAsy5rC0.png

Spoiler

this replaces my planetshine musthave mod(less frames), u guys make it obsolete  no time is green by a100part-ship LKO, WOWGx98WaE.png

X7kgB2q.png

greetings

 BK

Edited by Burning Kan
pics added
Link to comment
Share on other sites

To those asking 'why use open-gl-core'.  This is why:

DX9/DX11 - all have screwed up reflections (this is a problem with Unity code / KSP code, nothing that I can fix):

PKPeahN.png

OpenGL / GLCore reflections are just fine:

L35cdNQ.png

Now, if -you- are okay with messed up reflections (or have reflections disabled / using legacy shaders), go ahead and use DX9/DX11.  But at that point you might as well un-install the mod entirely as you are missing out on the single most important feature.

So no, I will not be removing the warning.  No I will not be adding a 'go away' checkbox to it (for technical reasons as well).  Either use the proper graphics API, uninstall the mod, or just put up with the message.

On 4/21/2018 at 10:53 AM, Nitojmg said:

In other words: can i have the reflections and recoloring gui without the sstu part bundle?

No.

Mods need to explicitly support recoloring by creating custom configs and textures.  No other mods have made use of that feature -- so if you want recoloring, you'll have to wait for SSTU to be updated.

Link to comment
Share on other sites

For convenience:

  • opengl and d3d9 suffer from micro-stutter and performance issues
  • d3d11 and d3d12 have a broken icon shader (fixed via mod)
  • any but d3d9 in Windows has a part icon offset bug
  • all in Linux have a part icon offset bug
  • d3d9, d3d11, and d3d12 render the local+scaledspace cubemap incorrectly. (This was only an issue with d3d9 in 1.3.1)
  • d3d11 is mildly unstable, but the highest performance
  • d3d12 is heavily unstable
  • glcore has no known issues except the part icon offset bug

I'll note that Unity has only maintained d3d9 support (which is the only officially supported api on Windows for KSP) as a legacy backward compatibility up until the version that Squad/PrivateDivision used in v1.4. Newer versions of Unity have completely removed even legacy support for d3d9.

Edited by Electrocutor
Link to comment
Share on other sites

THANKS @Shadowmage & @Electrocutor for clarification & your fantastic work

2 hours ago, Shadowmage said:

So no, I will not be removing the warning.  No I will not be adding a 'go away' checkbox to it

as i sayd ican live with that)  -i know it would be much more work for u to answer much people to clarify this-its absolutly understanding

OK tested on sputnik, now i understand (not in VAB just in flight)

from now it a feature not a bug:)

thanks &

peace

 

 

 

Edited by Burning Kan
Link to comment
Share on other sites

1 hour ago, Burning Kan said:

OK tested on sputnik, now i understand (not in VAB just in flight)

Indeed -- the problem only shows up in the flight scene.  Everything appears to work properly in the editor.

(it might also work fine with under dx9 scatterer rather than stock atmo, but I did not test that combination at all)

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