OpenGL versions - Raspberry Pi Forums
文章推薦指數: 80 %
I have a relatively simple OpenGL application (oscilloscope display) that I'd like to run on the widest range of Pi hardware, with the smallest ... ForumFAQ About Aboutus Contactus Documentation Trademarkrules Login Register Unansweredtopics Activetopics ForumFAQ About Aboutus Contactus Documentation Trademarkrules Boardindex Programming Graphicsprogramming OpenGLES OpenGLversions Locked Printview 7posts •Page1of1 jayben Posts:443 Joined:MonAug19,20199:56pm OpenGLversions WedDec09,202010:49am IhavearelativelysimpleOpenGLapplication(oscilloscopedisplay)thatI'dliketorunonthewidestrangeofPihardware,withthesmallestcomplicationinstallinggraphicsdrivers. I'veinstalledfreeglut3-devandlibglew-devfromthelatestdistro. Pi3worksfine;glGetString(GL_VERSION)returns"3.1Mesa19.3.2".Noproblem;Icanlivewiththelimitationsof3.1,andtheshadercompilersdoaccept'#version140'intheGLSLcode. Pi4returns"2.1Mesa19.3.2",whichisanuisance,astherearesome3.1featuresI'dliketouse:GLSL'#version140'returnsanerror. PrefixingthePi4applicationwith'MESA_GL_VERSION_OVERRIDE=3.3'magicallyfixesthisproblem,asthecodereports"version3.3(CompatibilityProfile)Mesa19.3.2". Myquestionsare: 1.Theoverrideissupposedlyonlyfordebugging;willallthe3.1featuresreallybeavailable?Ifnot,howdoIdiscoverwhatismissing? 2.HowdoIinstalla'real'OpenGL3.1driveronthePi4? 3.ThePizerohasaVideocoreGPU,andOpenGLreturnsthe3.1versionstring,buteverythingrunsincrediblyslowly(maybewithsoftwareemulation?).IstheGPUusableforsimpleprograms? Thanksalot, Jayben Paeryn Posts:3470 Joined:WedNov23,20111:10am Location:Sheffield,England Re:OpenGLversions WedDec09,20207:48pm jaybenwrote:↑WedDec09,202010:49am IhavearelativelysimpleOpenGLapplication(oscilloscopedisplay)thatI'dliketorunonthewidestrangeofPihardware,withthesmallestcomplicationinstallinggraphicsdrivers. I'veinstalledfreeglut3-devandlibglew-devfromthelatestdistro. Pi3worksfine;glGetString(GL_VERSION)returns"3.1Mesa19.3.2".Noproblem;Icanlivewiththelimitationsof3.1,andtheshadercompilersdoaccept'#version140'intheGLSLcode. Pi4returns"2.1Mesa19.3.2",whichisanuisance,astherearesome3.1featuresI'dliketouse:GLSL'#version140'returnsanerror. PrefixingthePi4applicationwith'MESA_GL_VERSION_OVERRIDE=3.3'magicallyfixesthisproblem,asthecodereports"version3.3(CompatibilityProfile)Mesa19.3.2". Myquestionsare: 1.Theoverrideissupposedlyonlyfordebugging;willallthe3.1featuresreallybeavailable?Ifnot,howdoIdiscoverwhatismissing? 2.HowdoIinstalla'real'OpenGL3.1driveronthePi4? 3.ThePizerohasaVideocoreGPU,andOpenGLreturnsthe3.1versionstring,buteverythingrunsincrediblyslowly(maybewithsoftwareemulation?).IstheGPUusableforsimpleprograms? Thanksalot, Jayben AtaguessI'dsaythatontheRPi3youaregettinganOpenGLEScontextbutontheRPi4youaregettinganOpenGLcontext.NeithertheRPi3norRPi4willgiveyouanOpenGL3contextbecauseAFAIKneitherhasfullhardwaresupportforit,themaximumforOpenGLis2.1andforOpenGLESis3.2(thoughMesa19.3.2onlysupportsupto3.1). I'msurprisedtheRPi3advertises3.1,Ididn'tthinktheVC4wascapableofES3,onlyES2.0. Whatdoyoumeanbya'real'OpenGL3.1driver?TheMesadriversaretherealones,thereisanewerversion(20.3)butyou'llhavetocompileityourself,andasabove,theRPi4doesn'tsupportOpenGL3. Shewhotravelslight—forgotsomething. Pleasenotethatmynamedoesn'tstartwiththe@charactersocanpeoplepleasestopwritingitasifitdoes! jayben Posts:443 Joined:MonAug19,20199:56pm Re:OpenGLversions ThuDec10,202011:58am Thanksverymuchforthisreply;itlookslikethebestoptionistouseOpenGLESv3onallPiversions. I'veput"#version300es"atthetopoftheGLSLcode,andwithafewminormods,thecoderunsfineonall3platforms,albeitveryslowlyonthezero(4FPS,asopposedto92FPSonPi3,and124FPSonPi4). However,thePi4stillreports"OpenGLversion2.1Mesa19.3.2";soI'mwonderingiftheGLSL#versionstatementissufficienttoselectESmode,ordoIneedtoaddsomethingtothemainprogram,e.g.glutInitContextVersion? Andisthereanywayofspeedingupthezero? jayben Posts:443 Joined:MonAug19,20199:56pm Re:OpenGLversions WedDec16,202010:59am Incaseanyoneisinterested,IhavepostedtheOpenGLoscilloscopedisplayprojecthere: http://iosoft.blog/oscilloscope-display...pberry-pi/ BrianBeuken Posts:467 Joined:FriJan29,201612:51pm Re:OpenGLversions WedDec16,202011:40am Pi3'scan'tdoOpenGLES3.xitmaxesoutat2.0.Ithinkyoumisreadormistypedthat. Pi4candoOpenGLES3.1thoughnotevery3.1featureworksasadvertised.Butitsprettymuchstableon3.0 IfyouwanttorunonallsystemssticktoOpenGLES2.0. ThePi4and3differquiteabitinmethodstosetupanOpenGLEScontext.thePi3needstobesettolegacydrivers,otherwiseitwillattempttoruntheOpenGLsystemswhichemulatesomeaspectsofOpenGL2.x thePi4isalreadyinOpenGLES3.xmodeandyouneedtochoosetogotoOpenGLmode. ImprettysurprisedyougetaPi3tocompileshaderswith#version300esonit..IsuspectitsignoringitorthrowingwarningsyouarenotseeingasitdefaultsbacktoOpenGLviayourframework. IalwaysfinditeasiertomakesurethehardwareissetuptohandleOpenGLESandthensetupmyowncontextsdependingonthemachine. theZeroissloooow...itsjustafactoflifeI'mafriad,thoughifyoudialupitsOpenGLES2.0systemsanddon'toverloadtheCPUitcandookagainstitsbiggerbrothers,butithasalotoflimits Veryoldcomputergameprogrammer,nowteachingveryyoungcomputergameprogrammers,someverybadhabits. http://www.scratchpadgames.net/ https://www.patreon.com/BrianBeuken jayben Posts:443 Joined:MonAug19,20199:56pm Re:OpenGLversions WedDec16,20202:56pm Sorrytodisagree,but'#version300es'doesseemtoworkreallywellonaPi3modelBv1.2withthelatestBusterversion;over110framespersecondwhenmyapplicationisina640x480window,only25%slowerthanaPi4. Also,ifIforceanerrorbychangingthedefinitionto'#version400es',Igetthefollowingresponse: GLSLES4.00isnotsupported.Supportedversionsare:1.10,1.20,1.30,1.40,1.00ES,and3.00ES Isthereadocumentsomewhere,orsomeAPIcalls,thatcancategoricallystatewhatissupported? BrianBeuken Posts:467 Joined:FriJan29,201612:51pm Re:OpenGLversions ThuDec17,202010:23am Idont'doubtitsworking,buttheRpi3isanOpenGLES2.0system,soitdoesnotnaturuallysupportGLSL3,whichiswhyIamsurpriosed. SoIdothinkyouareusingthesuppliedonboardOpenGLsystemwhichisprettyamazing,butemulatessomeofthemoreadvancedOpenGLstuffthatOpenGLES2.0doesnothave.IfyouweretoruncodeasanativeOpenGLES2.0youwouldcertainlygetwarningsthatGLSL3isnotsupported.itonlysupports1.0. RenderingintheemulatedGL2or3.3isgoingtobeprettymuchokaslongasyou'renotusinganyspecificfeatures,likeinstancing,eventhenyoumightnotnoticeahituntilyoustarttoreallypushyourgraphicthroughput. IfthatOpenGLsystemisdoingallyouneedthenstickwithit.Ifyouneedmoreperformance,dropbacktothelegacydriverson3,andstandarddriverson4andyougetOpenGLES2.0onPi3andOpenGLES3.0/1onPi4 Veryoldcomputergameprogrammer,nowteachingveryyoungcomputergameprogrammers,someverybadhabits. http://www.scratchpadgames.net/ https://www.patreon.com/BrianBeuken Displaypostsfromprevious:Allposts1day7days2weeks1month3months6months1yearSortbyAuthorPosttimeSubjectAscendingDescending Locked Printview 7posts •Page1of1 Returnto“OpenGLES” Jumpto Community Generaldiscussion Announcements Otherlanguages Deutsch Español Français Italiano Nederlands 日本語 Polski Português Русский Türkçe Usergroupsandevents TheMagPi UsingtheRaspberryPi Beginners Troubleshooting Advancedusers Assistivetechnologyandaccessibility Education Picademy Teachingandlearningresources Staffroom,classroomandprojects AstroPi Mathematica HighAltitudeBalloon Weatherstation Programming C/C++ Java Python Scratch Otherprogramminglanguages Windows10forIoT WolframLanguage Baremetal,Assemblylanguage Graphicsprogramming OpenGLES OpenVG OpenMAX Generalprogrammingdiscussion Projects Networkingandservers Automation,sensingandrobotics Graphics,soundandmultimedia Otherprojects Gaming Mediacentres AIYProjects Hardwareandperipherals Cameraboard ComputeModule OfficialDisplay HATsandotheradd-ons DeviceTree Interfacing(DSI,CSI,I2C,etc.) RaspberryPi400 RaspberryPiPico General SDK MicroPython OtherRP2040boards Operatingsystemdistributions RaspberryPiOS RaspberryPiDesktopforPCandMac Other Android Debian FreeBSD Gentoo LinuxKernel NetBSD openSUSE Plan9 Puppy Arch Pidora/Fedora RISCOS Ubuntu YeOldePiShoppe Forsale Wanted Offtopic Offtopicdiscussion Boardindex AlltimesareUTC Deletecookies
延伸文章資訊
- 1Raspberry 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...
- 2Running 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...
- 3Trying out OpenGL on Raspberry Pi 3
Testing the Raspberry Pi 3 with OpenGL drivers on some games that need hardware accelerated graph...
- 4OpenGl 3.3 on Raspberry Pi 4 8gb
OpenGL is not just a software library, it's a software interface to hardware features of the grap...
- 5VC4 and V3D OpenGL drivers for Raspberry Pi: an update
The GPU bundled with Raspberry Pi 4 is a VideoCore VI capable of OpenGL ES 3.2, a significant ste...