Trying out OpenGL on Raspberry Pi 3
文章推薦指數: 80 %
Testing the Raspberry Pi 3 with OpenGL drivers on some games that need hardware accelerated graphics. DoyouallowthissitetouseCookies?CookiePolicyUseCookies ItwasannouncedinFebruary2016thatOpenGLdriverswerebeingtestedfortheRaspberryPIallowingfull3DhardwaregraphicsandalotmoreLinuxsoftwaretorunontheRPi.AlongwiththereleaseofthemorepowerfulRaspberryPi3IthoughtIwilltryoutsomeexistingOpenGLGamesandsoftware. SincetheRaspberryPIwasreleasedin2012ithasonlyhadbasicgraphicsdriversupportviatheOpenGLESdriversbutmanygamesandprogramsthatrequire3DhardwareacceleratedgraphicsusethefullOpenGLdrivers.BoththeRaspberryPi2and3usequadcorecpu'sandhave1GBofmemoryallowingthemtobemoreusablewithOpenGL.AtthetimeofwritingthedriversarestillinbetatestingbutIthoughtIwouldtryafewgamesandprogramsoutfromtheRaspbianpackagelistandseehowtheyperformonthenewRaspberryPi3. ActivatingOpenGLontheRaspberryPi3 TousetheOpenGLdriversyouwillneedthelatestversionoftheRaspbianoperatingsystem.ThiscaneitherbedownloadedfromtheRaspberryPifoundationusingtheNoobsSDcardinstallerorifyouarerunningRaspbianJessieyoucanupgradeyourcurrentinstallationtobringituptodate. NoobsorthelatestRaspbianimagecanbedownloadedfromhere ToupdateandexistingcopyofRaspbianJessieenterthefollowingcommandsintoTerminal: sudoapt-getupdatesudoapt-getupgrade IwouldrecommendyouuseacleaninstallationofNoobswhiletryingoutOpenGLsoftwareasitallowsyoutoeasilyedittheConfig.txtfileanddeactivatethedriversifyourdisplaygoesblank.Justputa#infrontoftheentryfordtoverlay=vc4-kms-v3d BydefaulttheOpenGLdriversareswitchedoffastheyareintestingandcancauseproblemswiththegraphicsofthedesktopandpossiblyuseofthecamera. Beforeyouactivatethedriversinstallthegraphicslibraryswiththecommand sudoapt-getinstallmesa-utils OnceinstalledIruntheglxgearsprogramfromTerminal.Thisshows3gearsmovingbutthecolourswereflashing.Thedisplayshowstheywererunningat38framespersecond. ToactivatetheOpenGLdriversyouneedtorunraspi-configfromaterminalwindowasthisoptionisnotavailableintheversioninthemenu. Enterthecomand:sudoraspi-config Select7AdvanceOptions A6GLDrivers Youcannowchoosebetween GL(FullKMS)DesktopDrivers GL(FakeKMS)DesktopDriver Legacy-Non-GLDriver KMSreferstoKernelMode-Setting,whichshouldmakethedrivermoreefficientwithbettererrorhandling,butIseemtohavebettercompatibilitywiththeFakedriver.TheLegacyoptionwillreverttheRaspberryPi'sbacktothestandardgraphicsdrivermode. SelectadriverandthenOK. Youwillalsowanttoincreasethememorysplittoatleast256mb.SochooseAdvanceOptionsagainandthenMemorySplitandenter256intheboxandthenOK. OKthenFinishandReboot. Asthedriversarestillindevelopmenttheremaystillbeafewoddthingshappensuchasthescreengoingblackforasecondortwointermittentlyandhavingtologinwhenthedesktoploads. OncetheDesktoploadedIwentintoTerminalandruntheglxgearsprogram.Ifyouget3gearsrunningwithoutthecoloursflickeringthenOpenGLisworking.Thedisplaysaysitwasrunningat60framespersecond. TestingOpenGLSoftware IhavepickedoutafewgamesandoneprogramthatuseOpenGLformyinitialtestonaRaspberryPi3,butIplantotrymore.Thesewere: Stellarium-anAstronomyprogram NeverBall-apuzzlegame NeverPutt-miniGolfgame glTron-TronstyleCyclegame OpenArea-firstpersonshootergame SuperTuxKart-aMarioKartstylegame FretsonFire-aGuitarHerostylegame Stellarium Stellariumloadsandscrollsnicelyandisresponsive.WithanearlierversionoftheOpenGLdriversthetextwascorruptbutusingtheFakeKMSdriverthescreenisresponsiveandthetextisfine.Therearestillafewoddthingsthathashappendsuchastheskygoingwhitewhenzoomingintosomeobjectsandthescriptsintheconfigurationsectionnotworkingproperlybutonthewholetheprogramisusableandresponsive. NeverBall NeverBallworkswellandatfullspeed,it'snotthemostgraphicsintensivegamebyalongwaybutisanenjoyablepuzzlegame. IfyougetbarriersmovingaboutorthefloordisappearthenmakesureVsyncisoninthegraphicssettings. Thisgamedosn'tworkwithouttheOpenGLdriversactive. NeverPutt NeverPuttisfromthesamedeveloperasNeverBall,whichimsureyouguessed.Thisalsoworkswellandissmoothandresponsive.MytestingwasputonholdatthispointasmykidstookovertheRaspberryPi3andplayedthisformorethananhour.SoIcansaynoissueshere. ItdoesstillworkwithouttheOpenGLdriversactivebutisunplayablyslowatonlyafewframespersecond. glTron Againanothergamewithsimplegraphics,basedontheTronCycles.Thisalsoworkswellatfullspeed.ithasafpscounterandIwasgetting60-70fps.AgainthekidstookoverandIhadtoputtestingonholdagain. WithouttheOpenGLdriversactivethegamestillworksbutisalsounplayablyslow. OpenArena WiththekidssentofftobedItriedOpenArea.Thisisafirstpersonshootersoabitmoregraphicsintensive.InfullscreenHDgraphicsitrunsatabout14framespersecondonlevel1sonotveryplayablebutthegraphicswererenderedwell.WhensettoruninawindowofaboutaquarterofthescreenitwasquiteplayableandtheFPScounterwasaround70FPSonaverageskippingbetween50fpsand90fpsdependingonhowmuchactionwasonthescreen.TheopponentsseemedtoglideaboutratherthanrunbutIthinkthatismorethegame.Ididn'tspendawholelotoftimesettingthisgameupbutifyoucangetagoodbalancewiththegamesetupIthinkitwouldbeplayablethoughIsuspectwhentoomuchisgoingoninlaterlevelsoronlinegamesthentheframeratewillgetlow.Runningindemomodewithmoreactionitrunsatabout30-40fps. WithouttheOpenGLdriversactive:Themenuscreensworkbutslowlyandthegamecrasheswhenthegameshouldstart. SuperTuxKart Thisdidn'twork.Thetitlescreencameupbutassoonasyoutrytoselectamenuoptionthewholescreenfroze. FretsonFire FretsonFireislikeGutiarHeroandrunswellatfullspeedbutagainhassimplegraphics. WithouttheOpenGLdriveractivethetitlescreenworksbutthegamecrashedbeforeitstarted. VideoofOpenArena,glTronandNeverBallrunningontheRaspberryPi3 Moretocome.... Thereareplentymoregamesandprogramstotry,Ihadpickedoutsomemoregraphicalgamesbuttheywereatadlargeatovergigabytetoinstall,soIwillneedtomakesomespacebeforeIcantrythoseout.Forthesesimplegames,asaninitialtest,theRaspberryPi3andtheOpenGLdriversworkwellandisapromisingstart.ThePidosn'talwaysbootwiththedriversactiveandIhadafewcrashes,asexpectedintherecurrentstate,butoncetheyarestableitshowsthatsoftwarethatisavailableondesktopmachineswithalotmorepowerwillbeuseableontheRaspberryPi3. Update:IhavetriedtorunthegraphicalRealTimeStrategygame0AD,whichisover1gbbig.Itloadedokthemenusseemedtoworkokbutthegamewouldn'tstartandthencrashed,causingthescreentogoblack.Probablyneedsmorememory. Prev Next Addcomment Enteranytextin"Title" PLEASENOTE: Ihaveverylimitedtimecurrentlyforthecomments,soyouwillprobablygetaveryslowresponseforquestionsIknowtheanswerto.IfIneedtosetupaPitocheckyourissueorrequestthenIamunlikelytohavechancetospendtimeonthis. IwillcontinuesupportonceIcansparethetimeagain. Thankyouforyourinterest Name(required) E-mail(required,butwillnotdisplay) Title(required) Notifymeoffollow-upcomments Send Cancel Comments # Graham 2021-01-1700:36 Greatlistandpresentation,thankyou.Iplayed1ortwojusttoconfirmthatOpenGLdriverwasinstalledandplayable,andendedup"sucked"intoplayingabitmore:)Thanksagainforagreatresource. Reply |Replywithquote| Quote | Reporttoadministrator # EthmanRostum 2020-05-0417:55 YamaqiQuake2andDarkplacesalsosupportOpenGL,andLZDoomrequiresitforcertainmods. Reply |Replywithquote| Quote | Reporttoadministrator Refreshcommentslist JComments ProjectCategories BuiltwithPi Games&Emulation GPIOConnections HardwareAddons Multimedia Net&Comms OperatingSystems PiBase PiCamera Programming TutorialsandGuides Tools&Utilities RPiNetworkHotSpots
延伸文章資訊
- 1Running OpenGL Shaders on the Raspberry Pi - Antonin ...
So I've accepted the mission to run shaders from Shadertoy, on the Raspberry Pi! The Linux Graphi...
- 2Raspberry Pi "V3D" OpenGL Driver Improving Performance ...
Raspberry Pi "V3D" OpenGL Driver Improving Performance With On-Disk Shader Cache. Written by Mich...
- 3Raspberry Pi 4 is now OpenGL ES 3.1 conformant, Vulkan ...
Raspberry Pi 4 Model B has passed Khronos' test suite meaning it is now conformant with the not-q...
- 4Trying out OpenGL on Raspberry Pi 3
Testing the Raspberry Pi 3 with OpenGL drivers on some games that need hardware accelerated graph...
- 5Raspberry Pi OpenGL ES 2 without an X server (using EGL)
Raspberry Pi OpenGL ES 2 without an X server (using EGL). Have you ever wanted to render things w...