GithubHelp home page GithubHelp logo

androidopenglview's Introduction

leftcoding

简介

  1. 90后移动端程序员。

  2. 目前,在福州一家生鲜互联网公司工作。

  3. 8 年开发经验, 3 年开发经验,目前工作以flutter开发为主。

联系方式

Email:[email protected]

主页:https://github.com/leftcoding

androidopenglview's People

Contributors

leftcoding avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

androidopenglview's Issues

无效的GLSL

还有片元着色器中的一段代码和上边的一个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;

}

有无效变量和代码

你好,请问这个变量是干什么的呢? 我看注释掉也没问题,你是原本打算在glsl中利用此变量计算宽高比从而计算缩放比的吗?
微信图片_20210720233752

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.