Files
nunuhara_xsystem4/shaders/render.v.glsl
T
kichikuou f50c9f6d77 gfx: Add gfx_render_quadrilateral()
It draws a quadrilateral with arbitrary vertex and texture coordinates.

This is used to properly implement DrawGraph.DrawDeformedSpriteBilinear,
and will be used to implement ChipmunkSpriteEngine.
SP_SetSpriteTransformPos in a subsequent patch.
2025-05-16 09:13:06 +09:00

28 lines
953 B
GLSL

/* Copyright (C) 2019 Nunuhara Cabbage <nunuhara@haniwa.technology>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://gnu.org/licenses/>.
*/
uniform mat4 world_transform;
uniform mat4 view_transform;
in vec4 vertex_pos;
in vec2 vertex_uv;
out vec2 tex_coord;
void main() {
gl_Position = view_transform * world_transform * vertex_pos;
tex_coord = vertex_uv;
}