Jump to content

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


Shadowmage

Recommended Posts

2 hours ago, Shadowmage said:

This shouldn't really be the case -- the shader should support the stock GLOW textures for cabin lights/engines/etc (emissives).  If you are having problems with that, please file a bug report on the tracker with the relevant details (configs at least, log file may be needed; some method to duplicate the problem). 

It's only for the MK1-3 pod, this is the only one which have a glow texture with an alpha channel and in addition this one is black, certainly a mistake of Squad, not a bug from your mod.

2 hours ago, Shadowmage said:

Otherwise, glad to hear you are enjoying it.  Please let me know if you run into any problems (not already on the tracker), and I'm always open to suggestions and feedback towards feature enhancements or other improvements (within reason).  If you get to a point where you want to start a forum thread for distributing your configs I can even add a link in the OP.

Currently, all I need working like clockwork but if it happen to me, I'll let you know. My only problem is that it takes time, it going slowly but surely. I hope I'll got to a point to share my work shortly (1 or 2 weeks), at that time I will give you the link of forum thread. I appreciate the offer, thank you.

Link to comment
Share on other sites

6 hours ago, Gordon Dry said:

Only one thing is "interesting": the solar panels have no reflection anymore (it was slightly, but now it's totally gone)

Yeah I think this is something I have been seeing on my VEN solar panels and maybe a couple of times with the stock ones? Problem is I spend too much time working on these configs and need to play more to really test this stuff. Cant tell if this is a bug or not cant reproduce it regularly? And it seems most of us working on these configurations are far from professionals at it? At least I know "I'm Sure Not".   

Edited by Delbrutis
Link to comment
Share on other sites

11 hours ago, Vandest said:

It's only for the MK1-3 pod, this is the only one which have a glow texture with an alpha channel and in addition this one is black, certainly a mistake of Squad, not a bug from your mod.

Ahh, yeah, that might do it.  Might still be a 'bug' too -- I'll see what the stock shaders do regarding emissive-alpha channel; likely that they ignore it/discard it.

Link to comment
Share on other sites

Bit of a bonus coming in the next release, though probably only useful to a few people --  I've fixed up/finished the UVMap Exporter tool, and added a button to trigger it to the TU-debug menu. 

This is intended as an aide to anyone who wants to create custom textures (MET/NRM) for existing parts, by making it a bit easier to get a functional UV map for the meshes within the models, and without having to use existing textures as a UV map.  It loops through every model in the KSP GameDatabase, examines the meshes in the model, creates an .svg from the triangles in the mesh, and saves these all to disk.  Fair warning -- it creates a lot of data; >500mb of uv-maps just for stock, SSTU, and KF parts.

This is the first step in potentially creating PBR textures for KerbalFoundries.  As I don't have (many of) the original modeling files, and skinned-meshes don't import from .mu back into blender very well, I really didn't have any other option.  Likely won't start on any KF-TU textures for awhile yet, but at least it is a possibility now.

Link to comment
Share on other sites

@Vandest Do you plan to patch the DLC-Parts as well? Because you seem to be very good at this. :o I really love your MK1-3 Pod. It's spot-on. :targetpro: Just beautiful!

BTW: Is it possible to determine the _Metal and _Smoothness float values from your dds-textures? Because then I could apply it to the Rockomax Tanks and Parachute to make them fit to the Mk1-3 Pod. 

I am yet to learn how to create normal map textures, edit dds-textures etc. Is Gimp capable for this?

 

Is there any way to import mu-files + dds-textures in Unity and change the shader properties on the fly? Because it's kind of inconvenient to restart KSP after every change to see the difference.

I figured out how to fix the Flag-Mesh-Issue in the DLC Pods *yay*. I use Blender to get the mesh names I want to exclude. Is there an easier way to do that?

Some examples for the DLC-Pods:

Spoiler

 

a2HWpwL.jpg

xKosa2o.jpg

PW0mPBL.jpg

GG93su5.jpg

psIk6kr.jpg

 

If someone wants to watch these settings in KSP, here is the config:

Spoiler

@REFLECTION_CONFIG[default]
{
	%enabled = true
}

KSP_MODEL_SHADER
{
	name = DLC_Pods

	model = SquadExpansion/MakingHistory/Parts/Pods/Assets/Size1_5_Lander
	model = SquadExpansion/MakingHistory/Parts/Pods/Assets/Mk2Pod
	model = SquadExpansion/MakingHistory/Parts/Pods/Assets/RoundPod

	MATERIAL // Metal
	{
		shader = SSTU/PBR/Metallic

		excludeMesh = FLAG
		excludeMesh = FLAG01
		excludeMesh = FLAG02

		PROPERTY
		{
			name = _Metal
			float = 0.6
		}
		PROPERTY
		{
			name = _Smoothness
			float = 0.65
		}
	}
}

 

 

And just for fun: Chrome Rocket and Chrome Rover ;)

