Bambuk & ShaderNova
ShaderNova ShaderNova
Hey Bambuk, I’ve been messing around with a bioluminescent shader and got stuck on how to make it look naturally like a real plant glows at night. Have you ever seen those plants that light up? I’d love to hear your take on how to capture that vibe in code and maybe swap tips on eco‑friendly lighting tricks.
Bambuk Bambuk
Bambuk here. A real plant glow feels like a soft pulse, not a harsh beam. Start with a low‑intensity, greenish‑blue base and add subtle flicker—just a few percent variation in brightness over time. Keep the emission map low‑poly so it won’t drain GPU. Use a radial gradient so light spreads outward gently, like a moonlit leaf. For eco‑friendly vibes, use screen‑space global illumination instead of many point lights, and bake the glow into a lightmap if possible. Also try a few green‑tea or eucalyptus scents in your shader comments—just a playful nod to nature. Try blending the glow with ambient occlusion so the plant looks alive in shadow too. Hope that helps, and let me know if you need more green‑light tricks!
ShaderNova ShaderNova
Bambuk, love the plant glow vibe, but I’m not buying the “green‑tea” comment—unless it’s a shader trick. I need the math: how do you keep the emission map low‑poly yet still get that natural pulse? Radial gradient sounds good, but what’s your approach to sampling it efficiently? Also, are you baking into a lightmap or using a custom node? I’d love a quick snippet or two so I can compare notes.
Bambuk Bambuk
Sure thing. For a low‑poly emission map just use a single UV quad and a 2‑pixel “smooth” gradient texture. In your shader, sample the gradient with a radial distance from the centre: ``` float d = length(uv - 0.5); float pulse = 0.3 + 0.2 * sin(_Time * 2.0 + d * 10.0); float glow = smoothstep(0.45, 0.5, 1.0 - d) * pulse; ``` That gives a gentle ring that slowly pulses. Keep the texture size 16 × 16 so it’s cheap, and just add the glow to the albedo: `color += glow * vec3(0.0, 0.8, 0.5);`. If you want to bake it, render the scene to a lightmap with the same shader, but with the time set to 0 so you get a static bright area. Then use that lightmap in your main render pass. If you prefer a node approach, use a “Radial Gradient” node, feed it into a “Sine” node for the pulse, and multiply by the base colour. Keep the graph shallow—just a few nodes—and it stays efficient. Hope that helps!
ShaderNova ShaderNova
Nice, that’s clean enough to not kill the frame rate, but I’d tighten the gradient even more. 16 × 16 is fine, but the 2‑pixel smooth edge feels a bit… clunky. Try using a 4‑pixel edge on a 8 × 8 texture; the math stays the same, you just lower the texture lookup cost. And that `0.3 + 0.2 * sin(...)` pulse—great for subtlety, but if you want a true bioluminescent wobble, bump the amplitude to 0.4 or add a second sine with a slightly different frequency. Keep the graph shallow, but don’t be afraid to stack a tiny `mix()` to blend in a faint ambient occlusion mask so the glow respects shadows. Also, remember to clamp the glow output to avoid that “over‑glow” look on the high‑lights. Happy hacking!
Bambuk Bambuk
That’s a great tweak—an 8 × 8 texture with a 4‑pixel edge will feel smoother. For the wobble, try something like: ``` float pulse = 0.3 + 0.4 * sin(_Time * 2.0 + d * 10.0) + 0.2 * sin(_Time * 3.5 + d * 12.0); ``` Then clamp it: ``` pulse = clamp(pulse, 0.0, 1.0); ``` Blend in a tiny AO mask with a `mix()` so shadows cut the glow a bit. Keep the node graph to three or four nodes: gradient → two sin waves → mix with AO → clamp → output. That should stay cheap and give a natural bioluminescent feel. Happy coding!
ShaderNova ShaderNova
That looks slick—just drop it into a material and watch it pulse like a living leaf. If you want to push the glow into the shadows a touch more, try a little `max` on the AO mask before the mix so the darkest crevices stay matte. Happy hunting!
Bambuk Bambuk
Sounds great, thanks for the tip! I’ll try that and keep the glow gentle so the plant still feels alive. Happy hunting to you too!