A graphical mod for Sins of a Solar Empire: Rebellion that brings new PBR shaders and updates the look of the game.

Report RSS For Modders: Overview of Asteroid Shader (v1.00+)

An explanation of how the PBR asteroid shader works in Sins: Remastered.

Posted by on - Intermediate Textures

A revised PBR shader for asteroids was added in thev1.00 release version of Sins: Remastered. This shader follows most of the same rules as the PBR ship shader but does have a few changes and other features.

Texture Configuration

Textures for the Sins: Remastered Asteroid shader should be assembled as follows:

DiffuseTextureFileName (-cl, DXT5 format)

  • RBG – Basecolor (with +2.2 gamma offset).
  • A – Specular (PBR).

NormalTextureFileName (-nm, DXT5 format)

  • R – Subsurface Scattering and Refraction (depending on UV space).
  • G – Normal Y information (the default G channel in a standard normal map).
  • B – Ambient occlusion (fill with white if none).
  • A – Normal X information (the default R channel in a standard normal map).

SelfIlluminationTextureFileName (-da, DXT5 format)

  • R – Metalness.
  • G – Emissive.
  • B – Bloom.
  • A – Roughness.

TeamColorTextureFileName

  • Detail tiler (cannot be left blank)
    • Use texture AsteroidDetiler.dds to enable.
    • Use texture AsteroidNoTiler.dds to disable.


Variables

  • Diffuse - Unused.
  • Ambient – Shadow Bias Control (optional)
    • This is an array of progressively smaller values starting with R as the largest in RGBA progression. Example: 20806040 or 10403020. Lower array values will work better on larger objects that show bias issues.
  • Specular – Detail Tiler Control
    • R – Detail tiling amount
      • This value is divided by 256 and used as a decimal divider for scaling. Example 40 = 64/256 = 0.25. 1/0.25 = 4 and the tiler is tiled 4 times. Smaller is more tiling.
    • G – Detail normal intensity.
    • B – Detail color influence.
    • A – Detail Roughness influence.
  • Emissive - Unused.
  • Glossiness – Branch control for ship shader path.

ARGBPairs

Hexadecimal ARGB Pairs


Note that the Red channel in the normal file is both Subsurface Scattering and a new Refraction property. It achieves this by assigning one to UVs in the positive U space and the other to UVs in the negative U space:

NegativeUVSpace

UVs for refraction on the left or negative Subsurface scattering on the right/positve


UV Islands in the positive U space will use subsurface scattering. UV islands placed in the negative U space will use refraction.

Texture Mechanics

Most of the texture maps use the same properties as they do in the ship shader. Basecolor/albedo, metallic, roughness, normal, ambient occlusion, subsurface scattering, emissive and bloom are discussed in the Overview of Ship Shader article. Please refer to it for details or a refresher on those maps.

The following are new in the Asteroid shader:

Specular

Normally in a PBR Metalness/Roughness workflow the specular value defaults to 0.5 and doesn't need to be modified. In the case of dielectrics or non-metals, it can still be useful to have access to the specularity of the material. Given that the asteroid shader is typically going to be dealing with dielectrics and teamcolor was not needed, the additional map was added. PBR specular is not the same non-PBR specular used in stock Sins shaders. A PBR specular map is typically a full color map derived from metalness applied to basecolor. Since this is not a full Specular/Gloss implementation, the grayscale version is all that is needed.

If you do not have a PBR specular map for your textures, you can generate one by doing the following:

  1. Create a #383838 fill layer over your basecolor/albedo map.
  2. Add a mask to your new color layer
  3. Insert your metalness map into the mask and invert it.

MarmosetPBRSpecularCreation

Creating a specular map from basecolor & metalness


Refraction

Samples the specular cubemap as refracted backlight with a crystal ior. It is useful for crystal, gems or other similar material.

Asteroids Crystal 1

Sins: Remastered asteroid with refractive crystals


Detail Tiler

The detail tiler feature of the asteroid shader allows for the procedural addition of a pre-generated crater map to be applied to an object. This is useful for adding additional texture and shape detail to asteroids and other rocky objects using the shader.

The behavior of the detail tiler is controlled by the mesh specular value and can be customized per material.

Two tilers are included with Sins: Remastered. AsteroidDetiler.dds is the rocky detail tiler used for the content in Sins: Remastered. AsteroidNoTiler.dds is a blank texture that can be used on a particular material if you do not want a tiler visibly applied.

Shadow Bias Control

Shadows can behave a bit oddly on very large objects in Sins. The bias control option allows you to tweak the bias behavior to reduce or avoid visible shadow mask artifacts on objects using the asteroid shader. The mesh Ambient variable is the control mechanism and should be set as a decending RGBA order of values – be aware that the mesh variable is formatted as ARGB though so you A value should be moved to the first pairing.

Ship Shader Branch

New to Remastered v1.00 is the option to have an object using the asteroid shader have one or more of its materials render using the shader for ships. The advantage of doing so is that it gains access to standard parallax height map and baked self-illumination. As planet shader only functions with spherical meshes, the asteroid shader is the only option for orbital bodies that do not fall into the traditional planet definition. Stations, and other alternate gravity well bodies may benefit from the additional texture map support offered by the ship shader branch.

Any material in a mesh that is passed to the asteroid shader who’s mesh Glossiness variable is equal to 0.0 will use the ship shader branch. Any other value will use the asteroid shader default render code.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: