Skip to content

Commit

Permalink
Fix cap texture offset, adjust scaling slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeOnTea committed Jan 18, 2019
1 parent 607da4d commit 11304e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/ProceduralPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -966,9 +966,9 @@ private void SetupEndsTexture(Material endsMaterial, TextureSet tex, Vector2 sca

private static void SetEndsTextureProperties(Material endsMaterial, Texture texture, Texture bumpMap, Color specular, float shininess, bool autoScale, Vector2 scaleUV)
{
var endsScaleFactor = autoScale ? scaleUV.x / Mathf.PI * 2 : 0.93f;
var endsScaleFactor = autoScale ? scaleUV.x / Mathf.PI * 2 : 0.95f;
var endsScale = new Vector2(endsScaleFactor, endsScaleFactor);
var offset = (1f / endsScaleFactor - 1f) / 2f;
var offset = 0.5f - 0.5f * endsScaleFactor;
var endsOffset = new Vector2(offset, offset);
endsMaterial.mainTextureScale = endsScale;
endsMaterial.mainTextureOffset = endsOffset;
Expand Down

0 comments on commit 11304e0

Please sign in to comment.