Jump to content

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


Shadowmage

Recommended Posts

On 8/10/2018 at 5:32 PM, StarStreak2109 said:

That is what I was inquiring in my above post. Apparently there is a fix somewhere in this thread, but I cannot find it.

@StarStreak2109 & @alexus

Maybe where you speaking of the mod mentioned here : 

 

Maybe @Shadowmage can confirm this is the only fix to date and @Electrocutor there's no new version of it?

Anyway, I can't myself find any tool to configure Texture Unlimited IN game as I thought Shadowmage mentioned.

See you around!

Link to comment
Share on other sites

24 minutes ago, FrancoisH said:

@StarStreak2109 & @alexus

Maybe where you speaking of the mod mentioned here : 

 

Maybe @Shadowmage can confirm this is the only fix to date and @Electrocutor there's no new version of it?

Anyway, I can't myself find any tool to configure Texture Unlimited IN game as I thought Shadowmage mentioned.

See you around!

Thanks, I found that one myself in the meantime. But yeah any update on the situation is welcome!

Link to comment
Share on other sites

Hey there. Using the -force-d3d11 parameter makes my screen stutter if I'm at KSC, gives me an input lock and makes the sky look black (for some reason it only happens at KSC and not in space).

Is there any workaround to this? Let me know if you need a mod list and logs if this is not a known issue.

EDIT: Turns out KS3P can't handle dx11 which explains why the issue was momentarily fixed by unistalling that mod.

Edited by 1990eam
Link to comment
Share on other sites

3 hours ago, 1990eam said:

Hey there. Using the -force-d3d11 parameter makes my screen stutter if I'm at KSC, gives me an input lock and makes the sky look black (for some reason it only happens at KSC and not in space).

Is there any workaround to this? Let me know if you need a mod list and logs if this is not a known issue.

EDIT: Turns out KS3P can't handle dx11 which explains why the issue was momentarily fixed by unistalling that mod.

Did you try the -glcore alternative, that seems to be working for me?

Link to comment
Share on other sites

Just wanted to say thank you for this mod. I really love being able to create reflective command modules. Only thing that irks me is that, with the default stock config on spacedock, the Mk 1-3's lights don't seem to turn on anymore. A small price to pay for an otherwise beautiful capsule, methinks.

7g7b0rngc1i11.png

 

Link to comment
Share on other sites

On 8/22/2018 at 8:32 PM, 1990eam said:

Is there any way to turn off the GPU API Check warning permanently?

No -- it warns you when you are using an API that is known to no work with the mod.  Disabling the warning would serve no purpose; the mod still wouldn't work properly, you would just have one less pop up.  Why not just uninstall the mod completely if you are not interested in using it (and gain some speed in your game startup while you are at it)?

Link to comment
Share on other sites

Hi Shadowmage! Thank you so much for all your hard work on this - it's incredible!

To the Kerbalnauts trying to get the all-metal Fairings working, try this config.  It's from Shadowmage's Github page under the bug section, report #40.  Please modify the Metal and Smoothness values until you find something you like!

KSP_TEXTURE_SET
{
	name = STOCK-Fairings
	title = Default
	recolorable = false
	MATERIAL
	{
		shader = SSTU/PBR/Metallic
		//simply setting properties for metal and gloss
		PROPERTY
		{
			name = _Metal
			float = 0.75
		}
		PROPERTY
		{
			name = _Smoothness
			float = 0.75
		}
	}
}
@PART[fairingSize1,fairingSize2,fairingSize3]
{
	MODULE 
	{
		name = KSPFairingShader
		textureSet = STOCK-Fairings
		materialIndex = 0
	}
}

There's a more advanced config on the page as well.  Page can be found here: https://github.com/shadowmage45/TexturesUnlimited/issues/40#issuecomment-382565954

Here's to hoping you all fly eternal, shiny and chrome!

MpIai8V.png

Edited by Chimichanga
Link to comment
Share on other sites

Hi again Shadowmage!  You asked for this post regarding no visible window lights in MK1-3 pod, and missing lights on the Making History round pods.

