Jump to content

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


Shadowmage

Recommended Posts

2 hours ago, HaArLiNsH said:

Hey @Shadowmage  I've just discovered this mod and I must say it look really impressive :)

I'm seriously thinking about making a big rewrite of TRR, more focused on the kerbal side and I've some question about TU, especially because we have big difficulties with the shader for our reflections.

- Is the actual version of TRR (5.4) working with TU or does it make conflict ? If yes, where ?

- Does it work on our kerbals or only on vessel part ?

- Are the reflections "real" or is it just the environment ?  I mean , in TRR, we make another camera view at each refresh interval and we create an image and this image is projected on the surface we want the reflection. This way we can see our kerbal and crafts in real time but as you know, this is not really good for the performance.

 

the main problem is probably that the current textures would be needed to be replaced. All windowshine textures use the MainTex Alpha channel as the store for the reflective value, while the PBR shaders use a own texture map for it. (same with other things like transparency and more advanced things), but the idea of modifieing the static parts withing the GameDatabase is pretty neat, because it needs only done once. 

To handover the part-reflections (windowshine) to TU, TRR must get a new shader, which supports the new U5 PBR reflection probes, but uses the alpha channel from the main texture as the smoothness source (and at some point metallic) . Thats not difficult to write and would require only a few hours of testing. 
The visor Shaders are up to you if you want them also changed. The new shader-model open ups new fancy possibilities, (like blue transparency with yellow reflections), but the missing vehicles and other kerbals might be an issue.
Converting the stock textures to PBR might be a bit painful, even with tools like substance painter it would take a few weeks to get through it. (but the effect would be amazing)
@Avera9eJoe what is your opinion? 

 

@Shadowmage I really like your work. 

How could I access your shaders from within an other mod? I gues it would be KSPShaderLoader.INSTANCE.loadedShaders   
KerbalKonstructs cannot use ModuleManager, so I must use most of the code on my own, but I don't want to handle the reflections probe nightmare by my self, so it would be cool to use TU as an optional improvement. 

 Have you seen any effects on the memory usage? 

 

Link to comment
Share on other sites

1 hour ago, HaArLiNsH said:

The shader and reflection is not a part I totally control/understand yet

The good thing is -- I have a very good grasp of the shader and reflection stuff.  At least the writing and loading of the shaders.  So if you handed that end of things off to TU, you wouldn't need to worry about it anymore.

1 hour ago, HaArLiNsH said:

I can already tell you that a option to be able to choose if we want to reflect our kerbals and vessels (and be performance consuming) or not is definitively something that "need" to be looked at. 

Yeah, I'm willing to look into implementing it at least as an 'option'.  Kerbals reflections are much easier to justify as they would be very cheap, and including them could be part of the default setup.  Non-active Vessels could also be done without 'too much' overhead, but I'de probably leave that as 'default = disabled'.  Active vessel-self-reflections are mostly off the table though (unless a better way to do them can be found) -- doing a per-part-cubemap is simply not feasible, and kills performance quickly even on smaller vessels (e.g. the active vessel could reflect other vessels in the scene, but would not reflect parts of itself).

Still, something we can discuss/work out.  As long as the features are optional, I really don't mind having additional options for visual enhancements at the cost of performance (even the per-part reflections could be an option, though I'd prefer to devote dev time to other things first).

 

1 hour ago, HaArLiNsH said:

The more it goes, the more I'm interested in the customization of our kerbals and I'll be grateful if you can save me from the shader/reflection nightmare. I've open the body swapping Pandora's box and now I'm really focus on this.

Indeed.  I think the specialization of the mods is a good point.  TU can do what it is good at (shaders, reflection probe stuff), and TRR can focus on what it is good at (texture replacement).  I wouldn't mind handing -all- texture switching / texture set functionality off to another mod; no reason to duplicate the functions (the only gotcha would be to somehow still allow for recoloring support in texture-switch equipped parts when recoloring shaders are used, but some sort of interface/generic system could likely be developed for this purpose).

 

1 hour ago, HaArLiNsH said:

Also, I don't know if this is in your domain, but I'm also interested in adding a glow layer on our kerbal so we could have suits with glowing part. This and why not a metallic shader could allow us to make wonderful and crazy suits

Totally doable.  In fact I believe that the shader that I've linked below (stock metallic bumped) already has emissive support.  And as they are PBR shaders, they come with reflection/metallic support by default.

 

1 hour ago, HaArLiNsH said:

I think we can discuss this in more detail in PM.

Sounds good.  I would say that we aim for a combined release of the rewritten versions to coincide with KSP 1.4; but that is because I'm already planning on a few other potentially 'breaking' changes at the time in my various mods.  Would also give us a decent amount of time to work out the problems and do some thorough testing.  Anyhow, if I don't hear from you by the weekend, I'll probably reach out to get things rolling.  I'm not in any huge rush on any of it, but would like to get things started sooner rather than later so that good plans can be drawn out.

 

 

1 hour ago, Ger_space said:

How could I access your shaders from within an other mod? I gues it would be KSPShaderLoader.INSTANCE.loadedShaders   

You can actually do it without a compile-time dependency on TU by using the stock KSP  GameDatabase.loadedShaders  list of shaders (or whatever it is named).  Pretty sure I add them to that list after TU loads.  And as TU loads close to first in the plugin list, the shaders should be available for most other mods during loading (more work can be done on this aspect if needed).

1 hour ago, Ger_space said:

All windowshine textures use the MainTex Alpha channel as the store for the reflective value,

There are multiple PBR shaders included with TU.  One of them explicitly pulls its alpha/transparency/specular value from the diffuse.alpha channel --  https://github.com/shadowmage45/TexturesUnlimited/blob/master/CustomShaders/SSTU-PBR-StockMetallicBumped.shader  (metallic value still needs a new texture provided though; there is no way to extract metallic values from the existing stock textures, the data simply doesn't exist; you can set the 'metal' property in such a way as to disable the metallic effects though, turning it into nothing more than a specular shader with reflections).

So... nothing new should be needed shader wise.  Just need to supply either a metallic texture, and/or set the metallic ('metal') property in the shader appropriately for your use.

1 hour ago, Ger_space said:

To handover the part-reflections (windowshine) to TU, TRR must get a new shader, which supports the new U5 PBR reflection probes

See the above; no new shaders should be needed, they already exist, and should be able to be easily used by external mods :)

 

