Jump to content

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


Shadowmage

Recommended Posts

2 hours ago, Pol said:

It's super cool. Only wish some way for mass feed models to it. Maybe some MM magic can do it. 

What is model path of eva kerbal / helmet ?

 

Kerbals are not treated as parts, so the mod does not currently support them. He has that on the someday to-do list though.

Link to comment
Share on other sites

I had tried using dx 11, but SVT doesn't like it (textures lines all across the terrain) I reinstalled and everything seems to work properly now. I guess I must have broken something before... I have uninstalled SVT to see if things changed on dx11 but I have some shadow glitches on the KSC. I think it may be something on my GPU that doesn't like it maybe, r I don't know so I downgraded again to Dx9 and I think everything seems to work as intended. Sorry for taking so long on my feedback.

EDIT: I think those problems with DX11 are related to other mod interfering or something, I am doing some trial and errors to see what's causing what, although I am not expert.


Also: Should I delete planetShine? Because in the OP it says TU supports it already...

Edited by Agustin
Link to comment
Share on other sites

13 hours ago, Electrocutor said:

What are the requirements for the Recolor GUI to affect things? It seems there are 3 colors available per part that can be set, but how do you define the mesh names for each of these colors?

It uses a 3-color RGB 'mask' texture to determine what section of the model(s) that each 'color section' applies to, and is not applied on a mesh basis.  This is so that you can have patterns painted onto any specific mesh in the mask texture, and aren't limited by mesh boundaries.

Red areas on the mask get the 'main color' applied.  Green gets the 'secondary color' applied, blue gets the 'detail color' applied.  Any place that is red/green/blue on the mask should be primarily 127,127,127 gray on the diff/spec/met textures.

Black on the mask denotes that it should pull color data directly from the diffuse/spec/met textures normally, and in those places you can use the diffuse/spec/met textures normally -- this allows for only part of a model to be recolored/part of it to use static texturing.

For example, on the SSTU-MFT tanks, the mask looks like:

uHO2doJ.png

And the diffuse/spec/met all look similar to: (note the minor details added for the ribbing on the tanks; these gray textures get applied as +/- gradients to the users' selected colors, to effect minor highlight/shading details)

e9MkSrb.png

And combined/rendered in-game, it gets you stuff like (all of these parts were user-recolored to some sort of metallic green/brown/silver).  Note the vertical stripes pattern on the fuel tank, which is supplied by the mask texture; the silver piping on the fuel tank is UV'd in the 'blue' portion of the mask texture, so gets the 'detail' color applied.

jG1B2yW.jpg

 

This allows for (most of the time) a single set of DIFF/SPEC/MET textures to be fed into the recoloring system through texture sets, with all that is needed to make a new visual layout is to provide a new MASK texture.  The texture sets support a COLORS block that sets the -default- main/second/detail colors for that texture set (which the user is free to alter).


 

 

 

4 hours ago, Agustin said:

I had tried using dx 11, but SVT doesn't like it (textures lines all across the terrain) I reinstalled and everything seems to work properly now. I guess I must have broken something before... I have uninstalled SVT to see if things changed on dx11 but I have some shadow glitches on the KSC. I think it may be something on my GPU that doesn't like it maybe, r I don't know so I downgraded again to Dx9 and I think everything seems to work as intended. Sorry for taking so long on my feedback.

Thanks for the reply, and for investigating.  Glad that fixed up the inverted reflections for you, but sad to hear you have other issues with DX11, as the reflections/visuals are so much better when it is used.  (under DX9 there can be some sharp lines in the reflections where the 'faces' of the cube-map are joined up and/or lower-mip-map'd levels of the cubemap are inconsistent across face edges)

Must be something specific to SVT+DX11 (and/or Kopernicus?), as I use EVE/Scatterer/SVE all the time without issue.

 

 

15 hours ago, Electrocutor said:

Okay... so before I get too carried away. What kinds of options do you all want to see (none of this affects fps or requires any textures to be loaded)?

 

Looks like you got it figured out :)   (I think it was TEXTURE vs TEXTURESET.... yeah, I'm not the most consistent with some of my config-node namings; I generally prefer terse over verbose).

Interesting use there as well.  Just adjusting the _Color.rgb in the properties for the texture sets (and _Smoothness/_Metallic)?  Oooh... actually using two texture-set modules to switch the metallic and diffuse maps independently?  Very nice.  Excellent actually.  (I knew there was a reason I kept the 'use existing material values on texture set assignments'...)

Almost time to get your own thread started, as it looks like it is become quite the feature-rich stock-texture improvement package.  Whenever you are ready, I'm sure it'll be quite popular.

 

 

Edited by Shadowmage
Link to comment
Share on other sites

I KNOw I am not the only one having issues with Dx11 and SVT textures glitches. I've seen images with the same problem as me.What I am seeing now (by trial and error) is that such glitches occur somehow (I haven't determined it yet) with a conflict woth another mod. I have like 100 mods so I am narrowing it util I will know who is causing these glitches... hopefully, so I can play with DX11 finally...

TRYING DX 11:

     To the left, My highly modded ksp 1.3.1 TERRAIN GLITCHES

     To theRight, my TEST KSP... NOT GLITCHES

qzLl1zI.png

Edited by Agustin
Link to comment
Share on other sites

11 minutes ago, Agustin said:

I KNOw I am not the only one having issues with Dx11 and SVT textures glitches. I've seen images with the same problem as me.What I am seeing now (by trial and error) is that such glitches occur somehow (I haven't determined it yet) with a conflict woth another mod. I have like 100 mods so I am narrowing it util I will know who is causing these glitches... hopefully, so I can play with DX11 finally...