First, an image showing the config is working for just these parts.  None of the windows emit light on the Mk1-3, while all of the windows on the round-pods work with the exception of the window the arrows point at:

jmnszlS.png

 

Here's the example config I isolated away from the rest of my parts (99% metal 99% shine isn't exactly my thing, as stunning as it might be - but it proves to me that the config is loading correctly.)

@REFLECTION_CONFIG[default]
{
	%enabled = true
}
KSP_MODEL_SHADER
{
	name = Stock_FullMetal
	
	model = Squad/Parts/Command/Mk1-3Pod/Mk1-3
 	model = SquadExpansion/MakingHistory/Parts/Pods/Assets/RoundPod 
		
	MATERIAL
	{
		shader = SSTU/PBR/Metallic
		
		inheritTexture = _MainTex
		inheritTexture = _BumpMap
		inheritTexture = _Emissive

		excludeMesh = FlagTransform
		excludeMesh = flagTransform
		excludeMesh = FLAG
		excludeMesh = Flag
		excludeMesh = window
		excludeMesh = Window
		excludeMesh = SideWindow
		excludeMesh = FrontWindow
		excludeMesh = indicator

		PROPERTY
		{
			name = _Metal
			float = 0.99
		}
		PROPERTY
		{
			name = _Smoothness
			float = 0.99
		}
	}
	TEXTURE // Glass
	{
		shader = SSTU/PBR/Metallic

		mesh = window
		mesh = Window
		mesh = SideWindow
		mesh = FrontWindow
		mesh = indicator

		PROPERTY
		{
			name = _Metal
			float = 0.0
		}
		PROPERTY
		{
			name = _Smoothness
			float = 1.0
		}
	}	
}

This config works just fine with other pods, allowing windows to display lights as expected.

I'm being naughty and running this with 1.4.5 x64 in DX11 on Win7, x64.  I did downgrade to 1.4.3 previously (to try to bug check something else) but can't remember if the windows worked on that version or not.

I tried my hand at guessing some of the mesh names (WINDOW vs Window vs window vs adding an 's' at the end, TopWindow, etc.) but I don't have access to Blender/Unity to check mesh names and the DebugStuff mod isn't giving me the info either.  I don't have a Github account but figured if it was indeed a bug you would be better able to post it there / handle it / do whatever miraculous things you do.  Thank you for checking, and thank you for TU!

Edited by Chimichanga
Link to comment
Share on other sites

On 8/31/2018 at 5:01 PM, Chimichanga said:

Hi again Shadowmage!  You asked for this post regarding no visible window lights in MK1-3 pod, and missing lights on the Making History round pods.

First, an image showing the config is working for just these parts.  None of the windows emit light on the Mk1-3, while all of the windows on the round-pods work with the exception of the window the arrows point at:

 

 

Here's the example config I isolated away from the rest of my parts (99% metal 99% shine isn't exactly my thing, as stunning as it might be - but it proves to me that the config is loading correctly.)


@REFLECTION_CONFIG[default]
{
	%enabled = true
}
KSP_MODEL_SHADER
{
	name = Stock_FullMetal
	
	model = Squad/Parts/Command/Mk1-3Pod/Mk1-3
 	model = SquadExpansion/MakingHistory/Parts/Pods/Assets/RoundPod 
		
	MATERIAL
	{
		shader = SSTU/PBR/Metallic
		
		inheritTexture = _MainTex
		inheritTexture = _BumpMap
		inheritTexture = _Emissive

		excludeMesh = FlagTransform
		excludeMesh = flagTransform
		excludeMesh = FLAG
		excludeMesh = Flag
		excludeMesh = window
		excludeMesh = Window
		excludeMesh = SideWindow
		excludeMesh = FrontWindow
		excludeMesh = indicator

		PROPERTY
		{
			name = _Metal
			float = 0.99
		}
		PROPERTY
		{
			name = _Smoothness
			float = 0.99
		}
	}
	TEXTURE // Glass
	{
		shader = SSTU/PBR/Metallic

		mesh = window
		mesh = Window
		mesh = SideWindow
		mesh = FrontWindow
		mesh = indicator

		PROPERTY
		{
			name = _Metal
			float = 0.0
		}
		PROPERTY
		{
			name = _Smoothness
			float = 1.0
		}
	}	
}