In regards to window reflections -- you might want to check out the patch sets by @Electrocutor and @Manwith Noname -- they have not only window reflections working, but often full conversions of parts (both stock + other mods).

Link to comment
Share on other sites

@Ger_space

I'm kinda glad you showed up, heh. I had a thought a week ago of trying to target KSC with these shaders and went on a bit of a search that left me feeling it's a lot of digging in to asset bundles which I've never done and not really equiped to do but I had a side thought of KerbalKonstructs and messed about a bit.

Spoiler

D513EA7A9D20F7DF8CC1AED582EB16E00918067A

I've not done anything serious or got very far with completing the idea, it was just a proof of concept to see if it was possible. I used the model shader available to target the door mesh...

Spoiler

KSP_MODEL_SHADER
{
	name = KSide_Hangars

	model = KerbinSide/CoreAssets/ksidehangars1

	TEXTURE
	{
		shader = SSTU/PBR/Metallic

		mesh = doors

		PROPERTY
		{
			name = _Metal
			float = 0.75
		}
		PROPERTY
		{
			name = _Smoothness
			float = 1.0
		}
		PROPERTY
		{
			name = _Color
			color = 1.3,1.3,1.3
		}
	}
}

 

I wouldn't use that as a final config (I was just messing around) but it might help you understand how you can apply the shaders to Kerbal Konstruct structures. I didn't get round to trying the other shaders or fine tuning parameters.

Edited by Manwith Noname
Link to comment
Share on other sites

2 hours ago, Ger_space said:

the main problem is probably that the current textures would be needed to be replaced. All windowshine textures use the MainTex Alpha channel as the store for the reflective value, while the PBR shaders use a own texture map for it. (same with other things like transparency and more advanced things), but the idea of modifieing the static parts withing the GameDatabase is pretty neat, because it needs only done once. 

To handover the part-reflections (windowshine) to TU, TRR must get a new shader, which supports the new U5 PBR reflection probes, but uses the alpha channel from the main texture as the smoothness source (and at some point metallic) . Thats not difficult to write and would require only a few hours of testing. 
The visor Shaders are up to you if you want them also changed. The new shader-model open ups new fancy possibilities, (like blue transparency with yellow reflections), but the missing vehicles and other kerbals might be an issue.
Converting the stock textures to PBR might be a bit painful, even with tools like substance painter it would take a few weeks to get through it. (but the effect would be amazing)
@Avera9eJoe what is your opinion? 

 

@Shadowmage I really like your work. 

How could I access your shaders from within an other mod? I gues it would be KSPShaderLoader.INSTANCE.loadedShaders   
KerbalKonstructs cannot use ModuleManager, so I must use most of the code on my own, but I don't want to handle the reflections probe nightmare by my self, so it would be cool to use TU as an optional improvement. 

 Have you seen any effects on the memory usage? 

 

Hm, It would look really cool and I'd be happy to use it in WindowShine but I don't think I have the skill/motivation to do a good enough job at re-editing the textures. Seriously all I did for WindowShine was fade the transparency of certain parts of the textures.

Edited by Avera9eJoe
Link to comment
Share on other sites

1 hour ago, Manwith Noname said:

@Ger_space

I'm kinda glad you showed up, heh. I had a thought a week ago of trying to target KSC with these shaders and went on a bit of a search that left me feeling it's a lot of digging in to asset bundles which I've never done and not really equiped to do but I had a side thought of KerbalKonstructs and messed about a bit.

  Reveal hidden contents

D513EA7A9D20F7DF8CC1AED582EB16E00918067A

I've not done anything serious or got very far with completing the idea, it was just a proof of concept to see if it was possible. I used the model shader available to target the door mesh...

  Hide contents


KSP_MODEL_SHADER
{
	name = KSide_Hangars

	model = KerbinSide/CoreAssets/ksidehangars1

	TEXTURE
	{
		shader = SSTU/PBR/Metallic

		mesh = doors

		PROPERTY
		{
			name = _Metal
			float = 0.75
		}
		PROPERTY
		{
			name = _Smoothness
			float = 1.0
		}
		PROPERTY
		{
			name = _Color
			color = 1.3,1.3,1.3
		}
	}
}

 

I wouldn't use that as a final config (I was just messing around) but it might help you understand how you can apply the shaders to Kerbal Konstruct structures. I didn't get round to trying the other shaders or fine tuning parameters.

That was easier than I expected. That way I could provide normal textures for distribution and pbr on new assets I'll create over time.

I use substance painter, so it's easy for me to provide multiple texture formats for  a single object. All I have to do is to create the cfg file and export everything. 

You can target the ksc structures In ksp. They are all accessible in game, but only slightly hidden. They don't show up as normal object assets, but I already cloned them within kk, so they can be used to create new bases.

I was able to extract every single mesh of the bases and all the anomalies. 

So either I commit a patch to TU for accessing them or I add a cfg interface into KK. 

If you want to look, check the LoadSquadKSCModels

LoadSquadmodels

Functions in the kerbalkonstructs.cs 

The .prefab is the model you want to modify.

( Sorry I'm only on my mobile phone, so it's hard to type better instructions.)

Link to comment
Share on other sites

@Shadowmage While adding TU support to the FUR rover mod i also played around with the Masked shaders but the results didn't really satisfy me (at least the results in unity). Then i read that you want to replace them, so i played around a bit with the SSTU-PBR-StockMetallicBumped shader in unity and i think a came up with a quite usable adaption of this shader for recoloring:

uwtEq0z.png

It allows a quite high saturation of the colors and also allows to lighten/darken via the alpha channel of the each of the three colors (0.5 being the defaullt). To make it usable one only needs one mask texture that is simular to the ones currently used (or at least i think so)
The only one restriction for the mask textures would be that the sum of R+G+B of each pixel should not exceed 255 or else the mask itself will darken the textues. Sums lower than 255 will lower the intensity of the recoloration (e.g. a sum of 128 will only recolor the part by 50%)

The code is only a very small adaption of your  SSTU-PBR-StockMetallicBumped version and should also be usable the same way in a masked version of the SSTU-PBR-Metallic shader:

Shader "SSTU/PBR/StockMetallicBumpedMasked"
{
    Properties 
    {
        _MainTex("_MainTex (RGB)", 2D) = "white" {}
        _MaskColor1 ("Mask Color 1", Color) = (1,1,1,0.5)
        _MaskColor2 ("Mask Color 2", Color) = (1,1,1,0.5)
        _MaskColor3 ("Mask Color 3", Color) = (1,1,1,0.5)
        _MaskTex("_MaskTex (Grayscale)", 2D) = "black" {}
        _MetallicGlossMap("_MetallicGlossMap (RGB)", 2D) = "white" {}
        _BumpMap("_BumpMap (NRM)", 2D) = "bump" {}
        _AOMap("_AOMap (Grayscale)", 2D) = "white" {}
        _Metal("_Metal", Range(0,1)) = 1
        _Smoothness("_Smoothness", Range(0,1)) = 1
        _Emissive("Emission", 2D) = "white" {}
        _EmissiveColor("EmissionColor", Color) = (0,0,0)
        _Opacity("Emission Opacity", Range(0,1) ) = 1
        _RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
        _RimColor("_RimColor", Color) = (0,0,0,0)
        _TemperatureColor("_TemperatureColor", Color) = (0,0,0,0)
        _BurnColor ("Burn Color", Color) = (1,1,1,1)
    }
    
    SubShader
    {
        Tags {"RenderType"="Opaque"}
        ZWrite On
        ZTest LEqual
        Blend SrcAlpha OneMinusSrcAlpha

        CGPROGRAM

        #pragma surface surf Standard keepalpha
        #pragma target 3.0
        #pragma multi_compile __ ALBEDOALPHA_INVERT
        #include "SSTUShaders.cginc"
                
        sampler2D _MainTex;
        sampler2D _Emissive;
        sampler2D _MaskTex;
        sampler2D _MetallicGlossMap;
        sampler2D _BumpMap;     
        sampler2D _AOMap;

        float _Metal;
        float _Smoothness;
        float _Opacity;
        float _MaskBase;
        float4 _MaskColor1;
        float4 _MaskColor2;
        float4 _MaskColor3;
        float4 _EmissiveColor;
        float4 _TemperatureColor;
        float4 _RimColor;
        float _RimFalloff;
        
        struct Input
        {
            float2 uv_MainTex;
            float3 viewDir;
        };
        
        void surf (Input IN, inout SurfaceOutputStandard o)
        {
            fixed4 color = tex2D(_MainTex,(IN.uv_MainTex));
            float4 mask = tex2D(_MaskTex, (IN.uv_MainTex));
            fixed4 spec = tex2D(_MetallicGlossMap, (IN.uv_MainTex));
            fixed3 normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex));
            fixed4 ao = tex2D(_AOMap, (IN.uv_MainTex));
            fixed4 glow = tex2D(_Emissive, (IN.uv_MainTex));
            #if ALBEDOALPHA_INVERT
                color.a = 1 - color.a;
            #endif
            
            float color1Mult = _MaskColor1.a*2;
            float color2Mult = _MaskColor2.a*2;
            float color3Mult = _MaskColor3.a*2;
            
            
            float3 userColor = mask.rrr*_MaskColor1.rgb*color1Mult + mask.ggg*_MaskColor2.rgb*color2Mult + mask.bbb*_MaskColor3.rgb*color3Mult;
            fixed m = 1 - (mask.r + mask.g + mask.b);
            
            o.Albedo = saturate(color.rgb * (userColor + m));
            o.Normal = normal;
            o.Emission = glow.rgb * glow.aaa * _EmissiveColor.rgb *_EmissiveColor.aaa + stockEmit(IN.viewDir, normal, _RimColor, _RimFalloff, _TemperatureColor) * _Opacity;
            o.Metallic = spec.r * _Metal;
            o.Smoothness = color.a * _Smoothness;
            o.Occlusion = ao.r;
            o.Alpha = _Opacity;
        }
        ENDCG
    }
    Fallback "Bumped Specular"
}

Edit: corrected small error in shader

Edited by Nils277
Link to comment
Share on other sites

1 hour ago, Nils277 said:

@Shadowmage While adding TU support to the FUR rover mod i also played around with the Masked shaders but the results didn't really satisfy me (at least the results in unity). Then i read that you want to replace them, so i played around a bit with the SSTU-PBR-StockMetallicBumped shader in unity and i think a came up with a quite usable adaption of this shader for recoloring:

uwtEq0z.png

It allows a quite high saturation of the colors and also allows to lighten/darken via the alpha channel of the each of the three colors (0.5 being the defaullt). To make it usable one only needs one mask texture that is simular to the ones currently used (or at least i think so)
The only one restriction for the mask textures would be that the sum of R+G+B of each pixel should not exceed 255 or else the mask itself will darken the textues. Sums lower than 255 will lower the intensity of the recoloration (e.g. a sum of 128 will only recolor the part by 50%)

The code is only a very small adaption of your  SSTU-PBR-StockMetallicBumped version and should also be usable the same way in a masked version of the SSTU-PBR-Metallic shader:


Shader "SSTU/PBR/StockMetallicBumpedMasked"
{
    Properties 
    {
        _MainTex("_MainTex (RGB)", 2D) = "white" {}
        _MaskColor1 ("Mask Color 1", Color) = (1,1,1,0.5)
        _MaskColor2 ("Mask Color 2", Color) = (1,1,1,0.5)
        _MaskColor3 ("Mask Color 3", Color) = (1,1,1,0.5)
        _MaskTex("_MaskTex (Grayscale)", 2D) = "black" {}
        _MetallicGlossMap("_MetallicGlossMap (RGB)", 2D) = "white" {}
        _BumpMap("_BumpMap (NRM)", 2D) = "bump" {}
        _AOMap("_AOMap (Grayscale)", 2D) = "white" {}
        _Metal("_Metal", Range(0,1)) = 1
        _Smoothness("_Smoothness", Range(0,1)) = 1
        _Emissive("Emission", 2D) = "white" {}
        _EmissiveColor("EmissionColor", Color) = (0,0,0)
        _Opacity("Emission Opacity", Range(0,1) ) = 1
        _RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
        _RimColor("_RimColor", Color) = (0,0,0,0)
        _TemperatureColor("_TemperatureColor", Color) = (0,0,0,0)
        _BurnColor ("Burn Color", Color) = (1,1,1,1)
    }
    
    SubShader
    {
        Tags {"RenderType"="Opaque"}
        ZWrite On
        ZTest LEqual
        Blend SrcAlpha OneMinusSrcAlpha

        CGPROGRAM

        #pragma surface surf Standard keepalpha
        #pragma target 3.0
        #pragma multi_compile __ ALBEDOALPHA_INVERT
        #include "SSTUShaders.cginc"
                
        sampler2D _MainTex;
        sampler2D _Emissive;
        sampler2D _MaskTex;
        sampler2D _MetallicGlossMap;
        sampler2D _BumpMap;     
        sampler2D _AOMap;

        float _Metal;
        float _Smoothness;
        float _Opacity;
        float _MaskBase;
        float4 _MaskColor1;
        float4 _MaskColor2;
        float4 _MaskColor3;
        float4 _EmissiveColor;
        float4 _TemperatureColor;
        float4 _RimColor;
        float _RimFalloff;
        
        struct Input
        {
            float2 uv_MainTex;
            float3 viewDir;
        };
        
        void surf (Input IN, inout SurfaceOutputStandard o)
        {
            fixed4 color = tex2D(_MainTex,(IN.uv_MainTex));
            float4 mask = tex2D(_MaskTex, (IN.uv_MainTex));
            fixed4 spec = tex2D(_MetallicGlossMap, (IN.uv_MainTex));
            fixed3 normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex));
            fixed4 ao = tex2D(_AOMap, (IN.uv_MainTex));
            fixed4 glow = tex2D(_Emissive, (IN.uv_MainTex));
            #if ALBEDOALPHA_INVERT
                color.a = 1 - color.a;
            #endif
            
            float color1Mult = _MaskColor1.a*2;
            float color2Mult = _MaskColor2.a*2;
            float color3Mult = _MaskColor3.a*2;
            
            
            float3 userColor = mask.rrr*_MaskColor1.rgb*color1Mult + mask.ggg*_MaskColor2.rgb*color2Mult + mask.bbb*_MaskColor3.rgb*color3Mult;
            fixed m = 1 - (mask.r + mask.g + mask.b);
            
            o.Albedo = saturate(color.rgb * (userColor + m));
            o.Normal = normal;
            o.Emission = glow.rgb * glow.aaa * _EmissiveColor.rgb *_EmissiveColor.aaa + stockEmit(IN.viewDir, normal, _RimColor, _RimFalloff, _TemperatureColor) * _Opacity;
            o.Metallic = spec.r * _Metal;
            o.Smoothness = color.a * _Smoothness;
            o.Occlusion = ao.r;
            o.Alpha = _Opacity;
        }
        ENDCG
    }
    Fallback "Bumped Specular"
}

Edit: corrected small error in shader

I saw that Homeworld logo and immediately had to comment on it :D Nice pick! Did you play the original release or was it the remastered version that hooked you? Sorry to be off topic :P

Link to comment
Share on other sites

10 hours ago, Nils277 said:

@Shadowmage While adding TU support to the FUR rover mod i also played around with the Masked shaders but the results didn't really satisfy me (at least the results in unity). Then i read that you want to replace them, so i played around a bit with the SSTU-PBR-StockMetallicBumped shader in unity and i think a came up with a quite usable adaption of this shader for recoloring:

 

It allows a quite high saturation of the colors and also allows to lighten/darken via the alpha channel of the each of the three colors (0.5 being the defaullt). To make it usable one only needs one mask texture that is simular to the ones currently used (or at least i think so)
The only one restriction for the mask textures would be that the sum of R+G+B of each pixel should not exceed 255 or else the mask itself will darken the textues. Sums lower than 255 will lower the intensity of the recoloration (e.g. a sum of 128 will only recolor the part by 50%)

The code is only a very small adaption of your  SSTU-PBR-StockMetallicBumped version and should also be usable the same way in a masked version of the SSTU-PBR-Metallic shader:

Edit: corrected small error in shader

Very interesting.  Will have to play around with this shader a bit to see how well it compares with the other recoloring options.

Does it solve the issue of recoloring of existing textures that already have a (non-white) base color?  E.g.  Turning an existing 'black' portion of a texture to 'white' or 'red'.

 

You should be able to compile that shader into an asset bundle and get it loading into KSP if you wanted to try things out in-game.  TU includes code to load any asset bundle with a file extension of .ssf, and load any shaders it finds in those bundles.

Add this script somewhere to your Unity Editor assets folder (it will add an 'build asset bundle' option to the Assets menu):  https://github.com/shadowmage45/TexturesUnlimited/blob/master/CustomShaders/AssetBundleCompiler.cs

From there you should be able to highlight your new shader file, use the Assets menu option -> ' Assets/Build Selected AssetBundle Win64 ', give it a name ending with '.ssf', and copy that asset bundle into your KSP GameData folder somewhere.  The TU loading code should automatically find that asset bundle, load the shader, and make it available for use through any of the existing TU material/texture manipulation methods.

The one bit that I'm slightly unsure of, is if you would need to include the SSTUShaders.cginc file in your bundle, or if it will properly compile the shader to use the one in the existing TU shader bundles.  Might not hurt to include both your custom shader and that .cginc file when you build the asset bundle.

(if you give that a try and it doesn't work, please let me know and I'll look into finding/writing better instructions;  seems that I'm missing one of my UnityEditor asset bundle build scripts in the repo that would make the process a bit easier; you may or may not need to assign the shader files to an asset bundle for the linked compile script to actually work.  If/when I find my updated script I'll link/post it, as it greatly simplifies the entire process.)

 

 

21 hours ago, Ger_space said:

So either I commit a patch to TU for accessing them or I add a cfg interface into KK. 

I'm a bit curious as to how this would function (and could use similar features for adjusting other stock 'hidden' meshes/materials).  Is there a way to access the KSP assets that are loaded from asset bundles, in such a manner as to 'fix' them at a prefab level?  (trying to avoid having to adjust materials on scene changes/etc; much prefer 'fixing' it once at the lowest level)

Link to comment
Share on other sites

13 minutes ago, Shadowmage said:

 

I'm a bit curious as to how this would function (and could use similar features for adjusting other stock 'hidden' meshes/materials).  Is there a way to access the KSP assets that are loaded from asset bundles, in such a manner as to 'fix' them at a prefab level?  (trying to avoid having to adjust materials on scene changes/etc; much prefer 'fixing' it once at the lowest level)

 

We definitively can access the KSP assets (sharedassets) but the problem is that we can only access them when the scene is loaded. So for example you can't access the kerbal mechanics on the flight scene, only in the editor scene (so the 2 hangars).  I think you can either maybe fix them directly or you have to make another gameObject and clone the asset in this gameObject and then you destroy the base one. I'm looking into this to access to the other kerbal bodies.

Here is a "proof of concept" (unfortunately, here the bones seems to be different and I still have a lot of digging to do to fix it)
gqYRy4d.png
 