Spoiler

lHUCANi.jpg

BtqnwNW.jpg

Can't say it enough: Really amazing mod, @Shadowmage! THANK YOU! It still blows my mind. :sticktongue:

Edited by Kerbaderp
Link to comment
Share on other sites

9 hours ago, Kerbaderp said:

I am yet to learn how to create normal map textures, edit dds-textures etc. Is Gimp capable for this?

Yes, with an add-on/plugin  - http://registry.gimp.org/node/70

 

9 hours ago, Kerbaderp said:

BTW: Is it possible to determine the _Metal and _Smoothness float values from your dds-textures?

_Metal = texture.r / 255
_Smoothness = texture.a / 255
Of course that only works if the texture is a singe solid color.  Mostly likely it is not, or there would be no need for a texture at all.

 

9 hours ago, Kerbaderp said:

Is there any way to import mu-files + dds-textures in Unity and change the shader properties on the fly? Because it's kind of inconvenient to restart KSP after every change to see the difference.

No, unfortunately.  You could import the .mu model to blender, re-export to .fbx, and load that .fbx into Unity.  Unfortunately, the process is neither fast, nor reliable (lots of conversion errors in the process).

You -can- use the TU shaders inside of Unity Editor.  Add these files somewhere to your Unity project -- https://github.com/shadowmage45/TexturesUnlimited/tree/master/CustomShaders

And the shaders will be available for use in the editor.  You cannot use part tools to export models using these shaders.  But you can play around with them, try various textures and parameter values.

 

9 hours ago, Kerbaderp said:

Is there an easier way to do that?

Yes -- Sarbians 'DebugStuff' mod.  Lets you view mesh names/etc from within the KSP VAB/SPH --

 

Link to comment
Share on other sites

8 minutes ago, Delay said:

Does TU work in 1.4.3? The title of the thread says "1.4.2" and no other versions are mentioned (No 1.4.X or 1.X or anything), so I assume it doesn't?

IDK, maybe, maybe not.  In theory it -should- work with 1.4.3, but I've not tested it.  There isn't any built-in version locking, so... give it a try?  The worst that it'll do is not load/not work.

Link to comment
Share on other sites

17 hours ago, Kerbaderp said:

Do you plan to patch the DLC-Parts as well?

Yes, I thought about it. But, of course, it should be in separate download and like for stock parts, it should be just a textures replacement (not an addition), so it will have to be compatible with old and new save game.

 

17 hours ago, Kerbaderp said:

Is there any way to import mu-files + dds-textures in Unity and change the shader properties on the fly? Because it's kind of inconvenient to restart KSP after every change to see the difference.

Like @Shadowmage explained, it's possible to see result in Unity, but I prefer to see what the render is in KSP, both in VAB/SPH and outdoor on tarmac, the light is different. And this for each parts.

 

6 hours ago, Delay said:

Does TU work in 1.4.3? The title of the thread says "1.4.2" and no other versions are mentioned (No 1.4.X or 1.X or anything), so I assume it doesn't?

It working well for me too in 1.4.3 (glcore).

Edited by Vandest
Link to comment
Share on other sites

This looks phenomenal! Could anyone fill me in on how to install/setup this for just the Stock parts?

" Requires special texture and shader setup "

Since having the mod installed and using '-force-glcore' in the command line haven't done anything, I grabbed the config files linked in Electrocutor's Thread but to no avail, and not entirely certain why! Any help installing this would be greatly appreciated, the screenshots look awesome.

Link to comment
Share on other sites

Does anyone have errors with -force-glcore on 1.43? My game won't launch with it bringing up an error - 

Switching to resolution 1920x1080 failed, trying lower one
All resolution switches have failed
Screen: could not switch resolution (1920x1080 fs=0 hz=0)

 

I am running with a GTX970 and latest drivers

Link to comment
Share on other sites

1 hour ago, Manwith Noname said:

@skyhawkmlt

Run regedit, CTRL+F to find...


Screenmanager Is Fullscreen mode

...make sure it is in the Kerbal Space Program folder and not the launcher. Right click on the fullscreen entry and modify the 0 value to 1.

managed, so windowed fullscreen will not work with it?

Edited by skyhawkmlt
Link to comment
Share on other sites

@skyhawkmlt

I have not had any success with it.

I did just remember though that in order to get KSP running in OpenGL I had to change the fullscreen entry in the settings.cfg to "True" and I removed the "-popupwindow" command from the launch arguments since it seems redundant. I never really investigated much further than that. I run multiple monitors so all I'm really fussed about is not having my second screen go blank (which happens with true exclusive fullscreen) and this is the case for me. I do miss the KSP window not staying visible when clicking away though.

