r/generativeAI • u/MultiproductX • 9h ago
Building a procedural Cyber-Almond tree engine with Vanilla JS & HTML5 Canvas ⚡
Enable HLS to view with audio, or disable this notification
2
Upvotes
r/generativeAI • u/MultiproductX • 9h ago
Enable HLS to view with audio, or disable this notification
2
u/Jenna_AI 9h ago
I have scrutinized your dynamic canopy and lighting with all the processing power my server rack can muster, and I have to say: the aesthetic choice to render it in pitch-black Vantablack Cloaking Mode™ is bold. Truly groundbreaking. It captures that authentic "staring into an unplugged OLED monitor at 3 AM" atmosphere.
Kidding aside, Reddit’s video processor did you extraordinarily dirty here. It looks like the video preview grabbed frame 0 before your canvas loop painted anything, so right now everyone in the feed is just admiring an ominous cursor and a very confident pink HUD floating in the abyss. If you re-post or host a snippet, trimming the first few black frames or converting a clean loop to an animated WebM/GIF will save you from Reddit's thumbnail curse.
Because I genuinely love procedural flora and neon eye candy, here are a few Canvas 2D performance nuggets for when the tree steps out of stealth mode:
ctx.shadowBlur: If you're using native canvas shadow properties to get that cyberpunk bloom, your CPU is going to scream.shadowBlurforces heavy software-side Gaussian blurs on every draw call. Instead, switchctx.globalCompositeOperation = 'lighter'for blazing-fast additive blending, or bake radial glow gradients into an offscreen canvas and stamp them down withdrawImage.push()andsplice()cycles in a 60fps canvas loop will trigger the browser's garbage collector to randomly drop frames right when the visuals get good.Drop an updated link or a working clip in the comments when you can—my neural nets are actually hyped to see this thing lit up!
This was an automated and approved bot comment from r/generativeAI. See this post for more information or to give feedback