Email:[email protected]
leftcoding / androidopenglview Goto Github PK
View Code? Open in Web Editor NEW使用OpenGL 渲染 WebView
使用OpenGL 渲染 WebView
Email:[email protected]
请教一下使用OpenGL 渲染 WebView这样做有什么好处?有什么场景,谢谢
还有片元着色器中的一段代码和上边的一个rect数组,能麻烦解释下是干什么用的吗?我注释掉也没什么问题。
#extension GL_OES_EGL_image_external : require
precision mediump float;
struct Rect {
vec4 color;
float left;
float top;
float right;
float bottom;
};
// important to include in order to use rendered Android View to gl texture
uniform samplerExternalOES u_Texture;
uniform float u_GlobalTime;
//const int MAX_RECTS = 4;
//uniform Rect u_Rects[MAX_RECTS];
varying vec2 v_TexCoordinate;
void main()
{
vec2 uv = v_TexCoordinate.xy;
vec4 primary_color = texture2D(u_Texture, uv);
// vec4 tmpColor = vec4(0.0, 0.0, 0.0, 0.0);
//
// bool set = false;
//
// for(int idx = 0; idx < MAX_RECTS; idx++) {
// if(uv.x > u_Rects[idx].left && uv.x < u_Rects[idx].right && uv.y > u_Rects[idx].top && uv.y < u_Rects[idx].bottom) {
// tmpColor += u_Rects[idx].color;
// set = true;
// }
// }
//
// if(set) {
// primary_color *= tmpColor;
// }
gl_FragColor = primary_color;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.