Link to comment
Share on other sites

56 minutes ago, Shadowmage said:

I'm a bit curious as to how this would function (and could use similar features for adjusting other stock 'hidden' meshes/materials).  Is there a way to access the KSP assets that are loaded from asset bundles, in such a manner as to 'fix' them at a prefab level?  (trying to avoid having to adjust materials on scene changes/etc; much prefer 'fixing' it once at the lowest level)

I got at the meshes through the upgradeableFacilities structure, but they only need to be edited once. After that they stay the same. 

Others I haven't searched for, but a component search should be able bring them up. ( Kerbals have the kerbaleva component) of just search for all game objects which have the renderer component and filter out for the once you want to modify. 

Link to comment
Share on other sites

1 hour ago, HaArLiNsH said:

We definitively can access the KSP assets (sharedassets) but the problem is that we can only access them when the scene is loaded. So for example you can't access the kerbal mechanics on the flight scene, only in the editor scene (so the 2 hangars).  I think you can either maybe fix them directly or you have to make another gameObject and clone the asset in this gameObject and then you destroy the base one. I'm looking into this to access to the other kerbal bodies.

Here is a "proof of concept" (unfortunately, here the bones seems to be different and I still have a lot of digging to do to fix it)
gqYRy4d.png
 

Ate you very sure that kerbal prefabs cannot be accessed? 

Look here

I used this code a few versions ago to add part modules to the kerbal prefabs. 

The trick is to access the parts.prefab extension from the partlist. I don't know if it's still possible to use it, but I think it was possible to do this at least in the spacecenter scene.

Link to comment
Share on other sites

1 minute ago, Ger_space said:

Ate you very sure that kerbal prefabs cannot be accessed? 

Look here

I used this code a few versions ago to add part modules to the kerbal prefabs. 

The trick is to access the parts.prefab extension from the partlist. I don't know if it's still possible to use it, but I think it was possible to do this at least in the spacecenter scene.

I'm saying that they CAN be accessed :). the hard is to find the hierarchy of all the things. 

But you can only access the sharedasset that is loaded in the scene, and we can access all the part that are in the Gamedata folder without any problem too. I'm sure if we can change them permanently (I mean for the entire play session, even if we change scene)

If I've understand how unity works, you can change/copy the shader and materials of all the gameobject but you can't just copy the mesh, you need to make another game object and "clone" the mesh in it. Otherwise it will be destroyed. But I think I'm digressing from the main question :)

Link to comment
Share on other sites

@Shadowmage will try to make the shader run in KSP to see its results in "reality". Thanks for the help and explanation on how to do this.

Regarding your question for coloring completely black parts, the shader above does not, but i made a small change to the code and it now can:

1KXnTs3.png

 The red on the dark and bright parts originate from the same Mask Color

The mask textures now uses its alpha channel to determine how much a certain part of the masked texture is brightened before recoloring it. A value of 255 keeps the texures as is, all values below brighten it. The inverse usage of the alpha channel makes sure that all previously created mask textures behave the same as before. The brightening is weighted for each RGB channel with the formula for luminance to keep the perceived brightness for the human eye level and also to retain the structure of the textures. 

A proper use of the alpha channel might make the usage of  the alpha channel for the 3 mask colors superfluous because the color will have the same brightness regardless of the underlying texture.

Shader "SSTU/PBR/StockMetallicBumpedMasked"
{
    Properties 
    {
        _MainTex("_MainTex (RGB)", 2D) = "white" {}
        _MaskColor1 ("Mask Color 1", Color) = (1,1,1,1)
        _MaskColor2 ("Mask Color 2", Color) = (1,1,1,1)
        _MaskColor3 ("Mask Color 3", Color) = (1,1,1,1)
        _MaskTex("_MaskTex (Grayscale)", 2D) = "black" {}
        _MetallicGlossMap("_MetallicGlossMap (RGB)", 2D) = "white" {}
        _BumpMap("_BumpMap (NRM)", 2D) = "bump" {}
        _AOMap("_AOMap (Grayscale)", 2D) = "white" {}
        _Metal("_Metal", Range(0,1)) = 1
        _Smoothness("_Smoothness", Range(0,1)) = 1
        _Emissive("Emission", 2D) = "white" {}
        _EmissiveColor("EmissionColor", Color) = (0,0,0)
        _Opacity("Emission Opacity", Range(0,1) ) = 1
        _RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
        _RimColor("_RimColor", Color) = (0,0,0,0)
        _TemperatureColor("_TemperatureColor", Color) = (0,0,0,0)
        _BurnColor ("Burn Color", Color) = (1,1,1,1)
    }
    
    SubShader
    {
        Tags {"RenderType"="Opaque"}
        ZWrite On
        ZTest LEqual
        Blend SrcAlpha OneMinusSrcAlpha

        CGPROGRAM

        #pragma surface surf Standard keepalpha
        #pragma target 3.0
        #pragma multi_compile __ ALBEDOALPHA_INVERT
        #include "SSTUShaders.cginc"
                
        sampler2D _MainTex;
        sampler2D _Emissive;
        sampler2D _MaskTex;
        sampler2D _MetallicGlossMap;
        sampler2D _BumpMap;     
        sampler2D _AOMap;

        float _Metal;
        float _Smoothness;
        float _Opacity;
        float _MaskBase;
        float4 _MaskColor1;
        float4 _MaskColor2;
        float4 _MaskColor3;
        float4 _EmissiveColor;
        float4 _TemperatureColor;
        float4 _RimColor;
        float _RimFalloff;
        
        struct Input
        {
            float2 uv_MainTex;
            float3 viewDir;
        };
        
        void surf (Input IN, inout SurfaceOutputStandard o)
        {
            fixed4 color = tex2D(_MainTex,(IN.uv_MainTex));
            float4 mask = tex2D(_MaskTex, (IN.uv_MainTex));
            fixed4 spec = tex2D(_MetallicGlossMap, (IN.uv_MainTex));
            fixed3 normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex));
            fixed4 ao = tex2D(_AOMap, (IN.uv_MainTex));
            fixed4 glow = tex2D(_Emissive, (IN.uv_MainTex));
            #if ALBEDOALPHA_INVERT
                color.a = 1 - color.a;
            #endif
            
            //get the luminance of the color
            float luma = 0.2126*color.r + 0.7172*color.g + 0.0722*color.b;
            
            //get the color for the mask
            float3 userColor = mask.rrr*_MaskColor1.rgb*_MaskColor1.aaa + mask.ggg*_MaskColor2.rgb*_MaskColor2.aaa + mask.bbb*_MaskColor3.rgb*_MaskColor3.aaa;
            
            //get the luminance value for the color
            float3 userColorLuma = userColor*(1-mask.a);
            
            //factor to interpolate between masked and non masked colors
            float maskFactor = (mask.r*_MaskColor1.a + mask.g*_MaskColor2.a + mask.b*_MaskColor3.a);
            float colorFactor = 1 - maskFactor;
            
            o.Albedo = saturate(maskFactor*luma*(userColor + colorFactor) + userColorLuma + colorFactor*color);
            o.Normal = normal;
            o.Emission = glow.rgb * glow.aaa * _EmissiveColor.rgb *_EmissiveColor.aaa + stockEmit(IN.viewDir, normal, _RimColor, _RimFalloff, _TemperatureColor) * _Opacity;
            o.Metallic = spec.r * _Metal;
            o.Smoothness = color.a * _Smoothness;
            o.Occlusion = ao.r;
            o.Alpha = _Opacity;
        }
        ENDCG
    }
    Fallback "Bumped Specular"
}

