Fix text rendering yet again

pull/21/head
Andrew Cassidy 4 years ago
parent 5f23ce2a31
commit 436c56e6eb
No known key found for this signature in database
GPG Key ID: 963017B38FD477A1

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c052218d804b37076ca9ffc2b0793a679927fc9cc4ce66b34c683a6b60f8da5f
size 85504
oid sha256:cedff4e96de1dfcaee14eb43cc6a258bf17be3c6fcec42f6e48249668d8aefa9
size 87040

@ -6,7 +6,7 @@ using UnityEngine;
using UnityEngine.Events;
namespace ConformalDecals.Text {
[KSPAddon(KSPAddon.Startup.Instantly, true)]
[KSPAddon(KSPAddon.Startup.EveryScene, false)]
public class TextRenderer : MonoBehaviour {
public const TextureFormat TextTextureFormat = TextureFormat.RG16;
public const RenderTextureFormat TextRenderTextureFormat = RenderTextureFormat.R8;
@ -166,6 +166,7 @@ namespace ConformalDecals.Text {
_tmp.fontSize = FontSize;
// GENERATE MESH
_tmp.ClearMesh(false);
_tmp.ForceMeshUpdate();
var meshFilters = gameObject.GetComponentsInChildren<MeshFilter>();
@ -180,7 +181,7 @@ namespace ConformalDecals.Text {
var renderer = meshFilters[i].gameObject.GetComponent<MeshRenderer>();
meshes[i] = meshFilters[i].mesh;
meshes[i].RecalculateBounds();
if (i == 0) meshes[i] = _tmp.mesh;
materials[i] = Instantiate(renderer.material);
materials[i].shader = _blitShader;

Loading…
Cancel
Save