TRYING DX 11:

     To the left, My highly modded ksp 1.3.1 TERRAIN GLITCHES

     To theRight, my TEST KSP... NOT GLITCHES

 

Please report what your investigation turns up.  I'm sure that the folks over at SVT will be interested as well (and with that info, might able to find a solution on one end or another).

Link to comment
Share on other sites

I've narrowed it down to FAR or ModularFlightIntegrator (which in the OP says it is a requirement for FAR to work) It is braking DirectX11 textures when using SVT. SVT by itself works on DX 11, but when SVT and FAR is installed (with ModularFlightIntegratr as well as a dependency of FAR) SVT textures go like this: https://www.dropbox.com/s/gjlgdj5q8kqx9lh/KSP.bmp?dl=0

Edited by Agustin
Link to comment
Share on other sites

16 minutes ago, Agustin said:

I've narrowed it down to FAR or ModularFlightIntegrator (which in the OP says it is a requirement for FAR to work) It is braking DirectX11 textures when using SVT. SVT by itself works on DX 11, but when SVT and FAR is installed (with ModularFlightIntegratr as well as a dependency of FAR) SVT textures go like this: https://www.dropbox.com/s/gjlgdj5q8kqx9lh/KSP.bmp?dl=0

Good find, and good work investigating (I know how much...fun... it is).

I don't think that MFI does anything at all regarding rendering.  FAR just might for its voxelization (I've only dug into the interop side of it, haven't looked at what it actually does with the meshes) (a very quick look over the code doesn't present anything worrying, but I'm no expert on FAR code).  (Edit:  if anything it would be this -- https://github.com/ferram4/Ferram-Aerospace-Research/blob/0711fdb464c95dae0d65baf4d538abcafe4c2d31/FerramAerospaceResearch/FARGUI/FAREditorGUI/EditorAreaRulingOverlay.cs  -- but it -looks- like it should be only applied by parts, unless for some reason it is mistakenly being applied to the terrain? )

Probably excellent information to post up to the SVT thread / issue-tracker.

 

Edit:  One more test that you might try, is to keep MFI intalled, but remove FAR.  Should tell you if it is MFI specific, or FAR specific (but its not a 100% assured test, it could give false results; probably still good info to include with your bug report(s)).

Edited by Shadowmage
Link to comment
Share on other sites

14 minutes ago, Shadowmage said:

I don't think that MFI does anything at all regarding rendering.  FAR just might for its voxelization (I've only dug into the interop side of it, haven't looked at what it actually does with the meshes) (a very quick look over the code doesn't present anything worrying, but I'm no expert on FAR code).

