Shadowmage

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

Recommended Posts

5 minutes ago, Electrocutor said:

You might consider using a cfg for these, like you did for identifying the transparency shaders.

It already is a config :)  -- https://github.com/shadowmage45/TexturesUnlimited/blob/dev/GameData/000_TexturesUnlimited/Shaders/TUShaders.cfg  No recompiling necessary (until/unless I need new actual icon .shader variants, which may be needed in this case)

Just add the name of the stock source shader... and the name of the icon shader to use as replacement.  Only three replacement icon-shaders exist though -- Metallic, Legacy, and Specular (no transparent versions).

Share this post


Link to post
Share on other sites
5 hours ago, Gordon Dry said:

Actually I see this issue on the following parts: (with -force-d3d11)

I am able to reproduce the issue with only TU and BDB installed, and no other patches.

It appears that the icon-shaders are being used on the parts in very specific instances, though I haven't figured out the -why- yet; TU is not patching those parts, only the part-icon-prefab.  Might be another case of renderer.sharedMaterial needing to be 'fixed' during icon shader patching.

Edit: Definitely the icon-shaders being used for some reason on the actual parts.

                             Game Object: pCylinder10
                               parent  : thrustTransform (UnityEngine.Transform)
                               position: (0.3, 14.4, -1.5)
                               scale   : (1.0, 0.9, 1.0)
                               rotation: (0.0, -1.0, 0.0, 0.0)
                               layer   : 0
                               active  : True
                               Material Data: bluedog_TitanEngines (Instance)
                                     shader : TU/Icon/Legacy
                                     mainTex: Bluedog_DB/Parts/Titan/bluedog_TitanEngines

Edit2:  All fixed up.  It was as I thought -- sharedMaterials being a PITA once again.  Have un-shared the icon materials, and there are no more issues.  Fix is available in dev branch now.

LueVlE8.png

 

Edited by Shadowmage

Share this post


Link to post
Share on other sites
29 minutes ago, Gordon Dry said:

Using that commit (there is a newer one now) the issue is gone for me:

Glad to hear :)

Few more things to clean up in the current /dev branch, but hoping to get a full release out either tomorrow or Sunday.  Lots of internal changes and new features/functions, should also be fully backwards compatible with existing config sets.

Share this post


Link to post
Share on other sites

Coming soon -- stock fairing PartVariant integration support (write your own configs) --

YkfxoRa.png

DeTi5VZ.png

Still some cleanup work to do on the module and its integration (mostly persistent data stuff), but the main functionality seems to work.

Share this post


Link to post
Share on other sites

Updated release is available with KSP 1.5.x compatibility. 

