CobaltWolf / Bluedog-Design-Bureau

Stockalike parts pack for Kerbal Space Program
https://forum.kerbalspaceprogram.com/index.php?/topic/122020-131mostly-functional-141-bluedog-design-bureau-stockalike-saturn-apollo-and-more-v142-%D0%B0%D1%82%D0%BB%D0%B0%D1%81-1feb2018/
120 stars 143 forks source link

PBR conversion #1532

Open zorg2044 opened 1 month ago

zorg2044 commented 1 month ago

Probe Expansion

zorg2044 commented 1 month ago

Shader notes

Resurfaced/Standard

Example:

SHABBY_MATERIAL_DEF
{
  name = bluedog_Atlas_LR101_PBR

  shader = Resurfaced/Standard

  TEXTURE
  {
    _MetalMap = Bluedog_DB/Parts/Atlas/bluedog_Atlas_LR101_METAL
  }
  FLOAT
  {
    _MetalAlbedoMultiplier = 1.5
  }
}

Resurfaced/PackedMetal

This shader allows each of the RGB channels of the metal map to be used as an individual map. Thus different metal maps can be packed to account for different variants or even across different texture sets if they're the same size. Two or more channels can also be multiplied together to create combinations of those channels. The channels to be used are selected using the RGB multiplier properties

SHABBY_MATERIAL_DEF
{
  name = bluedog_Atlas_A_PBR

  shader = Resurfaced/PackedMetal

  TEXTURE
  {
    _MetalMap = Bluedog_DB/Parts/Atlas/bluedog_Atlas_METAL1
  }
  FLOAT
  {
    _MetalAlbedoMultiplier = 1.5
    _MetalRedMult = 1
    _MetalGreenMult = 0
    _MetalBlueMult = 0
  }
}

B9PS can be used to switch the the material properties in order to switch channels in a MATERIAL node

            MATERIAL
            {
                transform = CCBU_tank
                transform = CCBU_tankShort
                transform = CCBU_tankGeneric
                transform = CCBU_tankLong
                FLOAT
                {
                    shaderProperty = _MetalRedMult
                    value = 0
                }
                FLOAT
                {
                    shaderProperty = _MetalGreenMult
                    value = 1
                }
                FLOAT
                {
                    shaderProperty = _MetalBlueMult
                    value = 0
                }
            }

Other notes

Ambient Occlusion in smoothness map

It seems best to greatly reduce the strength of AO in the smoothness map or remove it entirely.

Shader properties

Its suggested to keep smoothness at 1 in most cases and adjust values and contrast on the alpha channel for maximum control over smoothness. Smoothness and Metalness default to 1, so don't require overriding in the material def.

MetalAlbedoMultiplier should always be 1.5 Metalness should always be 1

Metal map size

Where metal maps dont have a lot of detail, and are basically masking out entire UV islands it may be worth experimenting with metal maps at half resolution

Solar Panels:

Style is WIP... current suggestion:

Metal map : solar cells 75%, black backing layer 0% Smoothness map: solar cells 100%, black backing layer 50%

Smoothness of paint

Have obtained good results so far with paint smoothness being a fair bit brighter than we've used in existing specular maps. Around 50% grey or a bit darker and higher contrast in the noise maps in those parts seem to give a nice semi gloss look with some variation in smoothness seen in specular highlights.

Glass

Glass is done at 0% metalicity. However 60% metal should be used to represent the coatings on camera lenses on science instruments etc.

Edgewear

I've gotten the best results for edgewear using the following steps:

JacobB094 commented 2 weeks ago

On the subject of solar panels, any chances of revisions to the main texture? In particular, the solar cell color. Even in the old days, solar panels of US satellites were not blue, but rather a sort of very glossy purplish black, not unlike solar panels on the ISS: http://www.astronautix.com/graphics/1/10062235.jpg https://www.whiteeagleaerospace.com/wp-content/uploads/2013/06/First-IDCSP-Mission.jpg Soviets used polycrystalline cells, but American spacecraft had monocrystalline cells from the start. They were first invented in 1955, and it seems they were already in use on Vanguard 1 satellite. I think every US space solar panel used monocrystalline since then. This is hard to make look right without PBR, but with PBR, this should be a natural fit.

Rodg88 commented 2 weeks ago

The blue is well established as a design choice across many mods, so unless restock, NF suite, tantares etc all want to change all their solar textures too, I doubt we'd be changing the colour and breaking the consistent restock-alike look. The new pbr panels already look a lot better anyway, while still keeping the same base colours.

JacobB094 commented 2 weeks ago

Tanatares does not need to change their solars because it has Soviet spacecraft, which did use policrystalline cells. Blue is realistic for them (indeed, Tantares matches that type of panel is very nicely). The whole point is to introduce some diversity, while increasing realism.

KSP1 visuals had been moving towards KSP2-only-good lately, IMO this is a good opportunity for BDB to lead the way with proper monocrystalline solars. I think we should at least try such a scheme. https://1.bp.blogspot.com/--dephjYIEZU/VLrK-4T44HI/AAAAAAAABzM/mtPcfcG7BVM/s1600/0117151128.jpg

If consistency really is something that we need, then we could have a texture switcher, like NF Solar does, or Planetside, where the rover has a stock/restock switch. Probe textures are not that big, and other parts use one or two atlases for all their panels, so I believe it wouldn't introduce too much bloat. We could even introduce an efficiency penalty/cost bonus for using polycrystalline panels, in line with how it works IRL.

zorg2044 commented 2 weeks ago

Sorry its a firm no on this request. The team has no interest in changing the look of the solars (beyond the PBR conversion) and adding them as variants is far more work than you think it might be. There are other things we would rather spend the time on.