I think it is ModularFLightIntegrator, because I just tested Ksp with it but without FAR, and I have the glitches... But for what I understand, modularFlightIntegrator is a dependency of FAR, so... I want Far and Textures UNlimited installed, both! :(

Link to comment
Share on other sites

5 minutes ago, Agustin said:

I want Far and Textures UNlimited installed, both! :(

Then you should definitely report the problem to both SVT -and- MFI.  They cannot fix problems that they are not aware of.  And most mod devs that I've interacted with are eager to fix compatibility problems (most, but not all...).

For SVT, if it not already known, you can report it as a mod-incompatibility.  Not likely something that they can fix (maybe? does the problem happen with DX11+MFI without SVT installed?), but at least others can be aware of the issue.

For MFI, you can report that it causes rendering problems under DX11.  More than likely the fix will have to come from MFI, if it is in fact what is causing it.

Link to comment
Share on other sites

10 minutes ago, Shadowmage said:

Then you should definitely report the problem to both SVT -and- MFI.  They cannot fix problems that they are not aware of.  And most mod devs that I've interacted with are eager to fix compatibility problems (most, but not all...).

For SVT, if it not already known, you can report it as a mod-incompatibility.  Not likely something that they can fix (maybe? does the problem happen with DX11+MFI without SVT installed?), but at least others can be aware of the issue.

For MFI, you can report that it causes rendering problems under DX11.  More than likely the fix will have to come from MFI, if it is in fact what is causing it.

Done.  I don't know how to get the modIncompablity tag, but I've already taken this info to those threads and made the github issues...

I was just reporting all this to this thread because it's the one asking me to force DX11, and maybe some other folks  are having/will have  the same problem...

Edited by Agustin
Link to comment
Share on other sites

26 minutes ago, Agustin said:

I was just reporting all this to this thread because it's the one asking me to force DX11, and maybe some other folks  are having/will have  the same problem...

Yeah, no worries.  There was a good chance that the problem could have been in this mod somewhere, and this is the perfect place for those types of discussions.

Link to comment
Share on other sites

After talking to Galileo he made me realize that MFI is also a requirement of....: kopernicus! so I think nothing can be done to fix DX11 working with SVT. I think I'll just drop SVT and play with DX11 and TexturesUnlimited.... Pitty can't have both installed.

Link to comment
Share on other sites

38 minutes ago, Agustin said:

MFI is also a requirement of....: kopernicus!

Ouch...  that is no good.  And also doesn't really make sense (though I believe it is true; I'm just not sure -why- Kp would need MFI).

Hmm... I guess if there is no movement in a few weeks as far as fixes from MFI, I might have to get involved.  At this point I know a fair bit about shaders/rendering/etc, and might be able to find a solution (or at least the cause of the problems), especially as its mod code that I can actually download, edit, and recompile.   (I had wanted to try OPM again or one of the other planet packs, but obviously can't until things get fixed up)

Certainly not going to promise anything.  Even if I can find the cause, it doesn't mean I'll be able to find a solution.  Even if I do find a solution, it doesn't mean that the other mod would be willing to incorporate it.  Will likely be a few weeks at least before I have time to start investigating.

 

Link to comment
Share on other sites

2 minutes ago, Shadowmage said:

Ouch...  that is no good.  And also doesn't really make sense (though I believe it is true; I'm just not sure -why- Kp would need MFI).

Hmm... I guess if there is no movement in a few weeks as far as fixes from MFI, I might have to get involved.  At this point I know a fair bit about shaders/rendering/etc, and might be able to find a solution (or at least the cause of the problems), especially as its mod code that I can actually download, edit, and recompile.   (I had wanted to try OPM again or one of the other planet packs, but obviously can't until things get fixed up)

Certainly not going to promise anything.  Even if I can find the cause, it doesn't mean I'll be able to find a solution.  Even if I do find a solution, it doesn't mean that the other mod would be willing to incorporate it.  Will likely be a few weeks at least before I have time to start investigating.

 

I have just found that the glitches occur only on kerbin, no other planet has glitches with SVT and DX11

Link to comment
Share on other sites

23 hours ago, Electrocutor said:

Okay... so before I get too carried away. What kinds of options do you all want to see (none of this affects fps or requires any textures to be loaded)?

One thing I might be able to do to help out in this regard -- a simple PartModule that would access the _Color (and/or _Metallic, _Smoothness) property of the meshes inside of a TEXTURE.  So it would work along-side the TextureSwitch module, but give RGB/Met/Smooth sliders as well.  These would still be applied as 'tints' over the existing texture; pretty much exactly like you've done, only with the ability to adjust it in the VAB/SPH.  (just thinking it would be a bit easier than making configs for all the various combinations).

I've also given some thoughts to some adjustments that I could make to the Masked(recoloring) shaders that would allow them to function as tinting shaders, but using the mask-textures to drive the 3-color selection through the GUI.  I've got this scheduled to look into within the next week (probably by end of weekend), and will let you know as soon as I have more information.

Link to comment
Share on other sites

On 22/11/2017 at 4:09 PM, Shadowmage said:

jG1B2yW.jpg

 

 

 

Ok how hew hell do i do this because its amazing ???

 

On another tangent

2ufergy.jpg

 

What Do I have to edit to make all the White Bits ( Arrowed GREEN ) to turn into Shiny things like the other parts ( Arrowed RED ) , sorry to ask but this add on is nothing short of mind boggling . Love it too bits and just wan't to build a sort of shiny retro 1950/60's style of ship from the old B-Movies

 

Link to comment
Share on other sites

32 minutes ago, Puggonaut said:

Ok how hew hell do i do this because its amazing ???

 

On another tangent

What Do I have to edit to make all the White Bits ( Arrowed GREEN ) to turn into Shiny things like the other parts ( Arrowed RED ) , sorry to ask but this add on is nothing short of mind boggling . Love it too bits and just wan't to build a sort of shiny retro 1950/60's style of ship from the old B-Movies

 

Step1 - Download SSTU (see link in signature).  (you'll also need the SSTU-PBR expansion pack)

Step2 - Build rocket with SSTU parts.

Step3 - Use recolor GUI to make it look like whatever you want.  (right click on a part, select 'Open Recoloring GUI')

Step4 - Enjoy fully customizable paint-jobs on your rockets.

(the stock parts do not currently support recoloring, so you cannot get that same effect with the stock parts -- I have some ideas to try regarding allowing some level of recoloring, but it will have limitations due to the existing stock textures; it will be more 'tinting' than real painting/recoloring)

Edited by Shadowmage
Link to comment
Share on other sites

1 hour ago, Shadowmage said:

Step1 - Download SSTU (see link in signature).  (you'll also need the SSTU-PBR expansion pack)

Step2 - Build rocket with SSTU parts.

Step3 - Use recolor GUI to make it look like whatever you want.  (right click on a part, select 'Open Recoloring GUI')

Step4 - Enjoy fully customizable paint-jobs on your rockets.

(the stock parts do not currently support recoloring, so you cannot get that same effect with the stock parts -- I have some ideas to try regarding allowing some level of recoloring, but it will have limitations due to the existing stock textures; it will be more 'tinting' than real painting/recoloring)

Hey thanks for the quick reply I have SSTU installed had since whenever you released it , So I tried mucking about with the settings and still can't get the effect you have , could you maybe share your settings for the ship in the picture i quoted to give me a base line please ?

Link to comment
Share on other sites

9 minutes ago, Puggonaut said:

Hey thanks for the quick reply I have SSTU installed had since whenever you released it , So I tried mucking about with the settings and still can't get the effect you have , could you maybe share your settings for the ship in the picture i quoted to give me a base line please ?

That wasn't actually something I made, but was posted by @Temeter I believe.  Perhaps he might be willing to share how he set it up (tagged him, so no need for PM's).

You'll need to make sure you have the SSTU-PBR expansion installed as well, as that is what will enable the metallic-like settings.  You'll still need to open the recoloring GUI and play around with the color sliders in there.  ( https://github.com/shadowmage45/SSTULabs/releases/tag/PBR-0.1.0.4 )

Link to comment
Share on other sites

Great JOB !!!!

On ‎05‎.‎01‎.‎2014 at 5:38 PM, miracmert said:

I don't know good documentation but since KW engines are good at variability, I recommend examining their source code. It helped me a lot and I don't even know C sharp that much, hope it helps you too.

 

Link to comment
Share on other sites

6 hours ago, Puggonaut said:

Ok how hew hell do i do this because its amazing ???

It's actually pretty simple! Just a very basic rocket, the top is the Orion style capsule with the launch escape system atop of it. Below a thicker hydrolox stage with a j2 engine, then a long LFO tank with an atlas style adapter and two F1's. The color scheme for almost all parts is IIRC brass metal primary, copper metal secondary, platinum metal tertiary. Craft is merely 13 parts or so.

Really not much to it, SSTU is quite easy to use yet produces cool results if you know the basics. If you wanna check my craft file:

https://www.file-upload.net/download-12830793/Goldcraft.craft.html

 

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