Jump to content

[1.12.x] Shaddy - A Shader Library for KSP Modding [v2.5]


Icecovery

Recommended Posts

RestockSolar.png

Shaddy is a collection of shaders made for Kerbal Space Program, not to be confused with Shabby, a shader asset bundle loader that you most likely also need to use to load Shaddy shaders :)

Visit GitHub Repository to see the newest and complete description, demo, and changelogs.

Usage:

If you are a player...

Shaddy does not do anything by itself, it is designed to be used by other mods. If you run into any problem with the shader please feel free to report it as an issue here or on Github.

Despite that, Shaddy does come with a set of Textures Unlimited config for Stock, ReStock, and Near Future Solar parts. They will only activate if you installed both Textures Unlimited and Module Manager at the same time.

Goto Demo section to see the effect preview.

If you are a modder...

You may want to use Shabby to load Shaddy shaders to your parts. Alternatively, you can also use your own shader loader orTextures Unlimited.

Use Shabby:

To start making mods using Shaddy and Shabby:

  • First download the SDK in GitHub Release.
  • Then, import the downloaded unitypackage to your unity project.
  • You should now see a folder named `Shaders` appear under your Assets folder.
  • Create a material that uses these new shaders and apply it to your part.
  • Export the part as if it is using stock KSP shaders, and ignore the Part Tool warning on using a stock shader.
  • Install Shaddy from CKAN or SpaceDock to GameData.
  • If you are using Shabby to load Shaddy shaders, make sure it is installed, too.
  • Open the game and make sure the shader is loaded correctly on the part.
  • ???
  • Profit.

In this case, Shaddy, Shabby, and Module Manager will need to be added to your mod's dependency.

Use Textures Unlimited:

If you want the translucent shader to be optional or if you want to add translucent effect to a existing mod, you can use Textures Unlimited's shader replacement feature.

Starting from version 2.0, Shaddy comes with Textures Unlimited shader bundle and shader data definition, it is located at GameData/Shaddy/Patches/ShaddyTU.cfg.

Textures Unlimited config documentation can be found at Textures Unlimited wiki page. Shaddy's stock config (found under GameData/Shaddy/Patches/) can also be used as a reference.

In this case, Shaddy, Textures Unlimited, and Module Manager will need to be added to your mod's dependency, Shabby will not be a required dependency as Textures Unlimited uses its own shader loader.

Notes on HDR color properties when configuring Textures Unlimited:

Some color property has their range marked as *HDR*, which means it supports Unity HDR color that can have a value greater than (255, 255, 255). To find what number you need to use in Textures Unlimited config, multiply each of the R, G, and B channels of your desired color value by the intensity, and round to the nearest integer.

For example: if a color in the Unity editor has an RGB value of (102, 204, 255) and intensity of 4.2, in Textures Unlimited config, write:

PROPERTY
{
    name = _SomePropertyName
    color = 428, 857, 1071
    // rgb (102, 204, 255) intensity 4.2
    // 102 * 4.2 = 428.4, rounded to 428
    // 204 * 4.2 = 856.8, rounded to 857
    // 255 * 4.2 = 1071
}

Modeling Notes:

All Shaddy/Translucent shaders are double-sided (No back face or front face culling). This means if you are making a parachute or a leaf model that has the same texture on both sides, you don't have to duplicate the mesh and then flip the faces, one-sided mesh will work just as fine as a double-sided one.

If you are replacing shaders on an old part, consider using Shaddy/BackCull/Translucent shaders (With back face culling).

 

Dependency:

Module Manager

 

Recommend:

Textures Unlimited for enabling translucent effect on Stock and ReStock solar panels, parachutes, and antennae.

 

Conflict:

If you installed the Shabby v0.2.0 "unofficial build" and Textures Unlimited at the same time, there will be a conflict, resulting in failed shader replacement from Textures Unlimited (Pink parts). This has been solved by the newest change in Shabby (>= v0.3.0). It is available on CKAN, or you can get it here: http://taniwha.org/~bill/Shabby_v0.3.0.zip

 

Download:

For players: SpaceDock, also available on CKAN.

For modders: SDK.

Note that not all versions of the mod will have a corresponding version of SDK since shaders might not change between mod releases. Download the latest SDK available if no SDK matches the latest mod version. E.g.: If the latest mod version is v2.4, but the latest SDK version is v2.3, use SDK v2.3.

 

Installing:

For players: Delete everything previously installed under GameData/Shaddy/ before extracting the zip file. Or use CKAN.