This config works just fine with other pods, allowing windows to display lights as expected.

I'm being naughty and running this with 1.4.5 x64 in DX11 on Win7, x64.  I did downgrade to 1.4.3 previously (to try to bug check something else) but can't remember if the windows worked on that version or not.

I tried my hand at guessing some of the mesh names (WINDOW vs Window vs window vs adding an 's' at the end, TopWindow, etc.) but I don't have access to Blender/Unity to check mesh names and the DebugStuff mod isn't giving me the info either.  I don't have a Github account but figured if it was indeed a bug you would be better able to post it there / handle it / do whatever miraculous things you do.  Thank you for checking, and thank you for TU!

 

Thanks, will try to take a look at this problem sometime this week/end.  IIRC, there was a difference between my shaders and the stock shaders, in that the TU shader expected the emissive textures' alpha channel to be > 0, and the stock shader ignores it.  Thusly, the stock textures have emissive.alpha = 0, and the glow doesn't work when used with TU shaders.  Can't say for certain that is the problem that is being encountered... but it would explain exactly what you are seeing, and why it still works in other parts (or even on only some meshes in some parts).

Link to comment
Share on other sites

Hi guys. Today I had  experimented with config of TU and I have some problems. Look at my video.

It is my config:

Spoiler

@REFLECTION_CONFIG[default]
{
    %enabled = true
}
KSP_MODEL_SHADER
{
    name = Stock_FullMetal
    
    model = Squad/Parts/Command/Mk1-3Pod/Mk1-3
     model = Squad/Parts/Command/cupola/model
    model = Squad/Spaces/cupolaInternal/model
    model = Squad/Parts/Command/advancedSasModuleLarge/model
    model = Squad/Parts/Command/externalCommandSeat/model
    model = Squad/Parts/Command/hitchhikerStorageContainer/model
    model = Squad/Parts/Command/inlineAdvancedStabilizer/model
    model = Squad/Parts/Command/inlineReactionWheel/model
    model = Squad/Parts/Command/Mk1-2Pod/model
    model = Squad/Parts/Command/mk1Cockpits/Cabin
    model = Squad/Parts/Command/mk1Cockpits/CockpitInline
    model = Squad/Parts/Command/mk1Cockpits/CockpitStandard
    model = Squad/Parts/Command/mk1LanderCan/model
    model = Squad/Parts/Command/mk1pod/model
    model = Squad/Parts/Command/mk2CockpitInline/model
    model = Squad/Parts/Command/mk2CockpitStandard/model
    model = Squad/Parts/Command/mk2DroneCore/model
    model = Squad/Parts/Command/mk2LanderCan/model
    model = Squad/Parts/Command/mk3CockpitShuttle/model
    model = Squad/Parts/Command/probeCoreCube/model
    model = Squad/Parts/Command/probeCoreHex/model
    model = Squad/Parts/Command/probeCoreOcto/model
    model = Squad/Parts/Command/probeCoreOcto2/model
    model = Squad/Parts/Command/probeRoverBody/model
    model = Squad/Parts/Command/probeStackLarge/model
    model = Squad/Parts/Command/probeStackSmall/model
    model = Squad/Parts/Command/probeStackSphere/model     

        
    MATERIAL
    {
        shader = SSTU/PBR/Metallic
        
        inheritTexture = _MainTex
        inheritTexture = _BumpMap
        inheritTexture = _Emissive

        excludeMesh = FlagTransform
        excludeMesh = flagTransform
        excludeMesh = FLAG
        excludeMesh = Flag
        excludeMesh = window
        excludeMesh = Window
        excludeMesh = SideWindow
        excludeMesh = FrontWindow
        excludeMesh = indicator

        PROPERTY
        {
            name = _Metal
            float = 0.9
        }
        PROPERTY
        {
            name = _Smoothness
            float = 0.9
        }
    }
    TEXTURE // Glass
    {
        shader = SSTU/PBR/Metallic

        mesh = window
        mesh = Window
        mesh = SideWindow
        mesh = FrontWindow
        mesh = indicator

        PROPERTY
        {
            name = _Metal
            float = 0.0
        }
        PROPERTY
        {
            name = _Smoothness
            float = 0.0
        }
    }    
}