I can send you the used textures/masks if you want to experiment with them :wink: 

Edit: Making the the alpha channel for the Mask texture is actually quite easy because the pixels should have the average brightness of the texture they are coloring. E.g. when the base color has a brightness of around 128, then the alpha channel for that part should also have 128.
The last remaining problem is that it does not work that perfect for parts that are already colored.

Edit 2: Done, color and brigthness of the base texture don't matter now (while retaining the brightness details):

gquqYzV.png

In this image, the base color is by default colored green instead of dark gray/black in the middle part

Edit 3: Sorry for spamming, changed the code again slightly. The alpha channel of the user defined colors is now used to set the intensity of the coloration. So if a user wants one channel to not effect the part (that much), they can reduce the value of the alpha channel.

The updated code is in the above code box

 

Edited by Nils277
Link to comment
Share on other sites

Okay, so I'm not doing anything near as fancy as the rest of you, but I have to say, this mod breathes some new life into some really old parts.  Anyone remember the JARFR Tri-Hexagonal trusses from 5 years ago?

kCP6Df.jpg

Just adding the metallic finish takes them from "meh" (like the plain gray part right below the probe core above) to "that looks cool".

Now I need to figure out how to do something more advanced.  If I understand the documentation for the shaders on GitHub, I should be able to make my own metallic gloss map and retrofit it to an existing older part, right? (not these things - their textures are trivial)  That would allow me to control which regions of a part would be metallic, and how mirror-shiny regions would be.  My first attempt didn't work, but that may be because I didn't do it right.

Link to comment
Share on other sites

6 hours ago, Nils277 said:

@Shadowmage will try to make the shader run in KSP to see its results in "reality". Thanks for the help and explanation on how to do this.

Regarding your question for coloring completely black parts, the shader above does not, but i made a small change to the code and it now can:

1KXnTs3.png

 The red on the dark and bright parts originate from the same Mask Color

The mask textures now uses its alpha channel to determine how much a certain part of the masked texture is brightened before recoloring it. A value of 255 keeps the texures as is, all values below brighten it. The inverse usage of the alpha channel makes sure that all previously created mask textures behave the same as before. The brightening is weighted for each RGB channel with the formula for luminance to keep the perceived brightness for the human eye level and also to retain the structure of the textures. 

A proper use of the alpha channel might make the usage of  the alpha channel for the 3 mask colors superfluous because the color will have the same brightness regardless of the underlying texture.

I can send you the used textures/masks if you want to experiment with them :wink: 

Edit: Making the the alpha channel for the Mask texture is actually quite easy because the pixels should have the average brightness of the texture they are coloring. E.g. when the base color has a brightness of around 128, then the alpha channel for that part should also have 128.
The last remaining problem is that it does not work that perfect for parts that are already colored.

Edit 2: Done, color and brigthness of the base texture don't matter now (while retaining the brightness details):

gquqYzV.png

In this image, the base color is by default colored green instead of dark gray/black in the middle part

Edit 3: Sorry for spamming, changed the code again slightly. The alpha channel of the user defined colors is now used to set the intensity of the coloration. So if a user wants one channel to not effect the part (that much), they can reduce the value of the alpha channel.

The updated code is in the above code box

 

Wow, if this works out... I may have to send you some cookies, or coffee, or strong drinks (whatever your preference is...).  Have been trying to find a good method for recoloring of existing (non-white) parts, and it sounds like this might be some major steps in that direction.  Sounds like this is doing mostly what I had wanted to do with the 'value masked' shader, but using a much simpler input texture scheme for extracting of existing details.

 

6 hours ago, Nils277 said:

I can send you the used textures/masks if you want to experiment with them :wink: 

