use size instead of scale

This commit is contained in:
JohnCorby 2023-04-21 19:39:10 -07:00
parent 7866981119
commit 468126b9b0
2 changed files with 9 additions and 9 deletions

View File

@ -111,8 +111,8 @@ namespace NewHorizons.Builder.Body
// If the texturemap is the same as the heightmap don't delete it #176 // If the texturemap is the same as the heightmap don't delete it #176
// Do the same with emissionmap // Do the same with emissionmap
// honestly, if you do this with other maps, thats on you // todo? maybe do this with the other maps, if someone were to ever use heightmap for them (altho that wouldnt make any sense if they did)
if (heightMap == textureMap || heightMap == emissionMap) deleteHeightmapFlag = false; if (textureMap == heightMap || emissionMap == heightMap) deleteHeightmapFlag = false;
} }
catch (Exception e) catch (Exception e)
{ {
@ -200,7 +200,7 @@ namespace NewHorizons.Builder.Body
if (module.baseTile != null) if (module.baseTile != null)
{ {
material.EnableKeyword("BASE_TILE"); material.EnableKeyword("BASE_TILE");
material.SetFloat("_BaseTileScale", module.baseTile.scale); material.SetFloat("_BaseTileScale", 1 / module.baseTile.size);
material.SetTexture("_BaseTileAlbedo", baseTextureTile); material.SetTexture("_BaseTileAlbedo", baseTextureTile);
material.SetTexture("_BaseTileSmoothnessMap", baseSmoothnessTile); material.SetTexture("_BaseTileSmoothnessMap", baseSmoothnessTile);
material.SetFloat("_BaseTileBumpStrength", module.baseTile.normalStrength); material.SetFloat("_BaseTileBumpStrength", module.baseTile.normalStrength);
@ -213,7 +213,7 @@ namespace NewHorizons.Builder.Body
if (module.redTile != null) if (module.redTile != null)
{ {
material.EnableKeyword("RED_TILE"); material.EnableKeyword("RED_TILE");
material.SetFloat("_RedTileScale", module.redTile.scale); material.SetFloat("_RedTileScale", 1 / module.redTile.size);
material.SetTexture("_RedTileAlbedo", redTextureTile); material.SetTexture("_RedTileAlbedo", redTextureTile);
material.SetTexture("_RedTileSmoothnessMap", redSmoothnessTile); material.SetTexture("_RedTileSmoothnessMap", redSmoothnessTile);
material.SetFloat("_RedTileBumpStrength", module.redTile.normalStrength); material.SetFloat("_RedTileBumpStrength", module.redTile.normalStrength);
@ -226,7 +226,7 @@ namespace NewHorizons.Builder.Body
if (module.greenTile != null) if (module.greenTile != null)
{ {
material.EnableKeyword("GREEN_TILE"); material.EnableKeyword("GREEN_TILE");
material.SetFloat("_GreenTileScale", module.greenTile.scale); material.SetFloat("_GreenTileScale", 1 / module.greenTile.size);
material.SetTexture("_GreenTileAlbedo", greenTextureTile); material.SetTexture("_GreenTileAlbedo", greenTextureTile);
material.SetTexture("_GreenTileSmoothnessMap", greenSmoothnessTile); material.SetTexture("_GreenTileSmoothnessMap", greenSmoothnessTile);
material.SetFloat("_GreenTileBumpStrength", module.greenTile.normalStrength); material.SetFloat("_GreenTileBumpStrength", module.greenTile.normalStrength);
@ -239,7 +239,7 @@ namespace NewHorizons.Builder.Body
if (module.blueTile != null) if (module.blueTile != null)
{ {
material.EnableKeyword("BLUE_TILE"); material.EnableKeyword("BLUE_TILE");
material.SetFloat("_BlueTileScale", module.blueTile.scale); material.SetFloat("_BlueTileScale", 1 / module.blueTile.size);
material.SetTexture("_BlueTileAlbedo", blueTextureTile); material.SetTexture("_BlueTileAlbedo", blueTextureTile);
material.SetTexture("_BlueTileSmoothnessMap", blueSmoothnessTile); material.SetTexture("_BlueTileSmoothnessMap", blueSmoothnessTile);
material.SetFloat("_BlueTileBumpStrength", module.blueTile.normalStrength); material.SetFloat("_BlueTileBumpStrength", module.blueTile.normalStrength);
@ -252,7 +252,7 @@ namespace NewHorizons.Builder.Body
if (module.alphaTile != null) if (module.alphaTile != null)
{ {
material.EnableKeyword("ALPHA_TILE"); material.EnableKeyword("ALPHA_TILE");
material.SetFloat("_AlphaTileScale", module.alphaTile.scale); material.SetFloat("_AlphaTileScale", 1 / module.alphaTile.size);
material.SetTexture("_AlphaTileAlbedo", alphaTextureTile); material.SetTexture("_AlphaTileAlbedo", alphaTextureTile);
material.SetTexture("_AlphaTileSmoothnessMap", alphaSmoothnessTile); material.SetTexture("_AlphaTileSmoothnessMap", alphaSmoothnessTile);
material.SetFloat("_AlphaTileBumpStrength", module.alphaTile.normalStrength); material.SetFloat("_AlphaTileBumpStrength", module.alphaTile.normalStrength);

View File

@ -125,11 +125,11 @@ namespace NewHorizons.External.Modules
public class HeightMapTileInfo public class HeightMapTileInfo
{ {
/// <summary> /// <summary>
/// How many times this tile will tile across each "side" of the planet, so around the equator, this tile will loop scale * 4 times. /// The size, in meters, of each tile.
/// </summary> /// </summary>
[Range(0f, double.MaxValue)] [Range(0f, double.MaxValue)]
[DefaultValue(1f)] [DefaultValue(1f)]
public float scale = 1f; public float size = 1f;
/// <summary> /// <summary>
/// Relative filepath to a color texture. Optional. /// Relative filepath to a color texture. Optional.