blob: 0e962bdd6c7ae7167753a0cc1ef1edbfd0cd3676 [file] [log] [blame]
Haoxiang Lib21a13e2019-06-18 13:16:28 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef SHADER_SIMPLE_TEX_H
18#define SHADER_SIMPLE_TEX_H
19
20const char vtxShader_simpleTexture[] = ""
21 "#version 300 es \n"
22 "layout(location = 0) in vec4 pos; \n"
23 "layout(location = 1) in vec2 tex; \n"
24 "uniform mat4 cameraMat; \n"
25 "out vec2 uv; \n"
26 "void main() \n"
27 "{ \n"
28 " gl_Position = cameraMat * pos; \n"
29 " uv = tex; \n"
30 "} \n";
31
32const char pixShader_simpleTexture[] =
33 "#version 300 es \n"
34 "precision mediump float; \n"
35 "uniform sampler2D tex; \n"
36 "in vec2 uv; \n"
37 "out vec4 color; \n"
38 "void main() \n"
39 "{ \n"
40 " vec4 texel = texture(tex, uv); \n"
41 " color = texel; \n"
42 "} \n";
43
44#endif // SHADER_SIMPLE_TEX_H