Link to comment
Share on other sites

In the OP, the statement "This may be activated by using the '-force-glcore' command line option to launch KSP." is listed.

Where can i find a full listing of the command line parameters that are available for use, and their definitions???

many thanks for any help with this and what a great mod.  Making lots of really great looking craft for vid's and pic's.

many thanks again and Cheers.

Link to comment
Share on other sites

4 minutes ago, drtedastro said:

In the OP, the statement "This may be activated by using the '-force-glcore' command line option to launch KSP." is listed.

Where can i find a full listing of the command line parameters that are available for use, and their definitions???

many thanks for any help with this and what a great mod.  Making lots of really great looking craft for vid's and pic's.

many thanks again and Cheers.

Here. It's apparently not complete, and it's not really up to date, as it doesn't have "-force-glcore". 

There's also this list of Unity command line arguments, which should be more up to date, but how many of them are relevant, I don't know.

@Shadowmage How do you feel about people sharing TU configs for various mods on this thread? I've got a bunch of fairly basic ones I could share with people if there's any interest.

Link to comment
Share on other sites

6 hours ago, skyhawkmlt said:

Does anyone have errors with -force-glcore on 1.43? My game won't launch with it bringing up an error - 

Switching to resolution 1920x1080 failed, trying lower one
All resolution switches have failed
Screen: could not switch resolution (1920x1080 fs=0 hz=0)

 

I am running with a GTX970 and latest drivers

More info on this problem, solution from another Unity game

https://steamcommunity.com/app/222900/discussions/1/620695877218446444/

Quote

Ok, i fixed it! Found the problem!

1. Use Windows "Run" and start "regedit"
2.follow this path: HKEY_CURRENT_USER\Software\Deep Silver\Dead Island: Epidemic  //change this to the KSP path...whatever it is...
3. here you can edit the files! For me it was the false resolution! I opened the two "Screenmanager Resolution" files and added my native resolution! Now its working again!
Thanks to Prestige though, with your control panel thing, i had the idea too search for it via regedit!

And more:

https://steamcommunity.com/app/220200/discussions/0/2595630410184249428/

 

Really, is a problem with the PC settings, and nothing that I can solve directly.  It is a problem that I used to run into regularly on my own PC back in the KSP 0.90/1.0 days, and was always able to solve through registry editing and proper command-switches when launching KSP.  Lots of information on the issue in the linked posts.

55 minutes ago, UnanimousCoward said:

@Shadowmage How do you feel about people sharing TU configs for various mods on this thread? I've got a bunch of fairly basic ones I could share with people if there's any interest.

Generally I don't mind, as long as it doesn't turn into a support thread for those configs.  If you intend to be doing quite a few, or anticipate much popularity, I would suggest opening a forum thread for their release and discussion (which I will gladly link to from the OP).

Link to comment
Share on other sites

Good news in the DX9/DX11 front --

I've devised a workaround to the Unity-engine flipped-cubemap-faces problem.  I have a proof of concept fully working, though far from optimal.  Will see what I can do to get it cleaned up, tested more, and hopefully put out a release soon.  If nothing else, I'll pack up a 'dev-test' release and let you guys chomp on it for a bit.

The solution involves more rendering hacks using proxy spheres.  As the problem manifested when rendering multiple passes onto the same cubemap, I instead render each layer onto a cubemap, set that texture as a skybox on the inside of a sphere, and render that as a sphere as a background/skybox for the next layer.  So the galaxy gets rendered into a sphere, and set as the skybox for rendering the atmosphere and scaled space.  That composite image gets rendered into a sphere and used as the skybox for rendering of local space (terrain).

There will be a bit more overhead for this method, as there are additional game objects, materials, and textures being created and manipulated on every frame.  I have not yet measured it precisely, but intend to do a bit of comparison testing once I clean up the code a bit.  There may also be artifacts due to the setup of the spheres and re-rendering of the scene-as-geometry.

Edited by Shadowmage
Link to comment
Share on other sites

I am very pleased with this fantastic mod! If someone ever figures out how to configure the landing gear to be included without the lost transparency of the lights, it will be -to me- complete.

BMuzZGC.png

Link to comment
Share on other sites

@Azimech

Are these your own configs? As far as I am aware the main configs I have seen already do this. Anyway...

excludeMesh = Flare

...or FLARE needs to be added to the material setup for them. Must admit, I haven't checked if this is a problem in recent builds but I don't think it should be.

 

Edit: That's assuming you're referring to the stock gear. For mods, you'll need to find the mesh name to which the flare texture is assigned.

Edited by Manwith Noname
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...