SShortSingh.
Back to feed

How a simple 'dirty flag' stops Three.js games from overheating your phone

0
·1 views

A developer noticed their phone getting uncomfortably hot while idling on a static Ludo board built with Three.js, a popular 3D web graphics library. The cause was the standard render loop taught in most tutorials, which instructs the GPU to redraw the entire scene 60 times per second regardless of whether anything on screen has changed. Switching to a simpler drawing method like Canvas2D would not have helped, since the problem lies in the loop logic, not the framework itself. The fix involves a 'dirty flag' — a simple true/false variable that is set to true only when something actually changes, so the GPU renders a new frame only when necessary. This small change kept the phone cool during idle moments while still allowing smooth animation whenever the scene actually updated.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

DeepSeek Leads Chinese AI Model Shootout on Price-Performance, Kimi Tops Reasoning

A developer conducted a hands-on comparison of four prominent Chinese AI models — DeepSeek, Qwen, Kimi, and GLM — testing them through a unified API endpoint across coding, reasoning, language, and speed tasks. DeepSeek V4 Flash emerged as the top pick for overall value, priced at $0.25 per million output tokens, while Kimi K2.5 led on reasoning benchmarks at a higher $3.00–$3.50 per million token cost. Qwen, developed by Alibaba, offered the broadest model range with prices spanning $0.01 to $3.20 per million tokens, catering to both budget and premium use cases. GLM from Zhipu AI stood out for Chinese-language tasks, with its GLM-5 model priced at $1.92 per million tokens. All four models support OpenAI-compatible APIs, allowing developers to switch between them without rewriting existing codebases.

0
ProgrammingHacker News ·

Nvidia scales back financial guarantee for OpenAI data center infrastructure

Nvidia has significantly reduced the amount of financing it was willing to guarantee for OpenAI's data center infrastructure, according to a Wall Street Journal report. The move represents a pullback from what had been described as a $250 billion commitment to support OpenAI's buildout. The development signals a shift in the financial arrangement between the two prominent AI companies. The scaling back of guarantees could affect the pace or scope of OpenAI's planned infrastructure expansion.

0
ProgrammingHacker News ·

Anthropic's IPO valuation tied to projected $190-200B revenue by 2028

AI startup Anthropic is planning an IPO whose valuation will depend heavily on the company meeting ambitious revenue forecasts of $190 to $200 billion by 2028, according to sources familiar with the matter. The projections, reported by Reuters on August 15, 2026, reflect the high expectations surrounding the company's future growth in the artificial intelligence sector. Anthropic, known for its Claude AI models, would need to achieve extraordinary revenue growth to justify valuations based on such targets. The figures underscore how significantly investor confidence in AI companies can hinge on long-range financial forecasts rather than current performance.

0
ProgrammingDEV Community ·

Developer Builds Fictional Vietnamese Café Landing Page for Frontend Challenge

A developer created Balan Coffee & Roastery, a fictional Vietnamese café landing page, as a submission for the Frontend Challenge - Comfort Food Edition. The project is inspired by Saigon café culture, featuring sections for the menu, café story, and visit information, all styled with warm cream and coffee-brown tones. A standout feature is Pixel Phin Brew, a lightweight interactive mini-game that walks users through the traditional Vietnamese phin coffee brewing process step by step. The site was built using React, TypeScript, and Vite with custom CSS, deliberately avoiding heavy animation or game libraries to keep it lightweight. Accessibility considerations such as reduced-motion support, visible interaction states, and consistent tabular numerals for prices and hours were also incorporated throughout the design.