I’m trying to make text glow with Bloom, but I can’t seem to find a way to get an emissive material. Is it possible?
by user 300386587278049291
I’m trying to make text glow with Bloom, but I can’t seem to find a way to get an emissive material. Is it possible?
by user 300386587278049291
Hey you should be able to just set the color property to something above <0,1> range
@serializable(Text)
text?: Text;
update(): void {
if(!this.text) return;
this.text.color.r += this.context.time.deltaTime;
}
If you want to streamline it a bit more, you can make a HDR color property in Unity like so:
import { Behaviour, RGBAColor, serializable, Text } from "@needle-tools/engine";
export class GlowingText extends Behaviour {
// @nonSerialized
@serializable(RGBAColor)
color: RGBAColor = new RGBAColor(1, 1, 1, 1);
awake(): void {
const text = this.gameObject.getComponent(Text);
if(text) {
console.log(this.color);
text.color = this.color;
}
}
}
using UnityEngine;
// NEEDLE_CODEGEN_START
// auto generated code - do not edit directly
#pragma warning disable
namespace Needle.Typescript.GeneratedComponents
{
public partial class GlowingText : UnityEngine.MonoBehaviour
{
public void awake(){}
}
}
// NEEDLE_CODEGEN_END
namespace Needle.Typescript.GeneratedComponents
{
public partial class GlowingText : UnityEngine.MonoBehaviour
{
[ColorUsage(true, true)]
public Color @color;
}
}
The attribute Color Usage enables the intensity in the color picker → Which results in values that are larger then <0, 1>
Wow so simple! Can’t believe I didn’t try this thank you so much for the explanation and code snippets!
by user 300386587278049291
Yeah, i jumped the ship as well. First i wanted to edit the shader… hit a dead end. Then i edited the color directly on the TMUI component and then i tried the color property slowly domming it down.
Will be also apart of a new samples release