2
0
mirror of synced 2025-02-23 14:58:12 +00:00
mobile/gl/glutil/glimage_es.go
David Crawshaw 8a5f40b7b3 go.mobile: move glimage to glutil package and export
Drawing now supports defining both the source and destination
bounds, which is equivalent to clipping and scaling an image.

LGTM=nigeltao
R=nigeltao, crawshaw
CC=adg, golang-codereviews
https://golang.org/cl/144480043
2014-10-12 17:58:22 -07:00

29 lines
591 B
Go

// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package glutil
const vertexShader = `#version 100
uniform mat3 mvp;
uniform mat3 uvp;
attribute vec3 pos;
attribute vec2 inUV;
varying vec2 UV;
void main() {
vec3 p = pos;
p.z = 1.0;
gl_Position = vec4(mvp * p, 1);
UV = (uvp * vec3(inUV, 1)).xy;
}
`
const fragmentShader = `#version 100
precision mediump float;
varying vec2 UV;
uniform sampler2D textureSample;
void main(){
gl_FragColor = texture2D(textureSample, UV);
}
`