mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-12 09:18:11 +03:00
DrawField is a variant of DrawDungeon. Unlike the first-person perspective of DrawDungeon, DrawField uses a third-person, bird's-eye view camera. Key features include: - Character Rendering: A new system to render up to 256 billboarded sprites (characters, enemies, etc.) in the 3D world. The renderer supports controlling position, sprite animation, and visibility for each character. - DrawField HLL API: Functions for loading assets, managing characters, and manipulating dungeon properties like door locks. - Renderer: The core renderer is updated to support the DrawField mode. This includes disabling fog, handling sprite sheets via UV manipulation, and rendering ceilings as billboards. - Map: The 2D map has been updated to reflect the DrawField style, including colored door lock indicators.
34 lines
1.1 KiB
GLSL
34 lines
1.1 KiB
GLSL
/* Copyright (C) 2021 kichikuou <KichikuouChrome@gmail.com>
|
|
*
|
|
* 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 local_transform;
|
|
uniform mat4 view_transform;
|
|
uniform mat4 proj_transform;
|
|
uniform vec2 uv_offset;
|
|
uniform vec2 uv_scale;
|
|
|
|
in vec3 vertex_pos;
|
|
in vec2 vertex_uv;
|
|
out float dist;
|
|
out vec2 tex_coord;
|
|
|
|
void main() {
|
|
vec4 pos = view_transform * local_transform * vec4(vertex_pos, 1.0);
|
|
dist = abs(pos.z);
|
|
gl_Position = proj_transform * pos;
|
|
tex_coord = vertex_uv * uv_scale + uv_offset;
|
|
}
|