当前位置:网站首页>OpenGL es: (2) relationship between OpenGL es, EGL and glsl
OpenGL es: (2) relationship between OpenGL es, EGL and glsl
2022-07-01 05:49:00 【Xiao Ge】
OpenGL ES Be responsible for GPU Working , The purpose is adopt GPU Calculation , Get a picture , This image is actually a block in memory buffer, The color information of each dot is stored . And this picture is finally going to be displayed on the screen , So we need a specific window system to operate ,OpenGL ES There are no related functions . therefore ,OpenGL ES Have a good partner EGL.
EGL, Full name :embedded Graphic Interface, yes OpenGL ES And the ground floor Native platform The interface between Windows systems . So the general process is like this : First , adopt EGL Get the phone screen Of handle, Get the configuration supported by the mobile phone (RGBA8888/RGB565 And so on , Represents the package in each pixel How many bits is the storage space of the color and other information ), Then create a block containing the default buffer Of surface(buffer The size of is calculated by multiplying the screen resolution by the size of each pixel information Calculated ) And for storage OpenGL ES State set context, And put them enable get up . then , adopt OpenGL ES operation GPU Calculate , Save the calculated results in surface Of buffer in . Last , Use EGL, Display the drawn picture on the phone screen .
And in the OpenGL ES operation GPU When calculating , It needs to be introduced OpenGL ES Another good partner of GLSL.
GLSL, Full name :OpenGL Shading Language, yes OpenGL ES Of the shader used in Language , With this language, you can write small programs to run in GPU On .
Here we need to mention CPU and GPU The difference between , Their functions are used to calculate , It is also composed of many nuclei , The difference lies in CPU There are fewer nuclei , But the computing power of a single core is relatively strong , and GPU There are many cores , But the computing power of each core is not particularly strong . at present GPU The main work of is to generate pictures ( Now there are also through GPU Perform high-performance computing _ Parallel operation , But it's not part of the discussion here ), The reason is that the picture is composed of many pixels , Each pixel contains a color 、 Depth and other information , And in order to get this information data , Calculation for each pixel , It can be completed by a unified algorithm .GPU I'm good at dealing with this kind of large-scale data , Use the same algorithm to calculate . And this algorithm , Is the use of GLSL It's written in Shader, for GPU Operation use .
From the perspective of graphics , All pictures are made of triangles . So pass OpenGL ES When drawing pictures , We need to pass OpenGL ES API Create for use in GPU Running on shader, And then through CPU Obtained image vertex information , Pass in GPU Medium Shader in . stay Vertex Shader Through matrix transformation , Convert vertex coordinates from the model coordinate system to the world coordinate system , Then go to the observation coordinate system , To crop coordinate system , Finally, it is projected into the screen coordinate system , Calculate the coordinates of each vertex on the screen . then , By rasterizing , The information of all pixels is obtained by interpolation , And in Fragment shader Calculate the color of all pixels in . Last , adopt OpenGL ES Of API Set the State , The obtained pixel information is depth/stencil test、blend, Get the final picture .
Reference link
2. OpenGL ES 2.0 Knowledge collusion
from :OpenGL ES: (2) OpenGL ES And EGL、GLSL The relationship between - Night traveler - Blog Garden
边栏推荐
猜你喜欢
随机推荐
A little assistant for teenagers' physiological health knowledge based on wechat applet (free source code + project introduction + operation introduction + operation screenshot + Thesis)
QT write custom control - self drawn battery
Ucosiii --- engineering transplantation
Qt编写自定义控件-自绘电池
OpenGL ES: (4) EGL API详解 (转)
Send you through the data cloud
教务管理系统(免费源码获取)
穿越派 你的数据云行
SystemVerilog学习-10-验证量化和覆盖率
穿越派与贸大合作,为大学生增添效率
[medical segmentation] u2net
rust猜数字游戏
论文学习记录随笔 多标签之LIFT
Timer based on LabVIEW
论文学习记录随笔 多标签之GLOCAL
excel高级绘图技巧100讲(一)-用甘特图来展示项目进度情况
云盘里资料被和谐了,怎么办?
2022第八届中国国际“互联网+”大学生创新创业大赛产业命题赛道开启报名!
Debug details under pycharm
4GB大文件,如何实时远程传输和共享?









