Jump to content

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


Shadowmage

Recommended Posts

18 minutes ago, Jimbodiah said:

I run RSS with scatterer but without EVE/RSSVE and no SVT.  Not sure on EVE installs, but I think @tater  was running EVE/SVE and scatterer on a stock install.

I can verify that EVE & Scatterer alone work fine (DX9/DX11/OpenGL).  Even SVE works great (is actually what I use).

Its just SVT (+Kopernicus?) that cause problems under DX11 as far as I'm aware.  Not sure what part of that setup causes problems, as I don't regularly use those mods, I only know that there -are- problems....

Link to comment
Share on other sites

Pass 1 on B9 Aerospace is complete.
https://drive.google.com/open?id=1090zLtTdVYibhCIwUlwLUJZp_ChI6FA2

I only checked it vaguely as I do not usually use this mod. Let me know if anyone sees any issues.

 

Pass 1 on RemoteTech is complete.
https://drive.google.com/open?id=1HrmFqei_eppmX6zxgzOnYaRIBs8ei6lx

Edited by Electrocutor
Link to comment
Share on other sites

Just FYI. Couldn't find the strings "AVC" or "404" in the last two pages of comments, so I guess it may not have been mentioned yet.

When KSP AVC tells me that there's a new version of textures unlimited and I click "download", I get github's "404 Page Not Found" page for the URL " https://github.com/shadowmage45/SSTULabs/releases/tag/1.0.0.7 " , which matches the download URL in the version file of the latest release linked in the OP,  and but for the last numeral, matches the download URL int he version file of 1.0.0.6, which was a 6, obviously.
Somewhere, there's a muddle, which users of AVC might be confounded by.
 

Edited by DerGolgo
Link to comment
Share on other sites

4 hours ago, DerGolgo said:

Just FYI. Couldn't find the strings "AVC" or "404" in the last two pages of comments, so I guess it may not have been mentioned yet.

When KSP AVC tells me that there's a new version of textures unlimited and I click "download", I get github's "404 Page Not Found" page for the URL " https://github.com/shadowmage45/SSTULabs/releases/tag/1.0.0.7 " , which matches the download URL in the version file of the latest release linked in the OP,  and but for the last numeral, matches the download URL int he version file of 1.0.0.6, which was a 6, obviously.
Somewhere, there's a muddle, which users of AVC might be confounded by.
 

Good catch -- I may very well have specified the incorrect repo target in the .version file, would not surprise me at all (trying to do too much, end up forgetting basic stuff like that...).

https://github.com/shadowmage45/TexturesUnlimited/issues/38

Link to comment
Share on other sites

6 hours ago, Agustin said:

Galileo fixed the DX11 issue on SVT

Excellent news.  Glad I didn't have to get involved / do it myself, as that was going to be no fun getting caught up on the MFI/Kopernicus/SVT codebases.

Edit:  Looking over the change-log, it appears that it might have just been some texture related problems; was really only a couple texture files that got updated.

Edited by Shadowmage
Link to comment
Share on other sites

On 13.12.2017 at 10:46 PM, Cheesecake said:

@Electrocutor@Shadowmage Thank you booth. It works.

Sorry for my questions. I'm no modder, coder or everything else.

Another problem is now: without TR/TRR I cannot install a Skybox. Deactivating the Reflections in TR/TRR works but there are still some issues with TU-Reflections.

OK, I found a solution in Sigma Replacements.
Another question: Is it possible to give the helmet vosors of the kerbals a reflection like TR/TRR?

Edited by Cheesecake
Link to comment
Share on other sites

On 12/20/2017 at 11:39 PM, Electrocutor said:

Pass 1 on B9 Aerospace is complete.
https://drive.google.com/open?id=1090zLtTdVYibhCIwUlwLUJZp_ChI6FA2

I only checked it vaguely as I do not usually use this mod. Let me know if anyone sees any issues.

 

Pass 1 on RemoteTech is complete.
https://drive.google.com/open?id=1HrmFqei_eppmX6zxgzOnYaRIBs8ei6lx

do i need to download these or will they be integrated into the mod?

 

by the way, damn ksp, this mod should become stock, for real, hire this guy and redo ksp's look !

Link to comment
Share on other sites

2 hours ago, Jiraiyah said:

@Shadowmage I was wondering on something, is it possible to open the metal value as a slider inside the game?

	MODULE
	{
		name = KSPTextureSwitch
		canChangeInFlight = true
	}
	MODULE
	{
		name = SSTURecolorGUI
	}

I've never tested if this works as intended though.

 

2 hours ago, Jiraiyah said:

same for the rgb color we use as gray?

I'm not sure what this means?

Link to comment
Share on other sites

looks like what I am after sits here :

+KSP_TEXTURE_SET[JSat_Default]:NEEDS[TexturesUnlimited] {
	@name = JSat_DefaultMetal
	@title = Default Metal
	@TEXTURE,0 {
		@PROPERTY[_Color] {
			@color = 1.75,1.75,1.75,1.0
		}
		@PROPERTY[_Metal] {
			@float = 0.75
		}
	}
}

