opengl-canvas-wasm | Minimal example of animating the HTML5 canvas | Canvas library
kandi X-RAY | opengl-canvas-wasm Summary
kandi X-RAY | opengl-canvas-wasm Summary
Minimal example of animating the HTML5 canvas from C++ using OpenGL through WebAssembly
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of opengl-canvas-wasm
opengl-canvas-wasm Key Features
opengl-canvas-wasm Examples and Code Snippets
Community Discussions
Trending Discussions on opengl-canvas-wasm
QUESTION
I am making a game using webassembly (C++ and emscripten), where I am using OpenGL to generate graphics. I have noticed that my game often uses a lot of CPU, typically 200-300%. This CPU usage becomes higher if I have a larger 3D model or if my shader is more complicated.
Is this normal for webassembly? Or am I doing something wrong? I'm bit worried that I made a mistake since normally I would not expect the CPU usage to be directly linked to the size of 3D models (I would expect that to mostly take a toll on the graphics card), but since it is webassembly it might be different.
Are there any good tips for trying to reduce CPU usage when running OpenGL and webassembly?
Edit:
The basic example I started working from was
https://github.com/timhutton/opengl-canvas-wasm
live demo here (https://timhutton.github.io/opengl-canvas-wasm/)
This already runs at quite high CPU. What is wrong with that example making it run at such high CPU load? It is not the glBufferData
, even removing that keeps the CPU high.
ANSWER
Answered 2021-Jan-31 at 04:35Your browser may use software rendering for some reason, check your browsers GPU debugging page to see if there's anything wrong, in Chrome that is chrome://gpu
, in Firefox it's the GPU section in about:support
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install opengl-canvas-wasm
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page