当前位置:网站首页>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
边栏推荐
- Bat operation FTP upload and download command
- 【医学分割】u2net
- 为什么用葫芦儿派盘取代U盘?
- Seven major technical updates that developers should pay most attention to on build 2022
- Advanced cross platform application development (II): uni app practice
- [medical segmentation] u2net
- Ucosiii --- engineering transplantation
- Continue to learn MySQL
- SQL必会题之留存率
- 论文学习记录随笔 多标签之LSML
猜你喜欢
随机推荐
【考研高数 自用】高数第一章基础阶段思维导图
MySQL数据迁移遇到的一些错误
穿越派·派盘 + 思源笔记 = 私人笔记本
[medical segmentation] u2net
A little assistant for teenagers' physiological health knowledge based on wechat applet (free source code + project introduction + operation introduction + operation screenshot + Thesis)
Trust guessing numbers game
轩逸保养手册
穿越派与贸大合作,为大学生增添效率
数据治理:数据治理管理(第五篇)
CJC8988带2个立体声耳机驱动器的低功率立体声编解码器
Brief description of activation function
excel动态图表
FPGA - 7系列 FPGA内部结构之Clocking -02- 时钟布线资源
Wild melon or split melon?
从底层结构开始学习FPGA----RAM IP的定制与测试
Crossing pie · pie pan + Mountain duck = local data management
Advanced cross platform application development (III): online resource upgrade / hot update with uni app
健康照明中应用的LED照明灯
excel動態圖錶
Vscode function annotation / file header annotation shortcut