I want to say that the glass`s effect is not changes separately from the rest.

"excludeMesh" is not work. why?

I am running the game dx11, x64, v1.4.5

Edited by alexus
Link to comment
Share on other sites

2 hours ago, alexus said:

Hi guys. Today I had  experimented with config of TU and I have some problems. Look at my video.

It is my config:

  Hide contents

@REFLECTION_CONFIG[default]
{
    %enabled = true
}
KSP_MODEL_SHADER
{
    name = Stock_FullMetal
   

        
    MATERIAL
    {
        shader = SSTU/PBR/Metallic
        
        inheritTexture = _MainTex
        inheritTexture = _BumpMap
        inheritTexture = _Emissive

        excludeMesh = FlagTransform
        excludeMesh = flagTransform
    }
    TEXTURE // Glass
    {
        shader = SSTU/PBR/Metallic

        mesh = window
        mesh = Window
        mesh = SideWindow
        mesh = FrontWindow
    }    
}

I want to say that the glass`s effect is not changes separately from the rest.

"excludeMesh" is not work. why?

I am running the game dx11, x64, v1.4.5

Your second block is TEXTURE.  Try changing it to MATERIAL like the first block.

The 'excludeMesh' feature -does- work.  Can you show a printout of the model-hierarchy for the models you are having problems with? (what are the mesh names in those models?)

Link to comment
Share on other sites

33 minutes ago, Shadowmage said:

Your second block is TEXTURE.  Try changing it to MATERIAL like the first block.

The 'excludeMesh' feature -does- work.  Can you show a printout of the model-hierarchy for the models you are having problems with? (what are the mesh names in those models?)

model = Squad/Parts/Command/cupola/model

" Can you show a printout of the model-hierarchy for the models you are having problems with? (what are the mesh names in those models?)"

How I can make it?

 

Edited by alexus
Link to comment
Share on other sites

2 hours ago, alexus said:

How I can make it?

Using 'DebugStuff' -- https://forum.kerbalspaceprogram.com/index.php?/topic/135726-1x-debugstuff-2018-03-13-see-the-hidden-secrets-of-the-game-objects/

It will allow you to 'dump to log' the model hierarchy of any part model.  This will list the mesh names for every object within the model.  IIRC you need to press 'CTRL+P' to activate it in the VAB/SPH, and then press/hold left-shift while the mouse is over a model to bring up the window showing the hierarchy for that model.  The window should have a button to 'dump to log'; from there you can copy/paste the model hierarchy out of the log file.

There may be other tools available that do the same similar from in-game (I remember something from LGG awhile back).  You can also use the Blender .mu import tool to import the models to Blender and get the hierarchy from there.

 

As it is a stock model you are having problems with, if you can't otherwise find the information, let me know and I'll see what I can do.

Link to comment
Share on other sites

13 hours ago, alexus said:

Debug button does not work :(

What should I do next?

KSP_x64_2018_09_06_09_58_00_60.jpg

Judging by the model hierarchy in the screenshot (thanks for posting that!), there is nothing you can do.  SQUAD did not make the windows as separate meshes, so they cannot be excluded from a patch in that fashion.

So this is not an error in your patch, nor is it a problem with TU; the problem is that the model was not built in an optimal fashion for this sort of operation.  About the only thing you could do would be to create custom textures for it.

Link to comment
Share on other sites

10 minutes ago, Shadowmage said:

About the only thing you could do would be to create custom textures for it.

How can i do it? I think it's impossible to do without editing the model.

Which mesh should I choose from the list for the shader? Is it meshrenderer?

Edited by alexus
Link to comment
Share on other sites

21 minutes ago, alexus said:

How can i do it? I think it's impossible to do without editing the model.

Creating textures is done with programs like Photoshop, GIMP, Paint.net, windows paint, etc (or even Substance Painter).  Find the UV map for the model you are working on, and create a metallic/specular mask texture for it.

https://academy.allegorithmic.com/courses/b6377358ad36c444f45e2deaa0626e65

 

24 minutes ago, alexus said:

Which mesh should I choose from the list for the shader? Is it meshrenderer?

After you have your custom texture created, the mesh name to which it needs to be applied would seem to be 'obj_base'.

(the meshrenderer/etc you are seeing are components that belong to the mesh objects in the model)

Link to comment
Share on other sites

Ok. if there is no window mesh how can i separate it from other mesh?

"About the only thing you could do would be to create custom textures for it. "

Will it help?

8 minutes ago, Shadowmage said:

 the mesh name to which it needs to be applied would seem to be 'obj_base'.

how?

Link to comment
Share on other sites

9 minutes ago, alexus said:

Ok. if there is no window mesh how can i separate it from other mesh?

You don't.  You create custom textures in such a way that the mesh doesn't need to be separated.  Rather than using unchanging specular and metallic values in the patch, you use the texture(s) to specify the value for each specific bit of the model.  This allows for...well..... nearly infinite possibilities in how the model is textured/rendered, and is precisely how these shaders are intended to be used (the fact that nobody wants to create actual PBR textures... frustrates me to no end).

Here is a sample of what one of those mask textures might look like (this is the MET texture for the Apollo Service module):

https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU-PBR/Assets/SC-B-SM-MET.png

 

Honestly, I would suggest -not- going this route if you don't already have texturing/modeling experience.  Unless you are already familiar with texture work, and PBR shader use of those textures, you'll have at least a couple of weeks worth of hard learning to do before you would be able to do much productive work.  Likely months/years more practice before that work might be called 'good'.  However, if you -do- want to make your own textures -- let me know when you have a texture created, and I can help you figure out how to apply it to the model in KSP.  I don't have the time, skills, or patience, to be teaching how to do texturing though.

Sadly though, those are your only options in this case due to how the model was created.  You can take the time to create custom textures to treat the windows separately, or you can use your existing patch as-is and use the model/textures as SQUAD provided.

Link to comment
Share on other sites

1 hour ago, Shadowmage said:

Judging by the model hierarchy in the screenshot (thanks for posting that!), there is nothing you can do.  SQUAD did not make the windows as separate meshes, so they cannot be excluded from a patch in that fashion.

So this is not an error in your patch, nor is it a problem with TU; the problem is that the model was not built in an optimal fashion for this sort of operation.  About the only thing you could do would be to create custom textures for it.

I think I have this same problem with the stock mk2inline dockingport...ive been fiddling with the cfg for a few days now...with no progress...has anyone been successful regarding this part? The port itself looks to gain the metallic shader..but the base/doors dont.

Link to comment
Share on other sites

7 hours ago, Shadowmage said:

Honestly, I would suggest -not- going this route if you don't already have texturing/modeling experience.  Unless you are already familiar with texture work, and PBR shader use of those textures, you'll have at least a couple of weeks worth of hard learning to do before you would be able to do much productive work.  Likely months/years more practice before that work might be called 'good'.  However, if you -do- want to make your own textures -- let me know when you have a texture created, and I can help you figure out how to apply it to the model in KSP.  I don't have the time, skills, or patience, to be teaching how to do texturing though.

Sadly though, those are your only options in this case due to how the model was created.  You can take the time to create custom textures to treat the windows separately, or you can use your existing patch as-is and use the model/textures as SQUAD provided.

Thanks for help man. I know how to work in the photoshop. I have a good experience in this.

I want to know how I can make a reflection in configuration file.

Ok. I make texture ( Which one for cupola? It has texture files cupola_Emissive,ksp_l_cupola_diff ) and what should I make change in TU config file ?

Edited by alexus
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...