I want to open the color and the metal values to the user inside the game. also, each texture set is different

+KSP_TEXTURE_SET[JSat_DefaultMetal]:NEEDS[TexturesUnlimited] {
	@name = JSat_Metal
	@title = Metal
	@TEXTURE,0 {
		@shader = SSTU/PBR/Metallic
		@PROPERTY[_Smoothness] {
			@float = 0.75
		}
	}
}

in the above code, smoothness is the only param that can be changed in the game for example

KSP_COLOR_PRESET:NEEDS[TexturesUnlimited] {
	name = rgb_gray
	title = RGB Gray
	color = 127,127,127
	specular = 0
	metallic = 0
}

KSP_TEXTURE_SET:NEEDS[TexturesUnlimited] {
	name = JSat_Default
	title = Default
	recolorable = false

	TEXTURE {
		shader	= SSTU/PBR/StockMetallicBumped

		PROPERTY {
			name = _Color
			color = 1.0,1.0,1.0,1.0
		}
		PROPERTY {
			name = _Metal
			float = 0.0
		}
		PROPERTY {
			name = _Smoothness
			float = 1.0
		}
	}
	COLORS {
		mainColor = rgb_gray
		secondColor = rgb_gray
		detailColor = rgb_gray
	}
}

and in this one all three of them. what i want is to be able to change these values inside the game using sliders?

Link to comment
Share on other sites

5 hours ago, Jiraiyah said:

looks like what I am after sits here :

I want to open the color and the metal values to the user inside the game. also, each texture set is different

in the above code, smoothness is the only param that can be changed in the game for example

and in this one all three of them. what i want is to be able to change these values inside the game using sliders?

The RGB_Gray is a color preset I made because it most closely causes TINT-mode recoloring to be equal to the original colors of the diffuse.

 

To recolor parts in-game, you'll need to use the SSTU/PBR/Masked shader, create and set a _MaskTex texture with the _MainTex.A copied into _MaskTex.A and with _MaskTex.RGB set to the three-region recolor zones; then add the SSTURecolorGUI partmodule and set recolorable = true.

I'm not fond of the Masked shader because it does not work logically to how KSP works or how you'd think a masked pbr shader would; so you'll need to look at Shadowmage's SSTU config files and textures to see how to use it properly.

Edited by Electrocutor
Link to comment
Share on other sites

2 hours ago, Electrocutor said:

The RGB_Gray is a color preset I made because it most closely causes TINT-mode recoloring to be equal to the original colors of the diffuse.

 

To recolor parts in-game, you'll need to use the SSTU/PBR/Masked shader, create and set a _MaskTex texture with the _MainTex.A copied into _MaskTex.A and with _MaskTex.RGB set to the three-region recolor zones; then add the SSTURecolorGUI partmodule and set recolorable = true.

I'm not fond of the Masked shader because it does not work logically to how KSP works or how you'd think a masked pbr shader would; so you'll need to look at Shadowmage's SSTU config files and textures to see how to use it properly.

ouch, too complicated for my noob brain :wink:@Shadowmage if you had any free time, can you put a sample snippet like the one we have in this comment in hidden content for what I am looking for? I am not as familiar as many people with MM patches and using stuff like this and would gladly be a copy cat :P

Link to comment
Share on other sites

20 hours ago, Jiraiyah said:

if you had any free time, can you put a sample snippet like the one we have in this comment in hidden content

Cannot be done with patches alone, at least not with how the system is currently setup and how it is supposed to function.

  1. Create an RGB mask for your parts.  R = 'Main Color', G = 'Secondary Color', B = 'Detail Color' in the Recoloring GUI
  2. Create a new set of Diff/Spec/Met textures that are primarily gray (127,127,127), with minor highlights/shadows.
  3. Create the texture set configs like above, mark them as 'recolorable = true'
  4. Add the recoloring GUI module to the part.

Looks like you've got 3 & 4 under control.  Now you just need to figure out 1 & 2.  See the SSTU textures/configs for more examples, but here is what your diff/spec/met textures should all look like:

kR5hlDr.png

(you can have some actual details in them rather than just noise, as long as the primary color / average color is flat gray)

Edit:  Yes -- if you want recolorable parts, and want it to work properly, you have to create new textures specifically for it.  No other setup will work properly.  (some are close, but none fully work)

Edited by Shadowmage
Link to comment
Share on other sites

59 minutes ago, Shadowmage said:

Cannot be done with patches alone, at least not with how the system is currently setup and how it is supposed to function.

  1. Create an RGB mask for your parts.  R = 'Main Color', G = 'Secondary Color', B = 'Detail Color' in the Recoloring GUI
  2. Create a new set of Diff/Spec/Met textures that are primarily gray (127,127,127), with minor highlights/shadows.
  3. Create the texture set configs like above, mark them as 'recolorable = true'
  4. Add the recoloring GUI module to the part.

Looks like you've got 3 & 4 under control.  Now you just need to figure out 1 & 2.  See the SSTU textures/configs for more examples, but here is what your diff/spec/met textures should all look like:

kR5hlDr.png

(you can have some actual details in them rather than just noise, as long as the primary color / average color is flat gray)

Edit:  Yes -- if you want recolorable parts, and want it to work properly, you have to create new textures specifically for it.  No other setup will work properly.  (some are close, but none fully work)

as i said, i'm totally noob into modding, just created few parts and that is all i know :D not good enough to read a config file and rip it apart to understand what can be done, all i did was copy the code that was provided :/

Link to comment
Share on other sites

30 minutes ago, Jiraiyah said:

as i said, i'm totally noob into modding, just created few parts and that is all i know :D not good enough to read a config file and rip it apart to understand what can be done, all i did was copy the code that was provided :/

I've provided plenty of instructions, and there are tons of examples out there (either in SSTU configs, or in some of the other mods using TU).  That is all that I can do -- I'm not going to do the work for you (I don't get paid for any of this, and I don't have that much free time on my hands), nor do I exist solely to teach others modding (I had to learn all this stuff myself; glad to help out where I can, but I'm terrible at teaching as I learn 'by example' -- ripping into existing code/configs, figuring out what they do, and applying it to my own work).

Now, if you start working through the process I laid out above, and run into problems at any of those steps, please feel free to ask for assistance with whatever specific problem it is that you are encountering.

Link to comment
Share on other sites

well, I didn't want to offend you. ok, looked to some examples, here is what i found from PorkjetStock :

@PART[*]:FOR[zzzz_PorkjetStock2]:HAS[#author[*Porkjet*]&@MODEL:HAS[#model[Squad/Parts/Wheel/LandingGear/*]]]
{
	@MODULE[KSPTextureSwitch]
	{
		TEXTURESET
		{
			name = PorkjetStock_Custom_gear
		}
	}
	MODULE
	{
		name = SSTURecolorGUI
	}
}

on the part section nothing is special, but, on the texture set when he is defining the masked texture...

KSP_TEXTURE_SET
{
	name = PorkjetStock_Custom_gear
	title = Custom
	recolorable = true

	TEXTURE
	{
		shader = SSTU/PBR/StockMetallicBumped

		excludeMesh = FLAG
		excludeMesh = flare
		excludeMesh = Flare
		excludeMesh = Base
		excludeMesh = BayDoor1
		excludeMesh = BayDoor2
		excludeMesh = mesh

		PROPERTY
		{
			name = _Color
			color = 1.75,1.75,1.75
		}
		PROPERTY
		{
			name = _Metal
			float = 0.75
		}
		PROPERTY
		{
			name = _Smoothness
			float = 1.0
		}
	}
	TEXTURE
	{
		shader = SSTU/PBR/Masked
		texture = _MaskTex,Squad/Parts/Wheel/LandingGear/LandingGear

		mesh = Base
		mesh = BayDoor1
		mesh = BayDoor2
		mesh = mesh

		PROPERTY
		{
			name = _Color
			color = 1.0,1.0,1.0
		}
		PROPERTY
		{
			name = TINTING_MODE
			keyword = TINTING_MODE
		}
		PROPERTY
		{
			name = _Metal
			float = 0.0
		}
		PROPERTY
		{
			name = _Smoothness
			float = 0.0
		}
	}
	COLORS
	{
		mainColor = rgb_gray
		secondColor = rgb_gray
		detailColor = rgb_gray
	}
}

so, as i understand, here the texture was assigned to tweak the places that are color changable? and if i want to let the whole part change color i should use your gray color? am i missing something or did i get it right?

Link to comment
Share on other sites

24 minutes ago, Jiraiyah said:

so, as i understand, here the texture was assigned to tweak the places that are color changable? and if i want to let the whole part change color i should use your gray color? am i missing something or did i get it right?

Kind of, sort of.  The mask texture tells what portions of the model are recolorable.  You will -always- need a mask texture, even if it is just a fully red texture.  If you need gray textures or not will depend on what mode you want to use, see below. 

 

First, you need to decide if you want to do it the fully recolorable way (recoloring mode), or tinting way (tinting mode).

If you want to do the tinting mode -- sorry, I can't really help you with that.  You'll have to ask someone else (likely @Electrocutor as he's the only one using the system that would know how to set things up).  I don't personally support that mode, and only added it by special request -- I have no idea how the textures or configs are supposed to be setup for it.

 

If you want to do the fully recolorable way -- first start by making a mask texture for your part.  Open up the texture files for the part (you do have a .psd or .xcf for it, right?), and create a mask texture -- this texture tells the recoloring system what parts of the model are effected by the different recoloring channels.  You will want portions of the texture to either be full Red, full Green, or full Blue, depending on what recoloring channel will effect those meshes/uvs.  If there is a portion of the model that you -don't- want to be recolorable, set it to black in the mask texture.

Get back to me once you've done that (show your work -- original diffuse, and the new mask), and we can work out the creation of the recolorable diffuse/specular/metallic texture setups.

Then we can work on the configs.  (rather you can work on the configs, and I'll try and help catch/fix errors -- will likely need more information at that point like name and path of the textures, part name, etc)

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