Yes, please.  Would love to take a look at them (from a technical perspective).  Those + the shader code (and images you've linked above), should give me tons of info on exactly how the adjusted shader is working.  Hopefully I'll get a few hours over the weekend to play with it, and if it all works out I'll see about merging it (or similar) for the next releases.

 

53 minutes ago, MOARdV said:

If I understand the documentation for the shaders on GitHub, I should be able to make my own metallic gloss map and retrofit it to an existing older part, right?

Yes, exactly.  In your metallic mask white = metal, black = non-metal.  Generally you want to stick close to those, as not much in the real world exhibits mixed properties.  A few points away from black/white is okay (0-15 for black, 230+ for white), but not too much, and generally only used in places where there is non-metallic 'stuff' overlaid on top of metals (grunge) or a non-metallic coating has been scratched/buffed to reveal some of the metallic base (scratches/edge damage on painted parts).

1 hour ago, MOARdV said:

That would allow me to control which regions of a part would be metallic, and how mirror-shiny regions would be.

In order to control how reflective the part is you also need to provide a gloss map (specular map).  Either in the alpha channel of the diffuse texture (e.g. stock specular texture setup), or in the alpha channel of the metallic texture (Unity standard setup).  Some stock parts already have specular maps, many do not (same with mods, its hit and miss).

 

Link to comment
Share on other sites

Just to note, it seems you can only apply this to a certain amout of parts before KSP becomes unstable and you will start crashing when you load a save or open mab/vab. I am not sure if its system specs, programming limitation, mod conflicts, a textures unlimited problem, or the way I am applying the shaders. So this is why I am putting out my configs. So someone with more knowledge can maybe fix this issue. *Note I am applying over a 1000 parts on 63 different mods, would do more but it crashes. 

So I was messing around with this shader and realized I could apply each property and shaders separately. So I made a config file which you could select metals, Smoothness, Brightness/Shader color, and shaders. Just place the part in MAB/VAB and right click on it.

Brightness goes from 0-50,Default is 10, 51-100 is a bunch of random tint colors I put in to play around, feel free to change anything you see fit.

Metal goes from _metal Float = 0-100

Smoothness goes from _Smoothness Float = 0-100

Shaders file only has these three shaders in it right now.
shader = SSTU/PBR/Metallic
shader = SSTU/PBR/StockMetallicBumped
shader = SSTU/PBR/MetallicTransparent

You can add the other shaders in but they require more advance configs, additional masks, files  to work, and I have not done anything with them yet so I was keeping it simple.
SSTU/PBR/StockMetallicSpecular
SSTU/PBR/Masked
SSTU/PBR/Solar
SSTU/Masked
SSTU/SolarShader

The asset folder contains the four files listed below. 
ThingsmadeshinyBrightness.cfg
ThingsmadeshinyMetal.cfg
ThingsmadeshinyShaders.cfg
ThingsmadeshinySmoothness.cfg

The only file that you need to modify is the main file, I was naming after the installed mod I was changing. So for example, Open Mk2Expansion and look at the first line, you will see what is listed just below. Put the parts you want in the brackets where M2x_* is located. Then put the mod folder name in place of the Mk2Expansion. Also rename the file to the specific mod if you want. Dont worry about everything below unless you are going to tinker.

@PART[M2X_*]:NEEDS[TexturesUnlimited&Mk2Expansion]

I have included the following files to get people started, easy enough to add other mods.

ChopShop.cfg
HeatControl.cfg
KerbalReusabilityExpansion.cfg
MarkIVSystem.cfg
Mk2Expansion.cfg
Mk3Expansion.cfg
Mk3HypersonicSystems.cfg
ModRocketSys.cfg
NearFutureConstruction.cfg
NearFutureElectrical.cfg
NearFutureLaunchVehicles.cfg
NearFuturePropulsion.cfg
NearFutureSolar.cfg
NearFutureSpacecraft.cfg
QuizTechAeroContinued.cfg
Squad.cfg
StationPartsExpansionRedux.cfg Excluded the two hydroponics modules as I can't the glass to work. 

Just made this dropbox account today, so I apologize if I made a mistake.

Download

https://db.tt/rICr8tXQBX


You will need Textures Unlimited by shadowmage45 installed and associated mod.
Just unzip the Thingdmadeshiny.zip and place it in your GameData folder. Delete what you dont want, but it shouldn't load it if you dont. 

 

As I said, I hope someone can help out with this and maybe make something great. Feel free to use any part of these config files and modify/distribute as you like.

Link to comment
Share on other sites

14 hours ago, Barar said:

Just to note, it seems you can only apply this to a certain amout of parts before KSP becomes unstable and you will start crashing when you load a save or open mab/vab. I am not sure if its system specs, programming limitation, mod conflicts, a textures unlimited problem, or the way I am applying the shaders. So this is why I am putting out my configs. So someone with more knowledge can maybe fix this issue. *Note I am applying over a 1000 parts on 63 different mods, would do more but it crashes. 

Interesting; can't say that I've seen that behavior before, but I've also generally not been patching it onto that many parts.

Any way I could have you upload a KSP.log file for one of the times where it crashes?  (located in the same folder as the KSP executables)  That log file should give me some hints as to why it is crashing.

 

14 hours ago, Barar said:

As I said, I hope someone can help out with this and maybe make something great. Feel free to use any part of these config files and modify/distribute as you like.

I hope so too :)   I appreciate the work it takes to put the configs together, and hope we can get it all sorted out and working for you.

Great first (second?) post, and welcome to the forums :)

Link to comment
Share on other sites

Hi Shadowmage, 

I made 4 crash reports and one that wouldn't crash moving through multiple screens, launchpads and reloads. 

Download https://db.tt/xGUQvu3ThD

Just so you know, my usual procedure for trouble shooting, aside from first looking at the logs. Is that I have an untouched KSP install, My test KSP install, and my playing KSP install. I put any new mods into my test KSP install, which usually has the minimum mods installed. Start up KSP test, since it boots in 20seconds or so, confirm everything is working. Then put it into my main install. So playing with the configs above, I am able to load up every mod individually on my test KSP and play with no crashes. Then I put the mod into my playing KSP install with a config for each mod installed. Then it would just crash. So I deleted one config at a time until it started working, as I deleted more, it became increasingly stable, till no more crashes. I reinstalled all my mods from fresh downloads into a fresh install and tested it before I made the above post and had the same effect.

If I notify the mod maker on github, it is usually with the mod installed on my fresh install. So as to show it is not a mod conflict. I could not do that with this one since it varies depending on how many parts and possibly other reasons stated above. 

So two crash reports from my new fresh install, two from my main install. Also a report from the fresh install(reduced config installs), with no crashes, trying to make it crash.

 

Link to comment
Share on other sites

20 hours ago, Barar said:

So two crash reports from my new fresh install, two from my main install. Also a report from the fresh install(reduced config installs), with no crashes, trying to make it crash.

Strangely, I'm not actually seeing any crash-related information in those logs.  They all seem to end with this line:

2/11/2018 1:47:50 PM,KerbalAlarmClock,Loaded Textures

which is.... not that helpful as you might imagine.

 

Could you try uploading the KSP.log file from your main KSP directory (it should be in the same folder as the executables)?  The regular output_log.txt files are...well... mostly useless with KSP (though are usable for most other Unity games).  Also the actual crash-log file that is generated might be useful, as it includes a bit more stack/heap information (should be in a separate folder in your main KSP folder).

