mirror of https://github.com/mosra/magnum.git
11 changed files with 79 additions and 257 deletions
@ -1,72 +0,0 @@ |
|||||||
/* |
|
||||||
This file is part of Magnum. |
|
||||||
|
|
||||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 |
|
||||||
Vladimír Vondruš <mosra@centrum.cz> |
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a |
|
||||||
copy of this software and associated documentation files (the "Software"), |
|
||||||
to deal in the Software without restriction, including without limitation |
|
||||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
||||||
and/or sell copies of the Software, and to permit persons to whom the |
|
||||||
Software is furnished to do so, subject to the following conditions: |
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included |
|
||||||
in all copies or substantial portions of the Software. |
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
||||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
||||||
DEALINGS IN THE SOFTWARE. |
|
||||||
*/ |
|
||||||
|
|
||||||
#ifndef NEW_GLSL |
|
||||||
#define in attribute |
|
||||||
#define out varying |
|
||||||
#endif |
|
||||||
|
|
||||||
#ifdef EXPLICIT_UNIFORM_LOCATION |
|
||||||
layout(location = 0) |
|
||||||
#endif |
|
||||||
uniform highp mat3 transformationProjectionMatrix |
|
||||||
#ifndef GL_ES |
|
||||||
= mat3(1.0) |
|
||||||
#endif |
|
||||||
; |
|
||||||
|
|
||||||
#ifdef TEXTURE_TRANSFORMATION |
|
||||||
#ifdef EXPLICIT_UNIFORM_LOCATION |
|
||||||
layout(location = 1) |
|
||||||
#endif |
|
||||||
uniform mediump mat3 textureMatrix |
|
||||||
#ifndef GL_ES |
|
||||||
= mat3(1.0) |
|
||||||
#endif |
|
||||||
; |
|
||||||
#endif |
|
||||||
|
|
||||||
#ifdef EXPLICIT_ATTRIB_LOCATION |
|
||||||
layout(location = POSITION_ATTRIBUTE_LOCATION) |
|
||||||
#endif |
|
||||||
in highp vec2 position; |
|
||||||
|
|
||||||
#ifdef EXPLICIT_ATTRIB_LOCATION |
|
||||||
layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) |
|
||||||
#endif |
|
||||||
in mediump vec2 textureCoordinates; |
|
||||||
|
|
||||||
out mediump vec2 interpolatedTextureCoordinates; |
|
||||||
|
|
||||||
void main() { |
|
||||||
gl_Position.xywz = vec4(transformationProjectionMatrix*vec3(position, 1.0), 0.0); |
|
||||||
interpolatedTextureCoordinates = |
|
||||||
#ifdef TEXTURE_TRANSFORMATION |
|
||||||
(textureMatrix*vec3(textureCoordinates, 1.0)).xy |
|
||||||
#else |
|
||||||
textureCoordinates |
|
||||||
#endif |
|
||||||
; |
|
||||||
} |
|
||||||
@ -1,72 +0,0 @@ |
|||||||
/* |
|
||||||
This file is part of Magnum. |
|
||||||
|
|
||||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 |
|
||||||
Vladimír Vondruš <mosra@centrum.cz> |
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a |
|
||||||
copy of this software and associated documentation files (the "Software"), |
|
||||||
to deal in the Software without restriction, including without limitation |
|
||||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
||||||
and/or sell copies of the Software, and to permit persons to whom the |
|
||||||
Software is furnished to do so, subject to the following conditions: |
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included |
|
||||||
in all copies or substantial portions of the Software. |
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
||||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
||||||
DEALINGS IN THE SOFTWARE. |
|
||||||
*/ |
|
||||||
|
|
||||||
#ifndef NEW_GLSL |
|
||||||
#define in attribute |
|
||||||
#define out varying |
|
||||||
#endif |
|
||||||
|
|
||||||
#ifdef EXPLICIT_UNIFORM_LOCATION |
|
||||||
layout(location = 0) |
|
||||||
#endif |
|
||||||
uniform highp mat4 transformationProjectionMatrix |
|
||||||
#ifndef GL_ES |
|
||||||
= mat4(1.0) |
|
||||||
#endif |
|
||||||
; |
|
||||||
|
|
||||||
#ifdef TEXTURE_TRANSFORMATION |
|
||||||
#ifdef EXPLICIT_UNIFORM_LOCATION |
|
||||||
layout(location = 1) |
|
||||||
#endif |
|
||||||
uniform mediump mat3 textureMatrix |
|
||||||
#ifndef GL_ES |
|
||||||
= mat3(1.0) |
|
||||||
#endif |
|
||||||
; |
|
||||||
#endif |
|
||||||
|
|
||||||
#ifdef EXPLICIT_ATTRIB_LOCATION |
|
||||||
layout(location = POSITION_ATTRIBUTE_LOCATION) |
|
||||||
#endif |
|
||||||
in highp vec4 position; |
|
||||||
|
|
||||||
#ifdef EXPLICIT_ATTRIB_LOCATION |
|
||||||
layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) |
|
||||||
#endif |
|
||||||
in mediump vec2 textureCoordinates; |
|
||||||
|
|
||||||
out mediump vec2 interpolatedTextureCoordinates; |
|
||||||
|
|
||||||
void main() { |
|
||||||
gl_Position = transformationProjectionMatrix*position; |
|
||||||
interpolatedTextureCoordinates = |
|
||||||
#ifdef TEXTURE_TRANSFORMATION |
|
||||||
(textureMatrix*vec3(textureCoordinates, 1.0)).xy |
|
||||||
#else |
|
||||||
textureCoordinates |
|
||||||
#endif |
|
||||||
; |
|
||||||
} |
|
||||||
@ -1,55 +0,0 @@ |
|||||||
/* |
|
||||||
This file is part of Magnum. |
|
||||||
|
|
||||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 |
|
||||||
Vladimír Vondruš <mosra@centrum.cz> |
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a |
|
||||||
copy of this software and associated documentation files (the "Software"), |
|
||||||
to deal in the Software without restriction, including without limitation |
|
||||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
||||||
and/or sell copies of the Software, and to permit persons to whom the |
|
||||||
Software is furnished to do so, subject to the following conditions: |
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included |
|
||||||
in all copies or substantial portions of the Software. |
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
||||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
||||||
DEALINGS IN THE SOFTWARE. |
|
||||||
*/ |
|
||||||
|
|
||||||
#ifndef NEW_GLSL |
|
||||||
#define in attribute |
|
||||||
#define out varying |
|
||||||
#endif |
|
||||||
|
|
||||||
#ifdef EXPLICIT_UNIFORM_LOCATION |
|
||||||
layout(location = 0) |
|
||||||
#endif |
|
||||||
uniform mat4 transformationProjectionMatrix |
|
||||||
#ifndef GL_ES |
|
||||||
= mat4(1.0) |
|
||||||
#endif |
|
||||||
; |
|
||||||
|
|
||||||
#ifdef EXPLICIT_ATTRIB_LOCATION |
|
||||||
layout(location = POSITION_ATTRIBUTE_LOCATION) |
|
||||||
#endif |
|
||||||
in highp vec4 position; |
|
||||||
|
|
||||||
#ifdef EXPLICIT_ATTRIB_LOCATION |
|
||||||
layout(location = COLOR_ATTRIBUTE_LOCATION) |
|
||||||
#endif |
|
||||||
in lowp vec4 color; |
|
||||||
|
|
||||||
out lowp vec4 interpolatedColor; |
|
||||||
|
|
||||||
void main() { |
|
||||||
gl_Position = transformationProjectionMatrix*position; |
|
||||||
interpolatedColor = color; |
|
||||||
} |
|
||||||
Loading…
Reference in new issue