There have been some major changes with this version, but it should remain backwards compatible with most existing configs.

  • A new line of shaders is available that use keywords to enable/disable specific features.  Examples of how to use all of these is available in the TU repository (functional examples and wiki (documentation).
  • Support the stock reflective shader under DX11/OpenGL
  • Most, but probably not all, part icons should be functional under both DX11 and OpenGL.  Untested on Mac/Linux -- may have clipping issues on those platforms.
  • A few various config-side enhancements that should enable new options for config writers
  • DX9 still not fully supported
    • Ability to turn off DX9 warning from the configs.  If I see any whining of 'why are my gfx' messed up from DX9 users, this will be removed.
  • Unfortunately there were some features that did not make it into this release; hopefully they can be finished and added in the future.

Please make sure to fully remove any previous versions; some config level changes may result in side-effects if new versions are merged on top of old.

Change-log and download links:  https://github.com/shadowmage45/TexturesUnlimited/releases/tag/1.2.2.16

Share this post


Link to post
Share on other sites
8 minutes ago, Gordon Dry said:

Does the pre-release no more need the BlendshapeModelLoader folder? Just curious, it's not in the download.

That is a good question -- no, the new releases do not need that folder.  It is intended to be a new stand alone 'mini-mod' that just loads blend-shape models, for distribution by other mods that only need that functionality.  TU still includes the same functionality (and using it is the only way to use TU shaders on those models), but the two of them will use different file extensions to prevent overlap/double loading.  Still working up the release details for that bit though; probably won't be a new release thread, just an optional download in the opening post.

Share this post


Link to post
Share on other sites

I'm having a small problem where whenever I have this mod installed (with or without configs), there is a small grey square in the bottom right corner which doesn't do anything. It's quite tiny, but really is annoying for screenshots. Any idea what this is or how I could fix it?

Share this post


Link to post
Share on other sites

    {
        "MAJOR":1,
        "MINOR":1,
        "PATCH":2,
        "BUILD":15
    },

but TexturesUnlimited-1.2.2.16 ?

Edited by alexus

Share this post


Link to post
Share on other sites
On 11/12/2017 at 4:18 AM, Shadowmage said:

TexturesUnlimited currently requires the use of the either the DirectX11 or OpenGL-Core graphics API.  This may be activated by using the '-force-glcore' command line option to launch KSP.

Other graphics APIs will 'work' (DX9, legacy GL), but will have rendering errors.

How

Share this post


Link to post
Share on other sites

i open it with dx 12 and all looks good so far,sry to come upwith this again but

is the warning also for dx 12 users?

Share this post


Link to post
Share on other sites
47 minutes ago, Burning Kan said:

i open it with dx 12 and all looks good so far,sry to come upwith this again but

is the warning also for dx 12 users?

how to use dx 12

 

Share this post


Link to post
Share on other sites

@Burning Kan

The TU reflections do not work in dx12, but are far more accurate than the ones in the UnofficialPatch.
The UnofficialPatch reflections do work in dx12, but are far less accurate than TU.
Also, keep in mind that the UnofficialPatch is still a WIP, so I haven't thoroughly tested various interactions between things yet.

 

@horace

Any time you add anything to the game, it is no longer stock.
TU is an API and does not do anything on its own. If you want recolorable parts that utilize TU, check out ManWith's mod Textures Unlimited Recolour Depot, which is already linked on the front page. He'll be updating it to the new version of TU before long and it will benefit greatly from that.
-force-glcore is the command-line argument for OpenGL Core. You can google for instructions on how to set command line arguments on your KSP shortcut: it is in the properties.

 

@Shadowmage

You might want to put two sets of explicit directions on how to run the game in glcore and dx11 along with screenshots within a spoiler on the front page. One via steam parameters and one via desktop shortcut.

Share this post


Link to post
Share on other sites

As an companion to the newer TU shaders, I'm working on a stand-alone UI application to facilitate some of the often-needed basic texture manipulations, as well as to aid in the creation of proper 'normalization' values.  It will include channel-swapping between one or two textures (e.g. put spec mask in alpha channel of diffuse texture or metal mask; swap RGB and A channels, etc), conversion of finished images to DDS (DXT1, DXT5, DXT5nm, with Y-flip; using nvdxt for DDS convert), and a UI enabled tool w/previews for creation of normalization values and testing of recoloring with specific normalization values.  Once I get the UI stuff a bit further along I'll post up some images.  Sadly, as I'm using C#, WPF, and nvdxt.exe, these tools are 'windows only' (but should be widely compatible).

@Burning Kan  TU does not currently support DX12 in full.  Maybe in the coming weeks; until then you can use Electrocutors 'UnofficialPatch' to 'fix' some of the missing features.

Share this post


Link to post
Share on other sites
30 minutes ago, Gordon Dry said:

With the latest dev many R&D icons are very dark:

Thanks for the report.  Guess that shows how often I go into R&D during development testing (hint: never...ever...ever).

15 minutes ago, Electrocutor said:

*cough* Hey look, ShadowMage... MOAR ICONS!

Yeah; no kidding.  Why couldn't SQUAD just use a reasonable (and industry standard!) methodology for rendering these darned things?

 

Share this post


Link to post
Share on other sites

TU Tools -- Normalization Data Generation (also showing some of the UI for this particular tool/function)

Input diffuse

28aybFj.png

Input Mask

EW1E2mc.png

Output 'normalization data'  (shows base texture minus details; you'll grab your three normalization values from this texture; rather from the text data provided on-screen (WIP/not yet shown))

pPrTAKE.png

And visualization of the difference between the 'normalization' data, and source texture (red = shadows, green = highlights) -- this is basically showing you what your details will look like.

EgcZ3br.png


Lost yet?  (hint:  only the 'mask' texture is needed; the generated 'normalization data' texture does not need to be saved -- we only need one value from each of its main areas).

Share this post


Link to post
Share on other sites

Also worked a bit on a "TexturesUnlimitedFX - Post Processing" 'extension'.  So far it does bloom, and bloom only; it can toggle HDR on and off, and has an in-game UI for configuring effect parameters.  Using the Unity Post-Process Bloom shader (and its minimal associated rendering code), so it is the 'industry standard' effect being used, the same as most other current-gen Unity games would be using.  I may or may not add other effects, depending on how well this one works out and plays with KSP; as usual there will be some learning on how to get it all working with KSPs quirks.

These are both with HDR enabled, and the settings tuned a bit.  No other graphics mods at play aside from TU (stock atmo, etc), but the cockpit is using stock textures + TU metallic shader.

aBDCLDJ.png

am1yIg7.png

 

I'll need to iron out a few things, but it is already quite usable in its current form, and will likely be released as a 'lite' alternative to KS3P for those who are interested in the upcoming weeks.  I may or may not bundle it with TU, but it will run as a stand alone mod and could be freely added/removed at any time.  Already available in the /dev branch on the repo for those who know their way around, but I'm offering zero support at this time, and it may or may not be in a working state at any given point in time (I often break stuff in dev branch).

 

Share this post


Link to post
Share on other sites
2 hours ago, Gordon Dry said:

With the latest dev many R&D icons are very dark:
 

In VAB they look better.

Using DX12 by any chance?  (TU does not support DX12 yet...)

As they seem to be working fine for me:

vGDYHct.png

Share this post


Link to post
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.