For modders: Delete all previously installed Shaddy shader under Assets/Shaders/, then install `Shaddy_vx.x.unitypackage` to your Unity project.

 

Demo:

Visit GitHub Repository to see the most up-to-date demo and their explanations.

Spoiler

StockChuteCompare.png

Shaddy/Translucent shader compared with KSP/Diffuse shader on a stock parachute, enabled if Textures Unlimited is installed.

RopeLOD.gif

Parachute LOD effect

Leaf-Front.png

Leaf-Back.png

Shaddy/Translucent Cutoff (Mapped) (Bumped) shader comparing with KSP/Alpha/Cutoff (Bumped) on a leaf

StockSolarCompare-Front.png

StockSolarCompare-Back.png

StockSolarLight.gif

Shaddy/Translucent Specular shader compared with KSP/Specular on the stock large solar panel, enabled if Textures Unlimited is installed.

RestockSolar.png

Shaddy/Translucent Specular (Spec Mapped) (Bumped) shader on Restock solar panels, now with transmission texture by @Rodger, enabled if Textures Unlimited and ReStock are installed.

88-88Compare.png

Shaddy/Translucent shader vs stock diffuse shader on stock Communotron 88-88 antenna, enabled if Textures Unlimited is installed.

unknown.png

Near Future Technologies configs by @Rodger.

 

Available Shaders:

Visit GitHub Repository to see the list of shaders available.

 

Source:

GitHub

 

Credits:

Shaders are made by @Icecovery using Shader Forge.

Textures Unlimited config by @JonnyOThan.

Restock and Near Future Technologies configs by @Rodger.

 

License:

This mod is released under the MIT License.

 

Redistribution:

You are free to bundle this mod in your mod releases. You are also free or include the shaders in your own asset bundle, but be sure to change their namespace to avoid naming collision.

Edited by Icecovery
Update v2.5
Link to comment
Share on other sites

If people who use BDB install Shaddy and TU as well, all the BDB parachutes will have these shaders applied:

0M5LcqN.png

lpxcNlB.png

And the "blanket" solar panels (the Skylab Power Module 25kW and both EOSS experimental rollout solar panels) have transmission maps:

4HxQAcA.png

VEBLD3s.png

Edited by Rodger
Link to comment
Share on other sites

I can't seem to find a download link for the latest version of Shabby, so therefore most of my solar panels are bright pink.

Is there anywhere I might be able to find a download or is there anyone who could get me a version of Shabby v3.0?

Link to comment
Share on other sites

v2.3 - Back Cull Shaders

Added backface culling version for some of the shaders.

New Shaders

  • Shaddy/BackCull/Translucent
  • Shaddy/BackCull/Translucent (Bumped)
  • Shaddy/BackCull/Translucent (Mapped)
  • Shaddy/BackCull/Translucent (Mapped) (Bumped)
  • Shaddy/BackCull/Translucent Specular
  • Shaddy/BackCull/Translucent Specular (Bumped)
  • Shaddy/BackCull/Translucent Specular (Mapped)
  • Shaddy/BackCull/Translucent Specular (Mapped) (Bumped)
  • Shaddy/BackCull/Translucent Specular (All Mapped) (Bumped)
  • Shaddy/BackCull/Translucent Specular (Spec Mapped) (Bumped)
  • Shaddy/BackCull/Translucent (Monocolor)
Link to comment
Share on other sites

1 hour ago, Pepethecat said:

I have everything installed properly but all I get is Neon Pink chutes and solar panels for BDB

 

Make sure you have the latest version of Shabby:

On 8/21/2022 at 12:03 AM, OrbitalManeuvers said:

You might need to right click on the link and use Save Link As. No idea about your system or what didn't work but that's an alternate way to use a direct link to a file.

Link to comment
Share on other sites

  • 8 months later...

So there's an interaction with Shaddy and KSPCF's new custom faster drag cube generation, where the translucent shaders cause drag cubes to generate incorrectly (the translucent parts will just be ignored). So if you have both Shaddy and KSPCF 1.28+ installed, you may get issues where translucent parachutes aren't slowing craft down enough.

For now, you can disable the KSPCF drag cube generation feature if you want to keep using Shaddy, or just not use Shaddy until a fix is available.

Link to comment
Share on other sites

13 hours ago, Rodger said:

For now, you can disable the KSPCF drag cube generation feature if you want to keep using Shaddy, or just not use Shaddy until a fix is available.

Should be fixed now in KSPCF 1.29 

Link to comment
Share on other sites

  • 9 months later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

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