Make GL demo easier to understand
PiperOrigin-RevId: 319007693
This commit is contained in:
parent
20820800f3
commit
5be6eaa88c
@ -32,4 +32,3 @@ void main() {
|
|||||||
gl_FragColor = videoColor * (1.0 - overlayColor.a)
|
gl_FragColor = videoColor * (1.0 - overlayColor.a)
|
||||||
+ overlayColor * overlayColor.a;
|
+ overlayColor * overlayColor.a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,11 +11,10 @@
|
|||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
attribute vec4 a_position;
|
attribute vec2 a_position;
|
||||||
attribute vec3 a_texcoord;
|
attribute vec2 a_texcoord;
|
||||||
varying vec2 v_texcoord;
|
varying vec2 v_texcoord;
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = a_position;
|
gl_Position = vec4(a_position.x, a_position.y, 0, 1);
|
||||||
v_texcoord = a_texcoord.xy;
|
v_texcoord = a_texcoord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,18 +88,9 @@ import javax.microedition.khronos.opengles.GL10;
|
|||||||
GlUtil.Uniform[] uniforms = GlUtil.getUniforms(program);
|
GlUtil.Uniform[] uniforms = GlUtil.getUniforms(program);
|
||||||
for (GlUtil.Attribute attribute : attributes) {
|
for (GlUtil.Attribute attribute : attributes) {
|
||||||
if (attribute.name.equals("a_position")) {
|
if (attribute.name.equals("a_position")) {
|
||||||
attribute.setBuffer(
|
attribute.setBuffer(new float[] {-1, -1, 1, -1, -1, 1, 1, 1}, 2);
|
||||||
new float[] {
|
|
||||||
-1.0f, -1.0f, 0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f,
|
|
||||||
1.0f, 0.0f, 1.0f,
|
|
||||||
},
|
|
||||||
4);
|
|
||||||
} else if (attribute.name.equals("a_texcoord")) {
|
} else if (attribute.name.equals("a_texcoord")) {
|
||||||
attribute.setBuffer(
|
attribute.setBuffer(new float[] {0, 1, 1, 1, 0, 0, 1, 0}, 2);
|
||||||
new float[] {
|
|
||||||
0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
|
|
||||||
},
|
|
||||||
3);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.attributes = attributes;
|
this.attributes = attributes;
|
||||||
|
@ -27,4 +27,3 @@
|
|||||||
app:surface_type="none"/>
|
app:surface_type="none"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user