Is WebGL capable of using the GPU's full power?
文章推薦指數: 80 %
I tried running a GPU intensive WebGL shader and couldnt get my GPU to peak over ~30% usage in task manager, even when visiting pages that ...
Home
Public
Questions
Tags
Users
Companies
Collectives
ExploreCollectives
Teams
StackOverflowforTeams
–Startcollaboratingandsharingorganizationalknowledge.
CreateafreeTeam
WhyTeams?
Teams
CreatefreeTeam
Collectives™onStackOverflow
Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost.
LearnmoreaboutCollectives
Teams
Q&Aforwork
Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch.
LearnmoreaboutTeams
IsWebGLcapableofusingtheGPU'sfullpower?
AskQuestion
Asked
3years,4monthsago
Modified
3years,4monthsago
Viewed
4ktimes
3
1
ItriedrunningaGPUintensiveWebGLshaderandcouldntgetmyGPUtopeakover~30%usageintaskmanager,evenwhenvisitingpagesthatbenchmarkwildWebGLsimulationslikethisonewhichrenders30,000fishinacomplexenvironment.PerhapsthisisaWebGLsecurityfeature?Isthereanywayprogramatically,evenifitinvolvesdisablingsecuritysettingsinthebrowser(anybrowser),toforceWebGLtoutilize100%oftheGPU?
webgl
Share
Improvethisquestion
Follow
askedApr6,2019at19:41
J.ToddJ.Todd
60111goldbadge1010silverbadges2828bronzebadges
Addacomment
|
1Answer
1
Sortedby:
Resettodefault
Highestscore(default)
Trending(recentvotescountmore)
Datemodified(newestfirst)
Datecreated(oldestfirst)
3
Whatdidyoutry?It'strivaltouse100%ofyourGPUspower.Justgiveitsomethingtodrawthattakesalongtime.Theaquariumyoulinkedtoisnotdesignedtodothat.
Here'satrivalone
constgl=document.createElement('canvas').getContext('webgl');
gl.canvas.width=2048;
gl.canvas.height=2048;
constvs=`
attributevec4position;
voidmain(){
gl_Position=position;
}
`;
constfs=`
precisionmediumpfloat;
voidmain(){
gl_FragColor=vec4(1);
}
`;
constquad=[
-1,-1,
1,-1,
-1,1,
-1,1,
1,-1,
1,1,
];
constmaxQuads=50000;
constquads=[];
for(leti=0;i increasenumbertoincreaseGPUusage.LargenumberswillgetthebrowserorOStoresettheGPU.
延伸文章資訊
- 1WebGL GPGPU
GPGPU is "General Purpose" GPU and means using the GPU for something other than drawing pixels. T...
- 2WebGL - 维基百科,自由的百科全书
WebGL完全整合到瀏覽器的所有網頁標準中,可將影像處理和效果的GPU加速使用方式當做網頁Canvas的一部分。WebGL元素可以加入其他HTML元素之中並與網頁或網頁背景的其他部分 ...
- 3[Day3] 影像、GPU、webGL - iT 邦幫忙
[Day3] 影像、GPU、webGL. WebGL 與Three.js 初探系列第3 篇. 愷開. 6 年前‧ 7208 瀏覽. 0. 身為一位工程師,我知道各位已經迫不急待想要動手開始寫程式了。
- 4Day04] 為什麼WebGL 的效能這麼強?
WebGL 程式由JavaScript 編寫的控制代碼和 OpenGL Shading Language(GLSL)編寫的著色器程式碼組成. 這段話敘述了兩件事:. JavaScript 控制;...
- 5使用WebGL 繪圖的基本步驟 - 3D 網站開發入門筆記
目前有兩個主要的GPU 繪圖介面:OpenGL 和微軟的DirectX。 WebGL 可以把JavaScript 和OpenGL ES 2.0 結合在一起,為HTML5 Canvas 提供硬體3...