And are you sure you aren't simply running out of RAM when using that many mods?  I'm not able to see your amount of RAM from those log files, but I would guess you would need at least 8g for that many mods, possibly 12-16g.  Out-of-ram crashes generally happen during scene-changes or when launching craft, but really could happen anywhere that memory is allocated (so, like anywhere in the KSP or mod codes, as it is nearly impossible to entirely avoid memory allocation in C#).

Link to comment
Share on other sites

I have 32G of ram, M2 ssd drives, the game is fully playable and does not crash for me. When I first load in game, I sit at about 10.5G. Every time I switch between VAB,MAB, launch and vessels, I get about 200-300mb added to my memory. Only when the memory leaks bring me up to 22+G that it may crash, but that is after many screen changes and I usually finish playing before getting to that memory usage. 

I did just run the crash scenario, I added about 100 parts in the config and can make it crash consistently. I generated a new ksp.log with the crash since I was playing. It is also not generating a crash log(would look like a folder labelled 2018-02-12_XXXXXX). When it does crash, the screen will be blank and give a "KSP_x64.exe has stopped working" error and you can only select close program. Then it closes KSP.

 https://db.tt/Nbiwxs17mS

I could go through all the configs and try to find the number of parts is needs to start crashing, I just used * and several mods like this, SYadapter*,SYplate*,SYserviceBay* so would need to tally it all up. But not sure if it would help. 

When I was first playing with this I was using @PART[*] with just one config. This worked on my test KSP game, but would crash on my main modded KSP game. That is when I broke it all out into separate configurations for each specific mod. I was thinking it was applying it to some part in a mod that it was conflicting with and crashing. But it would become unstable and crash when I seem to hit a part threshold. Just to note, I have tried swapping out different configuration files and mixing it up with different high part count mods, Also removed other mods that had this shader like SSTU and Lonesome robot mods just in case.

Thanks for taking the time to look at this issue. 

 

Link to comment
Share on other sites

1 hour ago, Barar said:

I have 32G of ram, M2 ssd drives, the game is fully playable and does not crash for me. When I first load in game, I sit at about 10.5G.

32g should be plenty of ram, but ouch... 10g idle?

 

1 hour ago, Barar said:

When it does crash, the screen will be blank and give a "KSP_x64.exe has stopped working" error and you can only select close program. Then it closes KSP.

That -really- sounds like the out-of-memory crash to me.  Other crashes will (almost always, like 99.5%) generate the crashlog folder + actual crash log.  OOM will just dump you to the desktop with the little popup-window stating that KSP has stopped working.

IIRC, Unity engine has some errors where it will OOM crash at around 16g regardless of how much RAM you actually have.  Heck might be a limitation with their Mono runtime, or even some compilation flag in KSP itself.  Honestly though I've never even come close to that (I think I've maybe seen ~6g of ram used by my setups... and that is only after an all-day play session).

 

Thanks for taking the time to upload that KSP.log file.  Sadly, I'm really not seeing anything in there that would point towards the cause.  The log simply stops shortly after the change from main-menu to space-center.  One other thing that might be able to help in tracking down the cause -- if you enable 'flush log to disk immediately' (or w/e it is called) from the stock debug-menu, it can sometimes catch a few more lines in the log.  When KSP crashes, it will fail to log the last few lines to the log due to how everything is processed.  Enabling the immediate-flush setting forces it to write things to the file -as they are logged-.  It can/will cause lag though if lots of things are logging errors, so would suggest only enabling it for specific debugging use.

 

I'm really thinking that this is caused by memory use.  Either regular system RAM, or perhaps even excessive use of VRAM.  Especially telling is your statement that the problem goes away after you remove a few arbitrary/random mods.  If it is not being caused by a specific mod, then it must be being caused by the number of mods in stalled (which again, points to RAM of one sort or another).

Sadly I don't really have many ideas beyond that.  If you can point me to a specific config file that is causing the crashes, I will gladly investigate further (or somehow otherwise manage to get the KSP.log file to contain information relevant to the crash).  But there is not much more I can do with the information that I currently have.  (I often wish it was legal to share complete KSP installs... would make my life so much easier trying to debug highly-modded setups like this; sadly, it is not legal, and I don't have the time, patience, or motivation, to go and find, download, and install dozens/hundreds of mods + whatever other customizations are in play)

If you can find a bit more information on the problem please let me know.  Will gladly dig in further if more info comes up.  You might also consider opening an issue ticket on the TU repository (here ->  https://github.com/shadowmage45/TexturesUnlimited/issues ) to officially make note of the problem, and keep all of the information organized.

 

Link to comment
Share on other sites

I got to thinking when you talked about memory but we did not define where I am getting that information. I am currently using GCmonitor. Other sources I am now including.

GCMonitor

10626MB (VSZ)

6538MB RSS

10661MB Peak

798MB  GPU 

60 FPS -Capped to reduce garbage collection.

In KSP alt-F12 debug menu.

Allocated 2812.38mb

Reserved 3144.54mb

Unused Reserve 322.20mb

Under Windows Task manager

Processes  KSP_x64.exe  6373MB

Under Windows Resource Monitor

KSP_x64.exe Commit 10366345KB Working Set 6933394KB

These were taken all on the same game load.

To note, I was not removing any installed mods in my game. The only change I made was move a few config files that applied the TextureUnlimited to about 100 more parts.

 

So did some testing today. Made an @PART[*] mod to apply it to everything.

Original Setup

3 shader switches

Brightness 0-100

Metal 0-100

Smoothness 0-100

Possible combinations - 3x101x101x101= 3,090,903 x 1600 parts = 4,945,444,800 - Seemingly stable.

Possible combinations - 3x101x101x101= 3,090,903 x 1700 parts = 5,254,535,100 - Crashing.

Difference of 309,090,300 between when I was crashing and not crashing. But my modified setup is not even a 1/10 of the difference between those first two setups.

Modified setup

2 shaders

Brightness 0-30, 51-100

Metal 0,25,50,70,75,80-100

Smoothness 0,25,50,70,75,80-100

Possible Combinations 2x81x26x26=109,512 x 2131 parts = 23,370,072

This modified setup looks to be working for me just fine, no crashes so far. I am not a programmer but I think it might be hitting a max integer or something somewhere in Unity. 

I put a new download link with the altered files if anyone wants to experiment. Also don't know how this will affect any mod that is using TexturesUnlimited already. Will need to DL one and try sometime.

Download for Thingsmadeshiny below.

https://db.tt/ZGv7tGTaPt

Also Shadowmage, thanks for the replies. 

I just wanted to say I love the Anti-Grav Repulsors. Splashing down in a Jet and then needing to take off again, very useful. Also is it possible to mod them to have a 10m, 20m+ height to them, so I could build some roaming bases construction tools, with maybe a faux land carrier not hugging the ground. Maybe some sleek heat resistant/ablative ones too that don't burn up on my SSTO's re-entry, But I can always mod the maxTemp on the part myself, this is probably not the correct forum to discuss it, so I digress. 

 

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