Follow cam (#107)
- follow cam in replay viewer - world text with halo - fixed sensor crash - sensor visitors must now be convex
This commit is contained in:
parent
781673be80
commit
3fc20f5b45
27 changed files with 7450 additions and 127 deletions
21
.github/workflows/build.yml
vendored
21
.github/workflows/build.yml
vendored
|
|
@ -53,6 +53,17 @@ jobs:
|
|||
os: windows-11-arm
|
||||
args: -A arm64 -DBOX3D_DISABLE_SIMD=TRUE -DBOX3D_SANITIZE=ON
|
||||
test: ./bin/Debug/test
|
||||
# Optimized runs. The determinism golden hashes are otherwise only checked at -O0,
|
||||
# and -O2 is where a value changing float transform would first show up.
|
||||
- name: windows-relwithdebinfo
|
||||
os: windows-latest
|
||||
msvc: true
|
||||
config: RelWithDebInfo
|
||||
test: ./bin/RelWithDebInfo/test
|
||||
- name: macos-relwithdebinfo
|
||||
os: macos-latest
|
||||
config: RelWithDebInfo
|
||||
test: ./bin/test
|
||||
- name: ubuntu-gcc-double
|
||||
os: ubuntu-latest
|
||||
args: -DBOX3D_DOUBLE_PRECISION=ON
|
||||
|
|
@ -72,10 +83,10 @@ jobs:
|
|||
arch: x64
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX3D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DBOX3D_VALIDATE=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON ${{ matrix.args }}
|
||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.config || env.BUILD_TYPE }} -DBOX3D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DBOX3D_VALIDATE=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON ${{ matrix.args }}
|
||||
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.config || env.BUILD_TYPE }}
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/build
|
||||
|
|
@ -85,9 +96,9 @@ jobs:
|
|||
run: ${{ matrix.test }}
|
||||
|
||||
# mingw needs some extra setup so keeping it separate from the matrix.
|
||||
# Also the one optimized test run. Debug -O0 copies whole structs and hid the
|
||||
# b3SurfaceMaterial padding dedup bug. RelWithDebInfo tests -O2 codegen while
|
||||
# B3_ENABLE_ASSERT keeps asserts alive, heavy validation stays Debug only.
|
||||
# Debug -O0 copies whole structs and hid the b3SurfaceMaterial padding dedup bug.
|
||||
# RelWithDebInfo tests -O2 codegen while B3_ENABLE_ASSERT keeps asserts alive,
|
||||
# heavy validation stays Debug only.
|
||||
build-windows-mingw:
|
||||
name: windows-mingw
|
||||
runs-on: windows-latest
|
||||
|
|
|
|||
|
|
@ -76,11 +76,16 @@ endif()
|
|||
|
||||
# Deterministic math
|
||||
# https://box2d.org/posts/2024/08/determinism/
|
||||
if (MINGW OR APPLE OR UNIX)
|
||||
add_compile_options(-ffp-contract=off)
|
||||
elseif (MSVC AND CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
# clang-cl defaults to contraction on and silently drops the GNU spelling
|
||||
add_compile_options(/clang:-ffp-contract=off)
|
||||
# Contraction into FMA is the one value changing transform enabled by default, and whether
|
||||
# it fires depends on the target. Test the compiler, not the platform, so every gcc and
|
||||
# clang gets the flag including a clang that is neither MinGW nor clang-cl.
|
||||
if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
||||
if (CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||
# clang-cl defaults to contraction on and silently drops the GNU spelling
|
||||
add_compile_options(/clang:-ffp-contract=off)
|
||||
else()
|
||||
add_compile_options(-ffp-contract=off)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(BOX3D_DISABLE_SIMD "Disable SIMD math (slower)" OFF)
|
||||
|
|
|
|||
|
|
@ -106,9 +106,6 @@ B3_API float b3GetStallThreshold( void );
|
|||
/// The maximum number of contact points between two touching shapes.
|
||||
#define B3_MAX_MANIFOLD_POINTS 4
|
||||
|
||||
/// The maximum number points to use for shape cast proxies (swept point cloud).
|
||||
#define B3_MAX_SHAPE_CAST_POINTS 64
|
||||
|
||||
/// The number of iterations for gyroscopic torques.
|
||||
#ifndef B3_GYROSCOPIC_ITERATIONS
|
||||
#define B3_GYROSCOPIC_ITERATIONS 1
|
||||
|
|
@ -126,6 +123,9 @@ B3_API float b3GetStallThreshold( void );
|
|||
/// Relative tolerance used to determine if two edges are parallel.
|
||||
#define B3_PARALLEL_EDGE_TOL 0.005f
|
||||
|
||||
/// The maximum number points to use for shape cast proxies (swept point cloud).
|
||||
#define B3_MAX_SHAPE_CAST_POINTS B3_MAX_HULL_VERTICES
|
||||
|
||||
/// These generous limits allow for easy hashing. See b3ShapePairKey.
|
||||
#define B3_SHAPE_POWER 22
|
||||
#define B3_CHILD_POWER ( 64 - 2 * B3_SHAPE_POWER )
|
||||
|
|
|
|||
|
|
@ -493,6 +493,7 @@ typedef struct b3ShapeDef
|
|||
bool isSensor;
|
||||
|
||||
/// Enable sensor events for this shape. This applies to sensors and non-sensors. False by default, even for sensors.
|
||||
/// Only convex shapes may act as sensor visitors.
|
||||
bool enableSensorEvents;
|
||||
|
||||
/// Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default.
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ set(GFX_FILES
|
|||
draw.h
|
||||
edges.c
|
||||
edges.h
|
||||
fonts.c
|
||||
fonts.h
|
||||
geometry_registry.c
|
||||
geometry_registry.h
|
||||
gtao.c
|
||||
|
|
@ -40,6 +42,8 @@ set(GFX_FILES
|
|||
tone_map.c
|
||||
tone_map.h
|
||||
utility.h
|
||||
world_text.c
|
||||
world_text.h
|
||||
)
|
||||
|
||||
add_library(gfx STATIC ${GFX_FILES})
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BOX3D_USER_SHAPE_CAPACITY 65536
|
||||
#define BOX3D_FREELIST_END ( -1 )
|
||||
|
|
@ -107,9 +108,6 @@ typedef struct
|
|||
int firstFree;
|
||||
int allocCount;
|
||||
|
||||
// For the ground grid
|
||||
b3ShapeId groundShapeId;
|
||||
|
||||
// Per-shape PBR overrides
|
||||
MaterialOverride materialOverrides[BOX3D_MATERIAL_OVERRIDE_CAPACITY];
|
||||
int materialOverrideCount;
|
||||
|
|
@ -155,7 +153,6 @@ void InitAdapter( void )
|
|||
}
|
||||
s_adapter.firstFree = 0;
|
||||
s_adapter.allocCount = 0;
|
||||
s_adapter.groundShapeId = b3_nullShapeId;
|
||||
s_adapter.materialOverrideCount = 0;
|
||||
s_adapter.selectedBodyId = b3_nullBodyId;
|
||||
s_adapter.selectedShapeId = b3_nullShapeId;
|
||||
|
|
@ -195,7 +192,6 @@ void ResetAdapterPool( void )
|
|||
s_adapter.firstFree = 0;
|
||||
s_adapter.allocCount = 0;
|
||||
|
||||
s_adapter.groundShapeId = b3_nullShapeId;
|
||||
s_adapter.materialOverrideCount = 0;
|
||||
s_adapter.selectedBodyId = b3_nullBodyId;
|
||||
s_adapter.selectedShapeId = b3_nullShapeId;
|
||||
|
|
@ -264,7 +260,12 @@ int GetLastCompoundDrawStats( int* outTotal )
|
|||
|
||||
void SetGroundShape( b3ShapeId shapeId )
|
||||
{
|
||||
s_adapter.groundShapeId = shapeId;
|
||||
if ( b3Shape_IsValid( shapeId ) == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
b3Shape_SetName( shapeId, BOX3D_GROUND_SHAPE_NAME );
|
||||
}
|
||||
|
||||
void SetShapeMaterial( b3ShapeId shapeId, Vec4 color, float metallic, float roughness )
|
||||
|
|
@ -454,7 +455,7 @@ static void PopulateCommonFields( DebugShape* us, const b3DebugShape* debugShape
|
|||
{
|
||||
const b3BodyId bodyId = b3Shape_GetBody( debugShape->shapeId );
|
||||
us->bodyType = b3Body_GetType( bodyId );
|
||||
us->isGround = B3_ID_EQUALS( debugShape->shapeId, s_adapter.groundShapeId );
|
||||
us->isGround = strcmp( b3Shape_GetName( debugShape->shapeId ), BOX3D_GROUND_SHAPE_NAME ) == 0;
|
||||
us->shapeId = debugShape->shapeId;
|
||||
us->bodyId = bodyId;
|
||||
RefreshMaterialFromOverride( us );
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ extern "C"
|
|||
// draw origin to the grid period and keep the grid crisp far from the origin.
|
||||
#define BOX3D_GROUND_GRID_CELL_SIZE 1.0f
|
||||
|
||||
// Shapes carrying this name draw with the grid instead of a solid material.
|
||||
#define BOX3D_GROUND_SHAPE_NAME "ground"
|
||||
|
||||
void InitAdapter( void );
|
||||
|
||||
// Unconditionally flush the debug-shape pool: release the GPU mesh references
|
||||
|
|
@ -31,7 +34,10 @@ b3DebugDraw* GetGuiDraw( void );
|
|||
void ApplyGuiFlags( b3DebugDraw* out );
|
||||
int GetDebugShapeCount( void );
|
||||
|
||||
// Tag a Box3D shape so the renderer draws it with the procedural ground grid.
|
||||
// Tag a Box3D shape so the renderer draws it with the procedural ground grid. The tag is the shape
|
||||
// name, which lives in the world rather than in the renderer, so it is captured by a recording and
|
||||
// comes back on replay. Ignores an invalid shape, which lets a scene hand over a ground it may not
|
||||
// have created.
|
||||
void SetGroundShape( b3ShapeId shapeId );
|
||||
void SetShapeMaterial( b3ShapeId shapeId, Vec4 color, float metallic, float roughness );
|
||||
void SetTransparentDynamic( bool enabled );
|
||||
|
|
|
|||
327
samples/gfx/fonts.c
Normal file
327
samples/gfx/fonts.c
Normal file
|
|
@ -0,0 +1,327 @@
|
|||
// SPDX-FileCopyrightText: 2026 Erin Catto
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "gfx/fonts.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
// Copied from imgui_draw.cpp
|
||||
//
|
||||
// Based on ProggyForever: https://github.com/ocornut/proggyforever
|
||||
// MIT license / Copyright (c) 2026 Disco Hello, Copyright (c) 2019,2023 Tristan Grimmerom.
|
||||
|
||||
// File: 'data/fonts/ProggyForever-Regular-minimal.ttf' (18556 bytes)
|
||||
// Exported using binary_to_compressed_c.exe -u8 "data/fonts/ProggyForever-Regular-minimal.ttf" ProggyForeverMinimal
|
||||
static const unsigned int ProggyForeverMinimal_size = 18556;
|
||||
|
||||
// clang-format off
|
||||
static const unsigned char ProggyForeverMinimal_data[18556] =
|
||||
{
|
||||
0,1,0,0,0,14,0,128,0,3,0,96,70,70,84,77,176,111,174,190,0,0,72,96,0,0,0,28,71,68,69,70,0,136,0,105,0,0,72,64,0,0,0,30,79,83,47,50,104,97,19,194,0,0,1,104,0,0,0,96,99,109,97,112,177,
|
||||
173,221,139,0,0,3,80,0,0,1,114,99,118,116,32,0,33,2,121,0,0,4,196,0,0,0,4,103,97,115,112,255,255,0,3,0,0,72,56,0,0,0,8,103,108,121,102,239,245,108,207,0,0,6,76,0,0,62,224,104,101,97,
|
||||
100,44,57,58,3,0,0,0,236,0,0,0,54,104,104,101,97,4,62,0,230,0,0,1,36,0,0,0,36,104,109,116,120,24,22,19,139,0,0,1,200,0,0,1,136,108,111,99,97,80,9,64,114,0,0,4,200,0,0,1,130,109,97,
|
||||
120,112,1,7,0,139,0,0,1,72,0,0,0,32,110,97,109,101,10,160,159,151,0,0,69,44,0,0,1,68,112,111,115,116,70,77,175,253,0,0,70,112,0,0,1,197,0,1,0,0,0,1,0,0,1,224,136,151,95,15,60,245,0,
|
||||
11,3,232,0,0,0,0,229,175,187,66,0,0,0,0,229,178,59,232,255,225,255,68,1,215,2,176,0,0,0,8,0,2,0,0,0,0,0,0,0,1,0,0,2,131,255,71,0,0,1,184,255,225,255,226,1,215,0,1,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,4,0,1,0,0,0,192,0,90,0,5,0,0,0,0,0,2,0,0,0,1,0,1,0,0,0,64,0,46,0,0,0,0,0,4,1,184,1,144,0,5,0,0,2,138,2,187,0,0,0,140,2,138,2,187,0,0,1,223,0,49,1,2,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,128,0,0,7,16,0,0,2,0,0,0,0,0,0,0,0,88,88,88,88,0,64,0,32,32,172,2,131,255,71,0,0,2,175,0,187,0,0,0,3,0,0,0,0,1,133,2,6,0,0,0,32,0,1,1,184,0,33,0,0,0,0,1,184,0,0,1,184,0,0,0,166,
|
||||
0,116,255,249,0,49,0,5,0,4,0,185,0,135,0,135,0,27,0,22,0,154,0,53,0,166,0,39,0,41,0,79,0,50,0,45,0,22,0,49,0,41,0,46,0,39,0,41,0,166,0,143,0,24,0,24,0,24,0,48,255,225,0,5,0,38,0,47,
|
||||
0,39,0,52,0,58,0,35,0,42,0,66,0,65,0,19,0,49,0,19,0,41,0,35,0,44,0,13,0,38,0,42,0,9,0,37,0,13,255,250,0,0,0,5,0,33,0,104,0,39,0,104,0,37,255,242,0,124,0,48,0,50,0,59,0,50,0,37,0,40,
|
||||
0,50,0,62,0,139,0,100,0,41,0,133,0,20,0,62,0,42,0,50,0,50,0,69,0,69,0,87,0,54,0,29,255,249,0,20,0,47,0,64,0,63,0,188,0,63,0,22,0,21,0,159,0,63,0,40,0,55,0,5,0,188,0,64,0,109,255,249,
|
||||
0,92,0,50,255,249,0,109,0,101,0,24,0,115,0,109,0,131,0,37,0,48,0,159,0,143,0,114,0,83,0,50,0,19,0,19,0,18,0,73,0,5,0,5,0,5,0,5,0,5,0,5,0,2,0,47,0,52,0,52,0,52,0,52,0,66,0,66,0,66,0,
|
||||
66,0,17,0,42,0,35,0,35,0,35,0,35,0,46,0,1,0,46,0,46,0,46,0,47,0,5,0,42,0,42,0,38,0,38,0,38,0,38,0,38,0,38,0,5,0,59,0,37,0,37,0,37,0,37,0,51,0,68,0,68,0,68,0,42,0,62,0,43,0,43,0,43,
|
||||
0,43,0,43,0,24,0,12,0,61,0,61,0,61,0,61,0,26,0,50,0,26,0,30,0,0,0,3,0,0,0,3,0,0,0,28,0,1,0,0,0,0,0,108,0,3,0,1,0,0,0,28,0,4,0,80,0,0,0,16,0,16,0,3,0,0,0,126,0,133,0,171,0,210,0,211,
|
||||
0,255,32,172,255,255,0,0,0,32,0,133,0,161,0,174,0,211,0,212,32,172,255,255,255,227,255,221,255,194,255,192,255,95,255,191,224,19,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,6,0,0,1,0,
|
||||
0,0,0,0,0,0,1,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
|
||||
46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,0,132,133,135,137,145,149,
|
||||
155,160,159,161,163,162,164,166,168,167,169,170,172,171,173,174,176,178,177,179,181,180,185,184,186,187,0,112,100,101,105,0,118,158,110,107,0,116,106,0,134,151,0,113,0,0,103,117,0,
|
||||
0,0,0,0,108,122,0,165,183,127,99,0,0,0,0,0,109,123,0,0,128,131,148,0,0,0,0,0,0,0,0,182,0,190,60,0,191,0,0,0,0,0,119,0,0,0,130,138,129,139,136,141,142,143,140,50,147,0,146,153,154,152,
|
||||
0,0,0,111,0,0,0,120,0,0,0,0,0,0,33,2,121,0,0,0,42,0,42,0,42,0,42,0,68,0,86,0,134,0,210,1,14,1,104,1,116,1,148,1,180,1,212,1,232,2,6,2,20,2,38,2,54,2,100,2,122,2,172,2,232,3,2,3,60,
|
||||
3,116,3,134,3,210,4,10,4,40,4,82,4,102,4,122,4,142,4,204,5,36,5,60,5,118,5,158,5,184,5,208,5,228,6,24,6,44,6,68,6,94,6,118,6,134,6,160,6,182,6,224,7,14,7,64,7,106,7,182,7,200,7,238,
|
||||
8,0,8,28,8,52,8,72,8,96,8,114,8,130,8,148,8,166,8,180,8,194,9,12,9,58,9,92,9,140,9,182,9,214,10,14,10,44,10,74,10,110,10,134,10,150,10,198,10,230,11,4,11,50,11,96,11,130,11,188,11,
|
||||
216,11,250,12,14,12,42,12,66,12,114,12,142,12,198,12,210,13,10,13,62,13,126,13,152,13,198,13,238,14,34,14,72,14,90,14,198,14,232,15,32,15,106,15,134,15,200,15,214,15,244,16,16,16,56,
|
||||
16,114,16,128,16,182,16,212,16,230,17,2,17,22,17,60,17,86,17,132,17,194,18,20,18,76,18,108,18,140,18,176,18,228,19,24,19,74,19,110,19,168,19,198,19,228,20,6,20,56,20,86,20,116,20,150,
|
||||
20,200,20,252,21,44,21,92,21,144,21,212,22,24,22,50,22,112,22,148,22,186,22,226,23,28,23,56,23,90,23,160,23,246,24,76,24,164,25,18,25,124,25,226,26,94,26,150,26,198,26,248,27,44,27,
|
||||
114,27,144,27,174,27,208,28,2,28,74,28,136,28,174,28,212,28,254,29,60,29,118,29,172,29,230,30,16,30,58,30,104,30,166,30,206,30,244,31,48,31,112,0,0,0,2,0,33,0,0,1,42,2,154,0,3,0,7,
|
||||
0,46,177,1,0,47,60,178,7,4,0,237,50,177,6,5,220,60,178,3,2,0,237,50,0,177,3,0,47,60,178,5,4,0,237,50,178,7,6,1,252,60,178,1,2,0,237,50,51,17,33,17,39,51,17,35,33,1,9,232,199,199,2,
|
||||
154,253,102,33,2,88,0,0,2,0,166,255,254,1,18,2,35,0,7,0,13,0,0,54,50,22,20,6,34,38,52,55,35,3,55,51,21,198,44,32,32,44,32,85,59,14,1,83,105,31,44,32,32,44,122,1,4,91,91,0,2,0,116,1,
|
||||
70,1,68,2,7,0,3,0,7,0,0,1,35,53,51,7,35,53,51,1,67,64,64,142,65,65,1,70,192,192,192,0,2,255,248,0,3,1,191,2,3,0,3,0,31,0,0,63,1,35,7,37,35,7,51,21,35,7,35,55,35,7,35,55,35,53,51,55,
|
||||
35,53,51,55,51,7,51,55,51,7,51,254,30,92,30,1,29,104,31,92,106,38,59,38,92,38,58,38,96,110,31,98,112,38,59,38,92,38,58,38,90,201,115,115,115,115,54,143,143,143,143,54,115,54,144,144,
|
||||
144,144,0,0,3,0,49,255,241,1,135,2,22,0,6,0,11,0,52,0,0,55,62,1,53,52,38,47,1,53,6,21,20,23,30,3,21,20,7,21,35,53,46,1,47,1,53,30,2,23,53,46,3,53,52,54,55,53,51,21,30,1,31,1,21,38,
|
||||
39,21,50,249,32,41,36,37,60,72,137,22,40,46,28,141,60,36,67,15,15,6,21,69,37,31,44,43,22,75,65,60,25,55,15,15,43,67,3,81,7,37,31,30,32,10,73,135,12,61,44,30,4,15,28,50,33,114,15,44,
|
||||
43,1,14,6,6,63,4,11,22,3,162,6,15,26,42,29,53,67,9,45,42,2,11,5,5,62,29,4,150,0,5,0,5,0,11,1,178,1,250,0,3,0,11,0,19,0,27,0,35,0,0,1,51,1,35,36,50,54,52,38,34,6,20,54,50,22,20,6,34,
|
||||
38,52,2,20,22,50,54,52,38,34,22,20,6,34,38,52,54,50,1,74,71,254,222,71,1,16,41,30,30,41,29,7,84,60,60,84,59,174,30,41,29,29,41,122,60,84,59,59,84,1,249,254,21,47,27,39,27,27,39,115,
|
||||
56,79,56,56,79,1,26,39,27,27,39,27,7,79,56,56,79,56,0,0,0,3,0,4,255,246,1,179,2,21,0,9,0,28,0,62,0,0,55,50,55,46,1,39,6,21,20,22,3,28,2,30,5,23,62,1,53,52,38,35,34,6,1,23,35,38,39,
|
||||
6,35,34,38,53,52,54,55,46,2,53,52,54,51,50,22,21,20,14,2,7,22,23,54,53,55,20,206,52,37,25,110,24,65,80,41,1,2,3,6,8,12,7,37,37,31,23,24,35,1,2,67,72,13,21,60,89,72,104,52,44,22,19,
|
||||
15,63,60,61,51,15,32,25,24,89,58,36,61,44,36,28,131,28,54,59,48,62,1,125,1,7,3,7,5,10,9,13,16,9,25,40,24,21,25,32,254,143,79,15,24,49,96,66,50,74,33,25,25,40,24,41,69,55,49,20,36,34,
|
||||
20,17,107,69,65,72,1,108,0,1,0,185,1,70,0,255,2,8,0,3,0,0,19,35,53,51,254,68,68,1,71,193,0,1,0,135,255,193,1,49,2,62,0,17,0,0,1,14,1,20,22,23,35,46,4,52,62,2,63,1,1,49,43,55,55,43,
|
||||
60,4,15,38,29,24,23,32,33,11,11,2,61,60,177,161,177,60,6,21,68,70,103,97,102,75,61,16,16,0,0,1,0,135,255,193,1,49,2,62,0,17,0,0,19,30,4,20,14,2,15,1,35,62,1,52,38,39,195,4,15,38,29,
|
||||
24,23,32,33,11,11,60,43,55,55,43,2,61,6,22,68,71,103,97,101,75,60,16,16,60,177,161,177,60,0,0,0,1,0,27,0,69,1,157,1,199,0,17,0,0,1,7,23,7,39,21,35,53,7,39,55,39,55,23,53,51,21,55,1,
|
||||
157,131,131,33,128,64,129,32,131,131,32,129,64,128,1,77,71,71,50,70,142,142,70,50,71,71,50,70,142,142,70,0,1,0,22,0,74,1,162,1,185,0,11,0,0,19,51,21,35,21,35,53,35,53,51,53,51,251,
|
||||
166,166,62,166,166,62,1,31,59,154,154,59,154,0,1,0,154,255,129,1,30,0,107,0,16,0,0,54,50,22,21,20,14,2,15,1,39,54,55,46,1,53,52,209,45,31,21,31,30,11,11,26,55,10,17,25,107,32,22,32,
|
||||
61,40,32,7,7,37,48,41,1,31,21,22,0,0,1,0,53,0,227,1,131,1,32,0,3,0,0,37,33,53,33,1,131,254,178,1,78,228,60,0,0,0,1,0,166,255,255,1,18,0,105,0,7,0,0,54,50,22,20,6,34,38,52,198,44,32,
|
||||
32,44,32,105,31,44,31,31,44,0,0,0,1,0,39,255,222,1,144,2,39,0,3,0,0,9,1,35,1,1,144,254,221,69,1,34,2,39,253,184,2,72,0,0,3,0,41,255,247,1,143,2,14,0,10,0,21,0,27,0,0,55,50,62,3,53,
|
||||
52,39,7,22,19,34,14,3,21,20,23,55,38,39,50,16,35,34,16,220,17,28,30,21,14,4,190,27,57,17,28,31,20,14,4,189,26,57,178,178,178,51,7,26,44,78,53,40,34,230,52,1,161,8,26,44,78,53,39,33,
|
||||
229,52,58,253,234,2,22,0,0,0,1,0,79,0,0,1,104,2,7,0,10,0,0,19,39,55,51,17,51,21,33,55,51,17,81,1,106,68,105,254,233,1,105,1,103,81,78,254,55,61,61,1,122,0,1,0,50,0,0,1,134,2,17,0,31,
|
||||
0,0,19,39,62,2,51,50,30,2,21,20,6,15,1,33,21,33,53,52,55,54,55,62,1,53,52,38,35,34,6,7,55,1,8,29,81,37,48,72,36,17,44,59,147,1,1,254,173,13,1,165,37,40,58,45,26,75,24,1,159,65,5,16,
|
||||
27,30,48,46,21,40,78,58,146,61,46,14,12,1,165,38,80,33,33,47,27,13,0,0,0,1,0,45,255,246,1,139,2,16,0,41,0,0,1,22,21,20,6,35,34,38,47,1,53,30,2,51,50,54,53,52,38,43,1,53,51,50,54,53,
|
||||
52,38,35,34,6,15,1,53,54,51,50,22,21,20,6,1,26,112,107,85,34,78,22,23,7,25,80,41,57,65,65,49,64,64,46,56,55,45,33,72,20,20,74,68,78,98,51,1,22,30,109,65,84,13,7,6,69,4,12,19,51,49,
|
||||
46,52,58,45,38,37,43,14,7,7,64,23,74,59,50,55,0,0,0,2,0,22,0,0,1,162,2,7,0,2,0,13,0,0,37,17,3,59,1,21,35,21,35,53,35,53,19,51,1,16,179,237,88,88,67,241,208,100,181,1,18,254,238,58,
|
||||
123,123,73,1,66,0,0,1,0,49,255,246,1,135,2,7,0,40,0,0,19,17,33,21,35,21,54,51,50,30,3,21,20,14,2,35,34,38,47,1,53,30,2,51,50,62,2,53,52,46,2,35,34,6,7,72,1,33,221,24,41,25,48,51,38,
|
||||
24,35,61,67,38,43,70,14,14,7,24,76,38,21,39,39,23,23,40,44,25,28,56,14,1,2,1,4,59,127,11,10,25,38,63,40,49,72,38,18,11,6,5,71,4,11,19,11,25,48,33,33,48,25,12,13,7,0,2,0,41,255,248,
|
||||
1,143,2,8,0,9,0,37,0,0,55,50,53,52,35,34,6,21,20,22,19,50,30,2,21,20,6,35,34,38,53,52,62,2,51,50,22,31,1,21,38,35,34,6,21,54,224,101,101,41,59,59,51,31,56,49,29,91,82,87,98,36,63,79,
|
||||
48,24,46,11,10,31,59,69,89,36,48,119,121,57,64,63,56,1,39,20,40,68,43,90,89,114,136,73,110,63,31,8,4,3,66,25,95,98,72,0,0,0,0,1,0,46,0,0,1,138,2,7,0,6,0,0,19,53,33,21,3,35,19,46,1,
|
||||
91,197,78,190,1,203,59,29,254,23,1,202,0,0,3,0,39,255,246,1,145,2,17,0,15,0,31,0,52,0,0,54,50,62,2,52,46,2,34,14,2,20,30,1,18,34,14,2,20,30,2,50,62,2,52,46,1,23,30,1,21,20,6,35,34,
|
||||
38,53,52,55,38,53,52,54,51,50,22,21,20,199,42,32,32,18,18,33,32,40,32,33,18,18,32,72,37,29,29,16,17,29,28,36,28,30,16,16,29,33,48,52,104,76,77,104,99,84,95,71,70,96,45,7,20,42,63,42,
|
||||
19,7,7,19,42,63,42,20,1,166,6,17,37,53,37,16,6,6,16,37,53,37,17,191,16,72,52,69,78,77,70,107,33,30,91,62,69,70,61,90,0,2,0,41,0,0,1,143,2,16,0,9,0,37,0,0,19,34,21,20,51,50,54,53,52,
|
||||
38,3,34,46,2,53,52,54,51,50,22,21,20,14,2,35,34,38,47,1,53,22,51,50,54,53,6,215,100,100,42,59,60,51,30,57,48,29,91,82,86,99,36,64,79,47,24,46,11,11,32,59,68,89,35,1,216,120,120,56,
|
||||
64,64,56,254,217,20,39,68,44,89,90,114,136,73,110,63,31,8,3,4,65,24,95,98,72,0,0,0,2,0,166,0,81,1,18,1,171,0,7,0,15,0,0,18,34,38,52,54,50,22,20,6,50,22,20,6,34,38,52,242,44,32,32,44,
|
||||
32,76,44,32,32,44,32,1,65,31,44,31,31,44,165,31,44,31,31,44,0,0,0,0,2,0,143,255,209,1,18,1,171,0,7,0,24,0,0,18,34,38,52,54,50,22,20,6,50,22,21,20,14,2,15,1,39,54,55,46,1,53,52,243,
|
||||
45,31,31,45,31,76,44,32,22,30,31,11,10,27,55,10,17,25,1,65,31,44,31,31,44,165,32,22,33,60,41,31,7,7,37,48,41,1,31,21,22,0,0,0,1,0,24,0,84,1,160,1,176,0,6,0,0,19,37,21,13,1,21,37,24,
|
||||
1,135,254,200,1,56,254,121,1,30,145,62,111,112,62,145,0,0,0,2,0,24,0,152,1,159,1,114,0,3,0,7,0,0,37,33,53,33,53,33,53,33,1,159,254,121,1,135,254,121,1,135,153,59,99,59,0,0,0,1,0,24,
|
||||
0,84,1,160,1,176,0,6,0,0,19,5,21,5,53,45,1,24,1,135,254,121,1,56,254,200,1,176,145,57,145,62,111,112,0,0,0,2,0,48,0,0,1,135,2,31,0,34,0,42,0,0,19,50,22,21,20,14,3,29,1,35,53,52,62,
|
||||
4,53,52,38,35,34,14,2,15,1,39,62,4,16,50,22,20,6,34,38,52,226,83,82,29,42,42,29,70,21,33,38,33,22,52,43,25,45,29,22,4,5,52,2,10,34,38,61,45,31,31,45,31,2,31,68,52,28,47,33,30,33,17,
|
||||
41,41,22,39,28,29,23,31,16,30,33,16,23,23,8,8,34,4,14,35,26,22,254,75,31,44,31,31,44,0,0,0,0,2,255,225,255,233,1,215,2,32,0,7,0,64,0,0,54,50,54,52,38,34,6,20,5,23,14,4,35,34,46,3,53,
|
||||
52,54,51,50,22,21,20,14,2,7,21,35,53,6,35,34,38,52,54,51,50,22,31,1,50,53,52,38,35,34,6,21,20,30,2,51,50,62,3,214,60,43,43,60,43,1,5,38,2,11,38,43,71,37,63,103,67,46,20,141,105,105,
|
||||
128,15,24,21,10,55,36,43,55,79,80,55,28,49,10,11,45,84,70,81,118,39,61,75,39,35,64,40,30,14,168,56,79,57,57,79,120,46,4,11,27,21,17,33,55,74,79,42,120,163,78,67,24,35,17,7,1,198,19,
|
||||
31,93,131,94,26,13,13,28,34,57,124,104,53,87,55,30,13,20,20,13,0,0,0,2,0,5,0,0,1,178,2,7,0,2,0,10,0,0,55,51,3,55,19,35,39,35,7,35,19,141,158,79,45,169,77,41,193,40,77,169,192,1,9,61,
|
||||
253,250,136,136,2,6,0,3,0,38,0,0,1,146,2,7,0,8,0,17,0,39,0,0,55,50,54,53,52,38,43,1,21,17,21,22,55,54,53,52,38,35,23,30,4,21,20,14,2,43,1,17,51,50,30,2,21,20,6,220,65,52,62,45,121,
|
||||
71,39,84,49,42,77,12,23,34,25,18,30,50,57,31,194,177,43,62,32,15,49,58,47,52,47,43,189,1,147,156,1,2,4,76,42,33,183,3,7,20,27,48,31,38,57,32,14,2,5,25,43,46,24,42,55,0,0,1,0,47,255,
|
||||
248,1,137,2,18,0,26,0,0,37,21,6,35,34,46,2,53,52,54,51,50,23,21,38,35,34,14,2,21,20,30,1,51,50,1,136,49,79,56,86,50,24,112,104,77,51,51,77,38,57,32,15,26,66,50,77,93,73,28,42,74,95,
|
||||
58,117,151,32,71,45,33,59,74,46,62,91,59,0,2,0,39,0,0,1,144,2,7,0,6,0,13,0,0,55,50,53,52,43,1,17,19,50,17,16,35,7,17,199,125,125,84,84,201,200,160,58,202,201,254,109,1,204,254,253,
|
||||
254,254,1,2,6,0,1,0,52,0,0,1,131,2,7,0,11,0,0,19,33,21,33,23,51,21,35,21,33,21,33,53,1,77,254,253,1,227,228,1,4,254,178,2,6,59,153,59,188,59,0,0,0,0,1,0,58,0,0,1,126,2,7,0,9,0,0,19,
|
||||
33,21,35,31,1,21,35,21,35,58,1,67,249,1,181,182,74,2,6,59,158,1,59,241,0,0,1,0,35,255,248,1,148,2,18,0,36,0,0,37,39,35,53,51,21,14,4,35,34,46,2,53,52,54,51,50,23,21,38,35,34,14,2,21,
|
||||
20,30,1,51,50,62,1,1,78,1,99,170,2,7,27,32,54,30,56,85,51,24,112,104,78,50,51,77,38,57,32,14,25,66,50,27,42,11,67,141,58,223,2,7,18,13,11,42,74,95,58,117,151,32,71,45,33,59,74,46,62,
|
||||
91,59,11,7,0,1,0,42,0,0,1,141,2,7,0,11,0,0,51,17,51,21,51,53,51,17,35,53,35,21,43,75,204,75,75,204,2,6,212,212,253,250,247,246,0,1,0,66,0,0,1,117,2,7,0,11,0,0,19,53,33,21,35,17,51,
|
||||
21,5,53,55,17,67,1,50,116,116,254,206,115,1,203,59,59,254,112,58,1,57,1,1,145,0,0,0,1,0,65,255,249,1,118,2,7,0,13,0,0,19,51,17,20,6,35,7,53,51,50,54,53,17,35,158,216,66,78,164,147,
|
||||
48,37,140,2,6,254,158,80,90,1,57,48,58,1,47,0,0,0,0,1,0,19,0,0,1,165,2,7,0,11,0,0,51,17,51,21,55,51,7,19,35,3,7,21,19,75,233,85,212,221,90,180,57,2,6,230,230,212,254,206,1,4,57,202,
|
||||
0,0,0,1,0,49,0,0,1,135,2,7,0,5,0,0,55,17,51,17,33,21,49,75,1,10,1,2,5,254,53,58,0,0,0,1,0,19,0,0,1,164,2,7,0,12,0,0,51,17,51,23,55,51,17,7,17,3,35,3,17,20,100,99,101,100,65,107,57,
|
||||
106,2,6,254,254,253,251,1,1,197,254,239,1,19,254,58,0,0,1,0,41,0,0,1,142,2,7,0,9,0,0,51,3,51,19,17,51,17,35,3,17,45,3,98,186,72,95,186,2,6,254,90,1,166,253,250,1,166,254,90,0,0,2,0,
|
||||
35,255,250,1,149,2,18,0,5,0,25,0,0,19,50,16,35,34,16,18,50,62,3,52,46,3,34,14,3,20,30,2,220,184,184,184,167,34,27,30,20,13,13,20,30,27,34,27,30,20,14,14,20,30,2,17,253,234,2,22,254,
|
||||
37,8,26,43,78,106,78,44,26,8,8,26,44,78,106,78,43,26,0,0,0,2,0,44,255,255,1,139,2,7,0,12,0,30,0,0,19,50,62,2,53,52,46,2,43,1,21,55,50,22,21,20,6,43,1,28,1,30,1,28,1,49,35,17,50,206,
|
||||
32,46,22,10,10,21,42,30,93,99,85,91,85,84,108,1,1,75,174,1,10,19,31,31,17,17,31,31,18,195,252,80,70,71,89,5,21,55,48,50,29,2,6,0,0,0,0,2,0,13,255,184,1,171,2,15,0,12,0,32,0,0,19,50,
|
||||
17,20,7,23,21,35,39,6,35,34,16,18,50,62,3,52,46,3,34,14,3,20,30,2,198,184,40,84,48,82,40,58,184,167,34,27,30,20,13,13,20,30,27,34,27,30,20,14,14,20,30,2,14,254,245,123,67,97,44,91,
|
||||
27,2,22,254,37,8,26,43,78,106,78,44,26,8,8,26,44,78,106,78,43,26,0,2,0,38,0,0,1,145,2,7,0,9,0,24,0,0,19,35,21,22,55,62,1,53,52,38,15,1,35,17,51,50,22,21,20,6,7,23,35,39,38,213,99,68,
|
||||
39,34,51,53,139,3,72,179,79,83,57,44,122,79,111,97,1,205,184,1,2,2,46,45,43,47,242,218,2,5,89,69,45,69,16,229,217,1,0,0,0,1,0,42,255,246,1,141,2,17,0,54,0,0,1,21,46,2,35,34,6,21,20,
|
||||
30,7,23,30,3,21,20,6,35,34,38,47,1,53,30,2,51,50,54,53,52,38,39,46,3,53,52,54,51,50,30,2,23,1,109,6,21,67,35,62,61,6,14,11,25,12,31,9,33,1,23,42,48,29,101,89,43,78,18,18,7,27,86,45,
|
||||
45,66,61,69,34,48,47,24,103,87,18,40,32,27,8,1,245,71,4,13,21,41,48,11,18,15,11,10,5,7,3,5,1,4,17,33,58,39,78,74,16,9,8,73,5,16,27,46,45,46,37,14,6,17,31,50,34,72,82,5,8,9,2,0,0,0,
|
||||
1,0,9,0,0,1,175,2,7,0,7,0,0,19,53,33,21,35,17,7,17,10,1,164,172,75,1,203,59,59,254,54,1,1,203,0,1,0,37,255,246,1,147,2,7,0,24,0,0,55,17,51,17,20,30,2,51,50,54,53,17,51,17,20,14,3,34,
|
||||
46,3,37,76,6,19,43,32,67,48,75,6,22,38,68,95,70,38,22,7,166,1,96,254,153,26,35,34,18,54,67,1,95,254,173,33,48,53,33,22,21,32,50,44,0,1,0,13,0,0,1,171,2,7,0,6,0,0,51,3,51,27,1,51,3,
|
||||
174,161,73,134,134,72,161,2,6,254,58,1,198,253,250,0,1,255,249,0,0,1,190,2,7,0,12,0,0,51,3,51,27,1,51,27,1,51,3,35,11,1,75,81,63,58,63,83,64,57,64,81,73,72,73,2,6,254,99,1,157,254,
|
||||
98,1,158,253,250,1,184,254,72,0,1,255,255,0,0,1,185,2,7,0,11,0,0,19,39,51,23,55,51,7,19,35,39,7,35,184,160,80,121,123,81,165,177,80,141,141,80,1,19,243,195,195,243,254,237,218,218,
|
||||
0,1,0,5,0,0,1,178,2,7,0,8,0,0,55,3,51,23,55,51,3,21,35,182,176,79,135,134,80,177,75,234,1,28,228,228,254,227,233,0,0,1,0,33,0,0,1,151,2,7,0,9,0,0,19,53,33,21,1,33,21,5,53,1,41,1,102,
|
||||
254,224,1,40,254,138,1,24,1,203,59,53,254,106,58,1,56,1,147,0,0,0,1,0,104,255,189,1,80,2,73,0,7,0,0,1,39,17,51,21,35,17,51,1,79,162,162,231,231,2,18,1,253,226,56,2,140,0,1,0,39,255,
|
||||
222,1,144,2,39,0,3,0,0,19,1,35,1,109,1,35,70,254,222,2,39,253,184,2,72,0,0,0,1,0,104,255,189,1,80,2,73,0,7,0,0,19,51,17,35,53,51,17,7,104,231,231,163,163,2,73,253,116,56,2,30,1,0,0,
|
||||
1,0,37,1,63,1,147,2,7,0,6,0,0,19,23,35,39,7,35,55,252,150,82,100,101,82,150,2,6,198,141,141,198,0,0,0,1,255,241,255,190,1,199,255,247,0,3,0,0,5,33,53,33,1,198,254,44,1,212,66,56,0,
|
||||
0,0,1,0,124,1,160,1,60,2,57,0,3,0,0,19,23,35,39,207,108,82,109,2,57,153,153,0,0,0,2,0,48,255,246,1,136,1,143,0,17,0,54,0,0,55,50,62,3,53,34,35,38,14,4,21,20,22,39,52,62,3,23,48,60,
|
||||
1,46,6,35,7,53,50,54,51,21,50,30,2,21,7,35,54,39,6,35,34,38,204,32,48,23,13,2,10,21,24,45,39,32,22,13,51,118,28,50,69,81,45,2,3,7,9,15,18,26,16,122,18,58,34,38,58,52,29,1,61,2,2,38,
|
||||
99,64,79,44,26,33,49,27,17,1,2,3,10,18,28,20,37,35,72,36,51,28,16,1,1,14,7,17,10,16,10,12,7,5,2,54,2,1,12,33,65,47,241,25,27,61,63,0,0,2,0,50,255,247,1,134,2,49,0,9,0,30,0,0,54,50,
|
||||
54,53,52,38,34,6,21,20,39,62,4,51,50,22,21,20,6,35,34,38,47,1,7,35,17,51,172,112,50,51,110,52,3,1,5,18,23,42,25,71,87,88,59,32,62,16,15,7,61,68,45,82,68,67,83,83,67,68,212,3,8,20,16,
|
||||
12,102,101,98,106,29,15,15,49,2,47,0,1,0,59,255,247,1,125,1,143,0,20,0,0,1,34,6,21,20,22,51,50,55,21,6,35,34,38,52,54,51,50,23,21,38,1,13,65,72,72,65,62,49,47,78,85,110,110,85,78,47,
|
||||
49,1,89,74,76,76,74,43,65,32,106,196,106,32,65,43,0,0,2,0,50,255,247,1,134,2,49,0,7,0,30,0,0,54,50,53,52,38,34,6,21,19,51,17,35,39,14,4,35,34,38,53,52,54,51,50,30,2,31,1,122,200,48,
|
||||
104,48,200,68,62,6,3,8,26,27,41,20,59,88,87,70,25,42,24,17,3,4,45,150,67,83,83,67,1,109,253,209,49,3,7,21,15,13,106,98,101,102,12,17,17,6,7,0,0,0,0,2,0,37,255,247,1,147,1,143,0,5,0,
|
||||
26,0,0,19,34,6,21,51,52,7,20,22,51,50,54,55,21,6,35,34,38,53,52,54,51,50,22,29,1,32,227,47,69,224,227,62,67,42,62,46,70,82,89,109,105,79,91,90,254,218,1,89,68,48,116,165,56,79,18,21,
|
||||
64,29,109,95,93,110,97,73,48,0,0,0,1,0,40,0,3,1,144,2,36,0,19,0,0,1,34,6,29,1,51,21,35,17,35,17,35,53,51,53,52,54,59,1,21,1,40,35,31,125,125,68,122,122,65,64,108,1,237,25,37,75,57,
|
||||
254,217,1,39,57,52,78,62,55,0,0,0,0,2,0,50,255,70,1,134,1,143,0,9,0,39,0,0,55,50,53,52,35,34,6,21,20,22,19,51,17,20,6,43,1,53,51,50,62,2,61,1,14,4,35,34,38,53,52,54,51,50,22,23,222,
|
||||
99,99,53,51,51,159,61,90,81,130,136,28,42,23,10,1,5,18,24,42,25,71,91,91,60,48,52,28,53,142,150,82,68,65,77,1,80,254,110,86,86,58,22,36,37,18,59,2,6,16,12,10,101,100,98,101,20,29,0,
|
||||
0,1,0,62,0,1,1,122,2,49,0,18,0,0,19,50,22,21,17,35,53,52,38,35,34,6,29,1,35,17,51,21,54,253,53,72,68,40,37,47,56,68,68,37,1,146,78,67,255,0,250,45,48,61,59,223,2,47,218,60,0,2,0,139,
|
||||
0,1,1,45,2,30,0,11,0,17,0,0,1,35,34,61,1,52,59,1,50,29,1,20,7,53,51,17,35,17,1,35,56,10,10,56,9,161,161,68,1,202,10,64,9,9,64,10,127,59,254,123,1,74,0,0,0,2,0,100,255,70,1,84,2,30,
|
||||
0,12,0,24,0,0,19,53,51,17,20,43,1,53,51,50,54,53,17,55,35,34,61,1,52,59,1,50,29,1,20,165,174,127,112,105,29,37,59,56,10,10,56,9,1,76,58,254,98,161,59,52,50,1,100,126,10,64,9,9,64,10,
|
||||
0,1,0,41,0,2,1,142,2,30,0,11,0,0,55,23,35,39,7,21,35,17,51,17,55,51,210,188,81,154,51,70,70,181,80,245,243,201,45,156,2,27,254,201,161,0,0,0,0,1,0,133,0,1,1,51,2,8,0,5,0,0,19,51,17,
|
||||
35,17,35,133,173,69,104,2,7,253,250,1,202,0,0,0,1,0,20,255,254,1,164,1,143,0,30,0,0,1,50,22,21,17,35,17,52,35,34,6,7,17,35,17,52,35,34,6,7,17,35,17,51,21,54,51,50,23,62,1,1,68,43,52,
|
||||
61,52,26,26,3,61,52,26,26,3,62,62,31,42,52,26,13,48,1,143,69,53,254,234,1,5,84,34,37,254,238,1,5,84,33,36,254,236,1,133,18,29,49,22,27,0,0,0,1,0,62,0,1,1,122,1,147,0,18,0,0,19,50,22,
|
||||
21,17,35,53,52,38,35,34,6,29,1,35,17,51,23,54,253,53,72,68,40,37,47,56,68,64,4,37,1,146,78,67,255,0,250,45,48,61,59,223,1,133,48,60,0,0,0,0,2,0,42,255,247,1,141,1,144,0,9,0,17,0,0,
|
||||
54,50,54,53,52,38,34,6,21,20,18,50,22,21,20,32,53,52,174,92,58,59,90,59,21,166,94,254,158,44,72,80,80,70,70,80,80,1,28,102,102,205,205,102,0,2,0,50,255,78,1,134,1,136,0,7,0,30,0,0,
|
||||
54,50,54,53,52,34,21,20,19,50,22,21,20,6,35,34,46,2,47,1,21,35,17,51,23,62,4,176,103,48,199,107,66,89,87,71,25,41,24,18,3,3,68,61,7,1,6,20,25,41,38,82,67,148,148,67,1,16,105,99,101,
|
||||
103,12,18,17,6,6,221,2,48,49,2,8,20,16,13,0,2,0,50,255,78,1,134,1,136,0,7,0,30,0,0,54,50,54,53,52,34,21,20,19,51,17,35,53,14,4,35,34,38,53,52,54,51,50,30,2,31,1,160,104,48,200,216,
|
||||
62,68,1,5,18,24,42,25,70,87,89,66,23,41,26,19,4,4,38,82,67,148,148,67,1,6,253,208,221,2,8,21,15,13,103,101,99,105,12,18,17,6,6,0,0,1,0,69,0,0,1,115,1,142,0,19,0,0,1,50,22,31,1,21,46,
|
||||
2,35,34,6,29,1,35,17,51,7,62,1,1,12,29,52,11,11,4,16,56,31,56,71,68,68,2,17,69,1,142,15,7,8,65,5,12,20,60,35,245,1,133,53,27,35,0,0,1,0,69,255,254,1,115,1,151,0,38,0,0,55,30,1,54,53,
|
||||
52,39,46,1,53,52,62,2,51,50,22,31,1,21,46,2,35,34,21,20,22,23,30,1,21,20,6,35,34,38,47,1,69,53,109,71,91,83,57,14,32,65,44,33,62,14,15,6,19,63,33,90,36,57,70,69,88,73,31,70,20,20,88,
|
||||
27,14,32,35,49,15,15,53,44,22,38,36,20,11,6,6,62,4,11,17,57,25,29,8,11,46,55,57,66,12,6,6,0,0,0,1,0,87,0,6,1,97,2,4,0,17,0,0,55,51,21,35,34,46,3,53,17,51,21,51,21,35,21,20,216,136,
|
||||
125,25,33,41,24,16,68,162,162,65,58,3,15,26,50,34,1,124,118,58,204,70,0,0,0,1,0,54,255,246,1,130,1,133,0,21,0,0,55,53,51,21,20,51,50,54,53,55,51,19,35,53,14,4,35,34,38,54,68,86,44,
|
||||
62,3,68,1,64,1,3,17,23,45,27,79,73,145,244,241,102,53,39,251,254,124,42,2,7,19,13,12,74,0,0,0,1,0,29,0,0,1,155,1,133,0,6,0,0,1,51,3,35,3,51,19,1,84,70,148,86,147,71,120,1,133,254,123,
|
||||
1,133,254,186,0,0,0,0,1,255,248,255,255,1,192,1,133,0,12,0,0,1,51,3,35,39,7,35,3,51,19,55,51,23,1,124,67,97,63,68,65,65,97,68,68,53,76,60,1,133,254,123,215,215,1,133,254,208,192,192,
|
||||
0,0,0,0,1,0,20,255,255,1,163,1,133,0,11,0,0,37,23,35,39,7,35,55,39,51,23,55,51,1,1,162,78,122,120,78,162,149,76,110,109,76,203,203,155,155,204,185,141,141,0,0,1,0,47,255,68,1,137,1,
|
||||
134,0,31,0,0,1,18,21,20,14,2,43,1,53,51,50,62,4,53,52,53,35,34,38,53,19,51,21,20,22,51,23,3,1,134,3,12,24,47,32,195,176,16,23,13,8,3,1,133,71,72,1,68,29,41,137,1,1,133,254,135,48,17,
|
||||
47,52,36,59,12,24,22,34,17,14,4,2,78,49,1,6,229,49,50,1,1,73,0,0,0,1,0,64,255,255,1,119,1,134,0,14,0,0,55,51,23,33,53,62,3,39,35,53,33,21,2,137,237,1,254,202,15,50,105,69,1,229,1,45,
|
||||
238,52,52,59,17,58,122,82,1,50,60,254,235,0,0,0,0,1,0,63,255,178,1,120,2,84,0,41,0,0,1,21,20,7,22,29,1,20,22,59,1,21,34,35,34,46,3,61,1,52,38,43,1,53,51,50,54,61,1,52,62,3,59,1,21,
|
||||
35,34,6,1,11,72,72,38,42,29,31,13,38,54,27,14,3,38,43,51,51,43,38,3,14,27,54,38,44,29,42,38,1,215,100,95,17,17,96,99,34,29,62,20,26,44,30,23,86,43,32,66,32,42,87,23,30,44,26,19,62,
|
||||
29,0,0,1,0,188,255,200,0,252,2,63,0,3,0,0,23,35,17,51,252,64,64,55,2,117,0,1,0,63,255,178,1,120,2,84,0,41,0,0,19,53,52,38,43,1,53,50,51,50,30,3,29,1,20,22,59,1,21,35,34,6,29,1,20,14,
|
||||
3,43,1,53,51,50,54,61,1,52,55,38,172,37,42,29,30,14,37,54,27,15,2,38,44,51,51,44,38,2,15,27,54,37,44,29,42,37,72,72,1,115,100,33,29,62,19,26,44,30,23,87,42,32,66,32,43,86,24,29,44,
|
||||
26,20,62,29,33,100,96,17,16,0,0,0,1,0,22,0,177,1,161,1,93,0,33,0,0,1,23,14,4,35,34,46,3,7,14,1,15,1,39,62,4,51,50,30,3,55,62,1,55,1,103,58,5,5,17,21,40,25,25,43,30,28,31,16,20,25,3,
|
||||
3,58,5,5,17,21,40,25,25,43,30,28,31,16,20,25,3,1,66,13,21,21,45,24,20,26,35,36,21,2,3,45,21,21,13,21,22,44,24,21,26,36,35,22,3,3,45,20,0,3,0,21,0,0,1,163,0,106,0,15,0,31,0,47,0,0,55,
|
||||
50,22,29,1,20,6,43,1,34,38,61,1,52,54,59,1,50,22,29,1,20,6,43,1,34,38,61,1,52,54,59,1,50,22,29,1,20,6,43,1,34,38,61,1,52,54,51,104,5,7,7,5,71,4,8,8,4,222,5,7,7,5,70,5,7,7,5,221,5,7,
|
||||
7,5,70,5,7,7,5,105,7,5,81,5,7,7,5,81,5,7,7,5,81,5,7,7,5,81,5,7,7,5,81,5,7,7,5,81,5,7,0,0,2,0,159,255,235,1,25,2,9,0,7,0,13,0,0,18,34,38,52,54,50,22,20,7,51,23,7,35,53,245,50,35,35,
|
||||
50,35,84,46,29,1,101,1,145,35,49,35,35,49,105,196,155,155,0,2,0,63,255,147,1,121,1,242,0,5,0,28,0,0,55,17,14,1,21,20,19,17,54,55,21,6,7,21,35,53,46,1,53,52,54,55,53,51,21,22,23,21,
|
||||
38,243,50,58,146,57,39,45,51,38,78,102,100,80,38,61,35,40,49,1,38,6,73,67,134,1,25,254,215,2,25,59,21,3,100,101,6,107,92,95,104,4,97,98,5,20,60,25,0,1,0,40,255,255,1,144,2,16,0,27,
|
||||
0,0,55,51,21,33,53,51,53,35,53,51,53,52,54,51,50,22,31,1,21,38,35,34,6,29,1,51,21,35,202,197,254,153,87,73,73,82,79,33,52,9,10,48,42,50,50,136,136,59,59,59,161,50,82,88,88,10,5,5,64,
|
||||
30,53,63,88,50,0,0,0,2,0,55,0,63,1,128,1,125,0,7,0,31,0,0,54,50,54,52,38,34,6,20,54,20,7,23,7,39,6,34,39,7,39,55,38,52,55,39,55,23,54,50,23,55,23,7,187,65,46,46,65,46,204,22,60,34,
|
||||
62,31,73,31,62,34,60,22,22,60,34,62,31,73,31,62,34,60,148,44,61,43,43,61,67,73,30,57,35,60,19,19,60,35,57,30,73,30,57,35,60,19,19,60,35,57,0,1,0,5,0,0,1,178,2,7,0,24,0,0,1,7,51,21,
|
||||
35,7,21,51,21,35,21,35,53,35,53,51,53,39,35,53,51,39,51,23,55,1,178,120,91,115,33,148,148,75,148,148,33,115,91,119,79,135,134,2,6,194,39,53,11,39,182,182,39,11,53,39,194,228,228,0,
|
||||
0,0,0,2,0,188,255,206,0,252,2,57,0,3,0,7,0,0,23,35,17,51,53,35,17,51,252,64,64,64,64,50,1,8,92,1,7,0,0,2,0,64,255,188,1,119,2,16,0,15,0,75,0,0,37,62,1,53,52,38,39,38,39,14,1,21,20,
|
||||
22,23,22,23,30,1,21,20,6,35,34,38,47,1,53,22,51,50,54,53,52,38,39,38,39,46,4,53,52,54,55,46,1,53,52,54,51,50,22,31,1,21,38,35,34,6,21,20,22,23,22,23,30,4,21,20,6,1,10,21,28,48,46,25,
|
||||
22,22,27,48,45,25,61,25,21,69,72,25,57,16,16,58,51,36,42,37,47,8,3,28,25,39,17,14,38,33,25,21,68,74,24,54,14,14,51,51,37,40,36,47,8,3,29,24,39,17,14,38,142,12,35,15,26,44,25,14,13,
|
||||
12,36,15,26,44,25,14,37,18,34,23,44,66,10,5,5,57,26,32,25,20,30,26,4,2,16,14,28,23,34,19,28,50,16,18,34,24,43,59,10,5,5,57,27,26,25,20,30,26,4,2,15,15,28,23,33,20,28,50,0,0,0,0,2,0,
|
||||
109,1,212,1,75,2,27,0,11,0,23,0,0,1,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,1,66,58,9,9,58,9,155,58,9,9,58,8,1,213,9,52,9,9,52,9,9,52,9,9,52,9,0,0,3,255,248,0,
|
||||
40,1,192,1,218,0,7,0,15,0,36,0,0,54,50,54,52,38,34,6,20,18,50,22,20,6,34,38,52,22,52,54,51,50,23,21,38,35,34,6,21,20,22,51,50,55,21,6,35,34,142,156,111,111,156,111,95,188,133,133,188,
|
||||
134,92,78,62,57,30,43,34,47,52,52,47,46,31,36,51,61,79,105,147,105,105,147,1,34,127,179,127,127,179,152,126,66,15,38,21,48,49,49,47,18,36,17,0,0,0,0,3,0,92,0,162,1,91,2,18,0,3,0,18,
|
||||
0,53,0,0,37,35,53,51,39,34,35,34,14,4,21,20,22,51,50,54,7,52,62,2,23,60,1,46,2,35,34,6,15,1,53,62,6,51,50,22,29,1,35,39,6,35,34,38,1,91,247,247,55,5,8,25,24,37,19,20,8,36,22,49,41,
|
||||
201,37,58,70,33,8,15,32,22,26,50,11,12,2,18,7,17,12,17,18,9,57,73,45,8,39,54,47,59,163,43,178,1,3,6,11,18,13,24,24,61,16,33,43,14,7,4,8,10,22,14,11,11,6,6,44,1,6,2,6,2,3,1,57,64,159,
|
||||
38,45,44,0,2,0,50,0,49,1,134,1,112,0,6,0,13,0,0,1,21,7,23,21,39,53,55,7,23,21,39,53,55,1,134,112,112,174,7,111,111,173,173,1,112,67,93,93,66,145,28,79,93,93,66,145,28,146,0,0,4,255,
|
||||
248,0,40,1,192,1,218,0,9,0,27,0,35,0,43,0,0,19,22,62,2,53,52,38,43,1,23,30,1,23,35,38,39,38,43,1,21,35,53,51,50,21,20,14,1,50,54,52,38,34,6,20,18,50,22,20,6,34,38,52,175,21,36,27,15,
|
||||
29,21,49,86,14,25,46,52,30,17,21,24,27,47,92,103,34,147,156,111,111,156,111,95,188,133,133,188,134,1,13,1,2,6,18,15,19,20,102,5,33,72,44,26,33,103,242,74,21,32,172,105,147,105,105,
|
||||
147,1,34,127,179,127,127,179,0,0,1,0,109,1,183,1,75,1,235,0,3,0,0,1,35,53,51,1,74,220,220,1,183,51,0,0,0,0,2,0,101,1,50,1,82,2,16,0,7,0,15,0,0,18,50,54,52,38,34,6,20,54,50,22,20,6,
|
||||
34,38,52,190,59,42,42,59,41,22,98,69,69,98,69,1,94,39,55,39,39,55,138,65,91,65,65,91,0,0,0,0,2,0,24,255,255,1,159,1,151,0,11,0,15,0,0,19,51,21,35,21,35,53,35,53,51,53,51,19,33,53,33,
|
||||
251,164,164,62,165,165,62,164,254,121,1,135,1,36,59,115,115,59,114,254,105,59,0,0,0,1,0,115,1,133,1,69,2,173,0,24,0,0,1,20,14,1,7,51,21,35,53,54,55,54,53,52,38,35,34,6,15,1,53,54,51,
|
||||
50,22,1,66,17,62,70,152,210,77,32,42,37,28,17,42,12,13,39,51,57,58,2,94,20,33,64,61,39,38,72,29,40,36,18,25,11,6,6,41,20,51,0,0,1,0,109,1,130,1,75,2,176,0,39,0,0,1,20,6,35,34,38,47,
|
||||
1,53,22,51,50,54,53,52,38,43,1,53,51,50,54,53,52,38,35,34,6,15,1,53,54,51,50,22,21,20,6,7,22,1,75,68,55,21,49,15,14,50,42,26,48,43,31,31,31,29,36,30,27,21,44,12,12,47,44,49,63,33,30,
|
||||
71,1,214,37,47,7,4,4,42,18,26,25,25,27,38,22,21,18,22,8,4,4,42,13,42,33,28,29,7,13,0,0,0,1,0,131,1,181,1,53,2,57,0,3,0,0,19,51,7,35,235,73,120,56,2,57,131,0,0,0,0,1,0,37,255,107,1,
|
||||
146,1,132,0,36,0,0,37,50,54,63,1,21,6,35,34,38,47,1,14,4,35,34,38,39,21,35,17,51,21,20,22,51,50,54,53,55,51,16,21,20,1,120,7,12,4,3,27,29,19,26,4,3,1,4,16,22,42,27,26,47,11,60,64,45,
|
||||
37,43,59,3,65,49,4,2,2,52,15,26,13,13,2,7,18,14,11,28,26,192,2,24,241,48,53,53,38,251,254,226,24,29,0,0,0,1,0,48,255,185,1,136,2,7,0,16,0,0,19,51,17,35,17,35,16,21,6,34,47,1,17,34,
|
||||
38,52,54,216,175,52,70,1,26,13,13,69,99,99,2,6,253,182,2,32,253,229,5,2,1,1,1,39,85,121,85,0,0,1,0,159,0,198,1,25,1,63,0,7,0,0,18,50,22,20,6,34,38,52,195,50,35,35,50,35,1,63,35,50,
|
||||
35,35,50,0,0,1,0,143,255,119,1,41,0,1,0,16,0,0,33,22,21,20,35,34,38,47,1,53,22,51,50,39,48,58,1,1,0,40,91,14,31,8,8,24,27,91,73,21,22,41,37,59,4,2,2,46,11,94,0,0,0,1,0,114,1,132,1,
|
||||
70,2,167,0,10,0,0,19,51,21,35,53,51,53,7,53,55,51,250,75,204,76,83,85,51,1,171,38,38,212,14,40,13,0,3,0,83,0,162,1,101,2,16,0,3,0,13,0,21,0,0,37,35,53,51,2,34,6,21,20,22,50,54,53,52,
|
||||
22,32,53,52,54,50,22,21,1,86,249,249,88,69,46,45,71,45,56,254,239,73,127,73,163,43,1,25,47,54,54,49,49,54,54,197,143,71,71,71,71,0,0,0,0,2,0,50,0,49,1,134,1,112,0,6,0,13,0,0,55,21,
|
||||
7,53,55,39,53,51,23,21,7,53,55,39,223,173,111,111,166,174,174,112,112,222,28,145,66,93,93,67,146,28,145,66,93,93,0,4,0,19,255,162,1,165,2,64,0,3,0,6,0,17,0,28,0,0,1,23,5,39,23,51,53,
|
||||
55,21,51,21,35,21,35,53,35,53,55,3,7,53,55,51,21,51,21,35,53,51,1,155,9,254,120,9,198,102,51,43,43,50,144,134,187,82,87,48,75,203,75,1,47,37,91,37,203,144,43,188,37,65,65,42,183,1,
|
||||
86,14,39,13,252,39,39,0,3,0,19,255,162,1,165,2,64,0,3,0,28,0,39,0,0,1,23,5,39,5,7,51,21,35,53,54,55,54,53,52,38,35,34,6,15,1,39,54,51,50,22,21,20,6,1,7,53,55,51,21,51,21,35,53,51,1,
|
||||
155,9,254,120,9,1,73,86,152,210,77,32,42,37,28,17,41,13,12,1,39,51,57,59,28,254,252,82,87,48,75,203,75,1,47,37,91,37,190,77,39,39,71,30,39,36,19,25,12,6,6,42,19,51,27,23,45,1,226,14,
|
||||
39,13,252,39,39,0,4,0,18,255,162,1,165,2,70,0,3,0,6,0,17,0,56,0,0,1,23,5,39,23,51,39,55,21,51,21,35,21,35,53,35,53,55,39,20,6,35,34,38,47,1,53,22,51,50,54,52,38,43,1,53,51,50,54,53,
|
||||
52,38,35,34,6,15,1,53,54,51,50,22,21,20,6,7,22,1,155,9,254,120,9,202,102,1,51,43,43,49,145,134,45,72,55,21,48,13,13,41,46,36,42,38,34,33,30,31,37,33,25,24,45,10,10,46,44,50,62,33,30,
|
||||
72,1,47,37,91,37,203,144,43,188,37,65,65,42,183,168,36,47,7,4,4,41,18,29,47,28,37,23,21,20,20,8,4,4,42,12,41,32,29,29,8,14,0,0,2,0,73,255,247,1,111,2,27,0,30,0,38,0,0,55,50,54,63,1,
|
||||
21,14,2,35,34,38,53,52,62,4,61,1,51,21,20,14,3,21,20,22,18,34,38,52,54,50,22,20,235,29,66,18,19,7,24,69,34,82,78,19,29,34,29,19,71,26,37,38,26,47,71,44,32,32,44,32,48,24,11,12,65,5,
|
||||
12,21,65,54,24,43,30,30,24,31,17,69,61,30,48,34,31,39,21,31,36,1,129,31,44,31,31,44,0,0,3,0,5,0,0,1,179,2,131,0,3,0,6,0,14,0,0,1,35,39,51,3,51,3,55,19,35,39,35,7,35,19,1,9,56,84,68,
|
||||
52,158,79,45,169,77,41,193,40,77,169,2,38,92,254,61,1,10,61,253,250,135,135,2,6,0,0,3,0,5,0,0,1,179,2,131,0,3,0,6,0,14,0,0,1,7,35,55,3,51,3,55,19,35,39,35,7,35,19,1,59,84,56,72,106,
|
||||
158,79,45,169,77,40,193,41,77,169,2,130,92,92,254,61,1,10,61,253,250,135,135,2,6,0,3,0,5,255,255,1,179,2,131,0,6,0,9,0,17,0,0,19,7,35,55,51,23,35,3,51,3,55,19,35,39,35,7,35,19,220,
|
||||
61,51,78,69,78,51,141,158,79,45,169,77,40,193,41,77,169,2,101,62,92,92,254,151,1,10,61,253,250,135,135,2,6,0,0,0,3,0,5,255,254,1,179,2,123,0,20,0,23,0,31,0,0,19,34,6,21,35,52,54,51,
|
||||
50,22,51,50,54,53,55,51,20,6,35,34,38,3,51,3,55,19,35,39,35,7,35,19,169,12,12,47,36,34,26,62,15,11,13,1,46,34,36,28,58,45,158,79,45,169,77,40,193,41,77,169,2,81,19,16,33,43,34,17,9,
|
||||
8,25,51,35,254,109,1,10,61,253,250,135,135,2,6,0,0,0,4,0,5,255,255,1,179,2,131,0,2,0,10,0,22,0,34,0,0,55,51,3,55,19,35,39,35,7,35,19,55,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,
|
||||
59,1,50,29,1,20,141,158,79,45,169,77,40,193,41,77,169,147,58,9,9,58,9,155,58,9,9,58,9,190,1,10,61,253,250,135,135,2,6,56,9,52,9,9,52,9,9,52,9,9,52,9,0,0,0,0,3,0,5,255,254,1,179,2,149,
|
||||
0,2,0,14,0,30,0,0,55,51,3,39,20,22,23,51,62,1,53,52,38,34,6,23,19,35,39,35,7,35,19,38,53,52,54,50,22,21,20,141,158,79,56,18,16,44,16,19,33,47,34,112,159,77,40,193,41,77,159,47,60,84,
|
||||
60,190,1,10,110,17,26,6,6,26,17,21,31,31,101,254,25,135,135,1,231,28,51,40,55,55,40,51,0,2,0,2,255,255,1,182,2,7,0,3,0,19,0,0,55,17,35,3,55,21,51,21,35,53,35,7,35,19,37,7,35,23,55,
|
||||
7,235,37,75,186,128,202,127,37,68,150,1,23,1,122,1,111,1,190,1,13,254,244,55,188,59,134,133,2,5,2,61,153,1,60,0,0,0,1,0,47,255,119,1,137,2,16,0,40,0,0,1,34,14,2,21,20,30,1,51,50,55,
|
||||
21,6,7,22,21,20,6,35,34,39,53,22,51,50,53,52,39,46,3,53,52,54,51,50,23,21,38,1,8,38,57,32,14,25,66,50,77,51,37,56,33,45,38,45,25,24,31,46,26,54,81,48,23,112,104,77,51,51,1,213,32,60,
|
||||
74,46,62,91,59,46,73,21,5,36,32,31,30,9,45,11,31,22,32,3,42,74,93,56,117,151,32,71,45,0,2,0,52,0,3,1,132,2,135,0,11,0,15,0,0,55,33,21,33,17,33,21,35,31,1,21,35,19,35,39,51,127,1,4,
|
||||
254,178,1,71,253,1,241,242,142,57,84,68,63,59,2,6,59,153,1,59,1,48,93,0,0,0,2,0,52,0,4,1,132,2,135,0,11,0,15,0,0,55,33,21,33,17,33,21,35,31,1,21,35,19,7,35,55,127,1,4,254,178,1,71,
|
||||
253,1,241,242,173,84,56,72,64,59,2,6,59,153,1,59,1,140,93,93,0,0,2,0,52,0,4,1,132,2,136,0,11,0,18,0,0,55,33,21,33,17,33,21,35,31,1,21,35,19,7,35,55,51,23,35,127,1,4,254,178,1,71,253,
|
||||
1,241,242,86,61,52,78,70,78,52,64,59,2,6,59,153,1,59,1,110,62,93,93,0,0,0,3,0,52,0,0,1,132,2,133,0,11,0,23,0,35,0,0,1,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,
|
||||
3,33,21,33,17,33,21,35,23,51,21,35,1,66,58,9,9,58,9,155,58,9,9,58,9,58,1,4,254,178,1,71,253,1,241,242,2,63,8,52,9,9,52,8,8,52,9,9,52,8,253,252,59,2,6,59,153,59,0,2,0,66,255,254,1,118,
|
||||
2,131,0,11,0,15,0,0,1,35,17,23,21,33,53,51,17,35,53,33,39,35,39,51,1,117,115,115,254,206,116,116,1,50,106,56,84,68,1,202,254,111,1,57,59,1,144,59,33,92,0,0,0,2,0,66,0,3,1,118,2,135,
|
||||
0,11,0,15,0,0,1,35,17,51,21,33,53,51,17,39,53,33,39,7,35,55,1,117,116,116,254,206,115,115,1,50,60,84,56,72,1,207,254,112,59,57,1,145,1,59,125,93,93,0,0,2,0,66,0,3,1,118,2,136,0,11,
|
||||
0,18,0,0,1,35,17,51,21,33,53,51,17,39,53,33,39,7,35,55,51,23,35,1,117,116,116,254,206,115,115,1,50,148,61,52,78,70,78,52,1,207,254,112,59,57,1,145,1,59,95,62,93,93,0,0,0,3,0,66,255,
|
||||
254,1,118,2,131,0,11,0,23,0,35,0,0,1,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,23,35,17,51,21,33,53,55,17,35,53,33,1,66,58,9,9,58,9,155,58,9,9,58,9,188,116,116,
|
||||
254,206,115,115,1,50,2,61,9,52,9,9,52,9,9,52,9,9,52,9,115,254,112,59,57,1,1,145,59,0,0,2,0,17,0,4,1,167,2,11,0,18,0,37,0,0,55,50,62,3,52,46,3,43,1,21,51,21,35,21,50,19,50,30,3,20,14,
|
||||
3,43,1,53,35,53,51,53,50,200,19,36,42,30,20,20,30,42,36,19,62,99,99,62,1,31,56,61,45,29,29,45,61,56,30,139,46,46,138,62,9,27,42,75,98,75,42,27,8,162,53,188,1,205,12,35,55,95,125,96,
|
||||
54,35,11,245,53,220,0,0,2,0,42,0,0,1,142,2,130,0,20,0,30,0,0,19,34,6,21,35,52,54,51,50,22,51,50,54,53,55,51,20,6,35,34,38,23,51,17,35,3,17,35,3,51,19,169,12,12,47,36,34,26,62,15,11,
|
||||
13,1,46,34,36,28,58,140,72,95,186,71,4,98,186,2,88,19,16,33,43,34,17,9,8,25,51,35,82,253,250,1,166,254,90,2,6,254,90,0,3,0,35,255,250,1,149,2,135,0,5,0,9,0,29,0,0,19,50,16,35,34,16,
|
||||
55,35,39,51,18,50,62,3,52,46,3,34,14,3,20,30,2,220,184,184,184,238,57,84,68,3,33,27,30,20,13,13,20,29,28,34,27,30,20,13,13,20,31,2,17,253,234,2,22,25,93,253,175,8,26,43,78,106,78,44,
|
||||
26,8,8,26,44,78,106,78,43,26,0,0,0,3,0,35,255,250,1,149,2,136,0,5,0,12,0,32,0,0,19,50,16,35,34,16,55,7,35,55,51,23,35,2,50,62,3,52,46,3,34,14,3,20,30,2,220,184,184,184,184,61,52,78,
|
||||
70,78,52,77,33,27,30,20,13,13,20,29,28,34,27,30,20,13,13,20,31,2,17,253,234,2,22,88,62,93,93,254,11,8,26,43,78,106,78,44,26,8,8,26,44,78,106,78,43,26,0,0,0,3,0,35,255,251,1,149,2,129,
|
||||
0,20,0,26,0,46,0,0,19,34,6,21,35,52,54,51,50,22,51,50,54,55,53,51,20,6,35,34,38,23,50,16,35,34,16,18,50,62,3,52,46,3,34,14,3,20,30,2,169,11,13,47,36,35,25,62,15,11,13,1,46,34,35,29,
|
||||
58,34,184,184,184,168,33,27,30,20,13,13,20,29,28,34,27,30,20,13,13,20,31,2,87,19,16,33,43,34,17,9,8,25,51,35,70,253,234,2,22,254,37,8,26,44,78,105,78,44,27,7,7,27,44,78,105,78,44,26,
|
||||
0,0,0,4,0,35,255,250,1,149,2,136,0,5,0,17,0,29,0,49,0,0,19,50,16,35,34,16,37,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,18,50,62,3,52,46,3,34,14,3,20,30,2,220,184,
|
||||
184,184,1,30,58,9,9,58,9,155,58,9,9,58,9,19,33,27,30,20,13,13,20,29,28,34,27,30,20,13,13,20,31,2,17,253,234,2,22,49,9,52,9,9,52,9,9,52,9,9,52,9,253,244,8,26,43,78,106,78,44,26,8,8,
|
||||
26,44,78,106,78,43,26,0,1,0,46,0,65,1,137,1,137,0,11,0,0,1,7,23,7,39,7,39,55,39,55,23,55,1,137,129,129,45,128,129,45,129,129,45,129,128,1,94,121,121,42,121,121,42,121,121,42,121,121,
|
||||
0,3,0,1,255,234,1,183,2,34,0,10,0,21,0,39,0,0,55,50,62,3,53,52,39,7,22,39,20,23,55,38,35,34,14,3,37,7,22,21,16,35,34,39,7,39,55,38,53,16,51,50,23,55,220,17,27,30,20,13,7,184,26,49,
|
||||
7,185,26,59,17,27,30,20,13,1,70,65,30,184,83,46,54,36,65,30,184,83,46,54,54,8,26,43,78,53,56,42,248,58,208,56,42,249,58,8,26,44,78,205,88,65,105,254,245,56,72,25,88,65,105,1,11,56,
|
||||
72,0,0,2,0,46,255,246,1,138,2,131,0,17,0,21,0,0,1,51,17,20,35,34,53,17,51,17,20,22,51,50,62,2,53,3,35,39,51,1,62,75,170,176,75,39,61,30,40,19,7,43,57,84,69,2,6,254,160,176,189,1,83,
|
||||
254,160,67,52,18,33,36,25,1,135,92,0,2,0,46,255,246,1,138,2,131,0,17,0,21,0,0,1,51,17,20,35,34,53,17,51,17,20,22,51,50,62,2,53,3,7,35,55,1,62,75,170,176,75,39,61,30,40,19,7,12,84,57,
|
||||
72,2,6,254,160,176,189,1,83,254,160,67,52,18,33,36,25,1,227,92,92,0,0,0,0,2,0,46,255,246,1,138,2,131,0,17,0,24,0,0,1,51,17,20,35,34,53,17,51,17,20,22,51,50,62,2,53,3,7,35,55,51,23,
|
||||
35,1,62,75,170,176,75,39,61,30,40,19,7,98,61,52,78,70,78,52,2,6,254,160,176,189,1,83,254,160,67,52,17,34,36,25,1,198,62,92,92,0,3,0,47,255,246,1,138,2,131,0,17,0,29,0,41,0,0,1,51,17,
|
||||
20,35,34,53,17,51,17,20,22,51,50,62,2,53,19,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,1,62,76,171,176,75,40,61,30,39,19,7,5,58,9,9,58,9,155,58,9,9,58,9,2,6,254,
|
||||
160,176,189,1,83,254,160,67,52,17,34,36,25,1,158,9,52,9,9,52,9,9,52,9,9,52,9,0,0,0,0,2,0,5,255,255,1,179,2,130,0,8,0,12,0,0,1,51,3,21,35,55,3,51,23,19,7,35,55,1,98,80,177,75,1,177,
|
||||
79,135,90,84,57,73,2,6,254,227,233,234,1,28,229,1,97,92,92,0,0,2,0,42,255,255,1,142,2,6,0,8,0,21,0,0,55,50,54,53,52,38,43,1,21,55,50,22,21,20,43,1,21,35,17,51,21,50,210,49,61,63,47,
|
||||
93,103,83,95,178,103,75,75,103,186,43,48,47,42,180,240,75,74,150,127,2,6,92,0,0,0,1,0,42,255,242,1,142,2,28,0,48,0,0,19,20,30,3,21,20,14,1,38,39,53,22,51,50,54,53,52,46,3,53,52,62,
|
||||
2,63,1,38,54,46,2,35,34,6,21,17,35,17,52,54,51,50,21,34,6,234,34,48,48,33,51,78,88,38,49,51,41,45,33,47,47,33,24,35,34,12,12,1,3,10,14,38,27,46,41,68,73,82,155,47,72,1,50,20,33,27,
|
||||
32,53,35,43,57,20,5,16,56,21,36,29,24,37,25,27,45,30,28,44,24,15,2,2,1,15,23,22,16,48,50,254,123,1,133,77,74,152,44,0,0,0,0,3,0,38,255,245,1,146,2,69,0,3,0,18,0,61,0,0,1,35,39,51,19,
|
||||
50,62,2,39,48,42,1,35,14,1,21,20,22,55,21,20,22,31,1,35,38,39,14,1,35,34,38,53,52,54,59,1,60,2,46,5,35,34,6,15,1,53,62,6,51,50,1,12,57,118,72,24,36,52,26,10,1,36,47,11,60,52,51,225,
|
||||
10,5,5,68,9,7,21,76,38,65,80,91,91,92,2,6,8,15,20,30,18,38,71,16,17,3,25,11,24,17,24,26,13,168,1,194,131,253,230,29,47,50,26,2,32,44,38,36,183,116,25,55,15,15,22,37,32,37,64,60,62,
|
||||
70,1,15,9,18,13,16,11,10,5,18,10,9,63,1,9,3,8,3,4,2,0,0,0,0,3,0,38,255,245,1,146,2,69,0,3,0,18,0,61,0,0,1,7,35,55,3,50,62,2,39,42,2,35,14,1,21,20,22,55,21,20,22,31,1,35,38,39,14,1,
|
||||
35,34,38,53,52,54,59,1,60,2,46,5,35,34,6,15,1,53,62,6,51,50,1,84,118,57,103,80,37,52,26,10,1,1,35,47,11,60,52,51,225,10,5,5,68,9,7,21,76,38,65,80,91,91,92,2,6,8,15,20,30,18,38,71,16,
|
||||
17,3,25,11,24,17,24,26,13,168,2,69,131,131,253,230,29,47,50,26,2,32,44,38,36,183,116,25,55,15,15,22,37,32,37,64,60,62,70,1,15,9,18,13,16,11,10,5,18,10,9,63,1,9,3,8,3,4,2,0,0,0,3,0,
|
||||
38,255,245,1,146,2,69,0,6,0,21,0,64,0,0,19,7,35,55,51,23,35,3,50,62,2,39,48,42,1,35,14,1,21,20,22,55,21,20,22,31,1,35,38,39,14,1,35,34,38,53,52,54,59,1,60,2,46,5,35,34,6,15,1,53,62,
|
||||
6,51,50,220,66,52,90,56,90,52,97,36,52,26,10,1,36,47,11,60,52,51,225,10,5,5,68,9,7,21,76,38,65,80,91,91,92,2,6,8,15,20,30,18,38,71,16,17,3,25,11,24,17,24,26,13,168,2,26,88,131,131,
|
||||
254,105,29,47,50,26,2,32,44,38,36,183,116,25,55,15,15,22,37,32,37,64,60,63,69,1,15,9,18,13,16,11,10,5,18,10,9,63,1,9,3,8,3,4,2,0,3,0,38,255,245,1,146,2,51,0,24,0,39,0,82,0,0,1,34,46,
|
||||
2,35,34,21,35,52,54,51,50,30,1,51,50,54,61,1,51,20,14,2,3,50,62,2,39,48,42,1,35,14,1,21,20,22,55,21,20,22,31,1,35,38,39,14,1,35,34,38,53,52,54,59,1,60,2,46,5,35,34,6,15,1,53,62,6,51,
|
||||
50,1,13,21,31,16,23,11,26,45,36,37,21,34,30,13,12,13,46,5,13,30,101,36,52,26,10,1,36,47,11,60,52,51,225,10,5,5,68,9,7,21,76,38,65,80,91,91,92,2,6,8,15,20,30,18,38,71,16,17,3,25,11,
|
||||
24,17,24,26,13,168,1,209,17,20,17,54,43,55,27,26,26,13,14,15,29,33,21,254,90,29,47,50,26,2,32,44,38,36,183,116,25,55,15,15,22,37,32,37,64,60,62,70,1,15,9,18,13,16,11,10,5,18,10,9,63,
|
||||
1,9,3,8,3,4,2,0,0,0,4,0,38,255,245,1,146,2,29,0,11,0,23,0,38,0,81,0,0,1,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,19,50,62,2,39,42,2,35,14,1,21,20,22,55,21,20,22,
|
||||
31,1,35,38,39,14,1,35,34,38,53,52,54,59,1,60,2,46,5,35,34,6,15,1,53,62,6,51,50,1,63,58,9,9,58,9,155,58,9,9,58,9,6,37,52,26,10,1,1,35,47,11,60,52,51,225,10,5,5,68,9,7,21,76,38,65,80,
|
||||
91,91,92,2,6,8,15,20,30,18,38,71,16,17,3,25,11,24,17,24,26,13,168,1,214,9,52,9,9,52,9,9,52,9,9,52,9,254,85,29,47,50,26,2,32,44,38,36,183,116,25,55,15,15,22,37,32,37,64,60,62,70,1,15,
|
||||
9,18,13,16,11,10,5,18,10,9,63,1,9,3,8,3,4,2,0,0,0,4,0,38,255,245,1,146,2,114,0,7,0,15,0,58,0,73,0,0,18,34,6,20,22,50,54,52,6,34,38,52,54,50,22,20,19,21,20,22,31,1,35,38,39,14,1,35,
|
||||
34,38,53,52,54,59,1,60,2,46,5,35,34,6,15,1,53,62,6,51,50,3,50,62,2,39,42,2,35,14,1,21,20,22,240,46,33,33,46,33,14,84,60,60,84,60,63,10,5,5,68,9,7,21,76,38,65,80,91,91,92,2,6,8,15,20,
|
||||
30,18,38,71,16,17,3,25,11,24,17,24,26,13,168,194,37,52,26,10,1,1,35,47,11,60,52,51,2,70,31,44,31,31,44,118,56,80,56,56,80,254,249,116,25,55,15,15,22,37,32,37,64,60,62,70,1,15,9,18,
|
||||
13,16,11,10,5,18,10,9,63,1,9,3,8,3,4,2,254,155,29,47,50,26,2,32,44,38,36,0,0,0,0,3,0,5,255,245,1,179,1,143,0,8,0,19,0,89,0,0,1,34,6,23,51,54,39,46,1,3,50,62,1,39,35,34,6,21,20,22,37,
|
||||
21,35,28,2,30,5,51,22,54,63,1,21,14,2,35,34,46,2,47,1,14,4,35,34,38,53,52,54,59,1,53,52,38,35,34,6,15,1,53,54,51,50,30,2,31,1,62,4,51,50,22,23,30,1,21,1,56,31,31,3,121,1,2,3,27,217,
|
||||
26,26,14,1,28,53,44,37,1,75,182,2,4,6,10,14,21,12,34,52,9,10,5,15,48,25,25,42,22,16,2,3,1,4,16,21,36,22,57,60,70,68,50,42,30,19,46,13,14,44,65,19,30,18,12,2,2,1,3,14,19,36,22,58,48,
|
||||
8,2,1,1,90,54,64,23,22,35,38,254,209,18,59,59,32,38,35,31,136,1,1,28,10,28,13,23,11,14,6,1,17,9,10,60,3,10,16,11,17,16,6,5,2,7,19,15,12,60,56,57,65,28,50,39,14,8,7,58,24,9,13,13,4,
|
||||
5,2,6,15,11,10,59,76,18,42,12,0,0,0,1,0,59,255,119,1,125,1,142,0,37,0,0,1,34,6,21,20,22,51,50,55,21,14,1,15,1,22,21,20,6,35,34,39,53,22,51,50,53,52,39,46,1,53,52,54,51,50,23,21,38,
|
||||
1,13,65,72,72,65,62,49,14,43,15,15,33,45,38,45,25,24,31,46,26,82,106,110,85,78,47,49,1,88,74,76,76,74,43,65,11,15,2,2,36,32,31,30,8,46,12,32,22,31,3,105,96,98,106,32,65,43,0,0,0,3,
|
||||
0,37,255,247,1,147,2,69,0,3,0,9,0,30,0,0,1,35,39,51,23,34,6,21,51,52,7,20,22,51,50,54,55,21,6,35,34,38,53,52,54,51,50,22,21,23,32,1,19,57,118,72,55,46,70,224,227,62,67,42,62,46,70,
|
||||
82,89,109,105,79,92,89,1,254,217,1,194,131,236,68,48,116,165,56,79,18,21,64,29,109,95,93,110,97,73,48,0,3,0,37,255,247,1,147,2,69,0,3,0,9,0,30,0,0,1,7,35,55,7,34,6,21,51,52,7,20,22,
|
||||
51,50,54,55,21,6,35,34,38,53,52,54,51,50,22,21,23,32,1,93,119,56,102,49,46,70,224,227,62,67,42,62,46,70,82,89,109,105,79,92,89,1,254,217,2,69,131,131,236,68,48,116,165,56,79,18,21,
|
||||
64,29,109,95,93,110,97,73,48,0,0,0,0,3,0,37,255,247,1,147,2,69,0,6,0,12,0,33,0,0,19,7,35,55,51,23,35,7,34,6,21,51,52,7,20,22,51,50,54,55,21,6,35,34,38,53,52,54,51,50,22,21,23,32,225,
|
||||
67,52,90,57,90,52,64,46,70,224,227,62,67,42,62,46,70,82,89,109,105,79,92,89,1,254,217,2,26,88,131,131,105,68,48,116,165,56,79,18,21,64,29,109,95,93,110,97,73,48,0,0,4,0,37,255,247,
|
||||
1,147,2,29,0,11,0,23,0,29,0,50,0,0,1,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,23,34,6,21,51,52,7,20,22,51,50,54,55,21,6,35,34,38,53,52,54,51,50,22,21,23,32,1,69,
|
||||
57,9,9,57,9,155,58,9,9,58,9,39,46,70,224,227,62,67,42,62,46,70,82,89,109,105,79,92,89,1,254,217,1,214,9,52,9,9,52,9,9,52,9,9,52,9,125,68,48,116,165,56,79,18,21,64,29,109,95,93,110,
|
||||
97,73,48,0,0,0,0,2,0,51,255,252,1,117,2,59,0,13,0,17,0,0,37,51,21,34,35,34,38,61,1,35,53,51,21,20,17,35,39,51,1,37,80,24,71,54,65,90,158,57,119,73,51,54,78,63,201,50,251,86,1,132,131,
|
||||
0,0,0,0,2,0,68,255,252,1,116,2,59,0,13,0,17,0,0,37,51,21,34,35,34,38,61,1,35,53,51,21,20,19,7,35,55,1,37,79,23,72,53,66,90,158,106,119,57,103,51,54,78,63,201,50,251,86,2,7,131,131,
|
||||
0,0,2,0,68,255,252,1,116,2,69,0,6,0,20,0,0,19,7,35,55,51,23,35,19,51,21,34,35,34,38,61,1,35,53,51,21,20,186,66,52,90,56,90,51,40,79,23,72,53,66,90,158,2,26,88,131,131,254,113,54,78,
|
||||
63,201,50,251,86,0,0,0,3,0,68,255,252,1,116,2,26,0,11,0,23,0,37,0,0,1,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,19,51,21,34,35,34,38,61,1,35,53,51,21,20,1,44,57,
|
||||
9,9,57,9,155,57,9,9,57,9,130,79,23,72,53,66,90,158,1,212,9,52,9,9,52,9,9,52,9,9,52,9,254,95,54,78,63,201,50,251,86,0,2,0,42,255,244,1,142,2,27,0,14,0,47,0,0,55,50,54,53,52,38,47,1,
|
||||
38,35,34,6,21,20,22,19,20,30,6,21,20,6,35,34,38,53,52,54,23,46,1,47,1,7,39,55,39,51,23,55,23,7,22,220,45,60,20,10,10,18,50,43,59,60,145,20,6,19,8,13,6,5,89,88,88,89,107,100,5,27,10,
|
||||
11,103,12,88,67,81,47,106,13,93,36,42,70,71,38,67,15,14,9,69,73,73,69,1,89,1,27,10,29,19,33,29,38,19,86,107,107,94,93,102,8,8,31,12,11,31,34,27,69,49,32,34,28,34,0,0,0,0,2,0,62,0,0,
|
||||
1,122,2,32,0,18,0,43,0,0,19,50,22,21,17,35,53,52,38,35,34,6,29,1,35,17,51,23,54,55,34,21,35,52,54,51,50,30,1,51,50,54,61,1,51,20,14,2,35,34,46,2,253,53,72,68,39,38,47,56,68,64,4,37,
|
||||
3,26,45,36,37,20,35,30,13,12,13,46,5,14,29,21,21,31,17,22,1,145,78,67,255,0,250,45,48,61,59,223,1,132,47,60,99,54,44,54,27,26,26,14,13,15,29,33,21,17,20,17,0,0,0,3,0,43,255,244,1,141,
|
||||
2,69,0,3,0,13,0,21,0,0,1,35,39,51,18,50,54,53,52,38,34,6,21,20,18,50,22,21,20,32,53,52,1,15,56,119,73,5,92,58,59,90,59,21,166,94,254,158,1,194,131,253,229,71,80,80,70,70,80,80,1,28,
|
||||
102,102,204,204,102,0,0,3,0,43,255,244,1,141,2,69,0,3,0,13,0,21,0,0,1,7,35,55,2,50,54,53,52,38,34,6,21,20,18,50,22,21,20,32,53,52,1,86,118,57,103,96,92,58,59,90,59,21,166,94,254,158,
|
||||
2,69,131,131,253,229,71,80,80,70,70,80,80,1,28,102,102,204,204,102,0,3,0,43,255,244,1,141,2,69,0,6,0,16,0,24,0,0,19,7,35,55,51,23,35,2,50,54,53,52,38,34,6,21,20,18,50,22,21,20,32,53,
|
||||
52,220,66,52,90,56,90,52,112,92,58,59,90,59,21,166,94,254,158,2,26,88,131,131,254,104,71,80,80,70,70,80,80,1,28,102,102,204,204,102,0,0,0,3,0,43,255,244,1,141,2,32,0,24,0,34,0,42,0,
|
||||
0,1,34,46,2,35,34,21,35,52,54,51,50,30,1,51,50,54,61,1,51,20,14,2,2,50,54,53,52,38,34,6,21,20,18,50,22,21,20,32,53,52,1,15,20,32,16,22,12,25,46,36,38,20,35,29,14,12,13,46,5,14,30,118,
|
||||
92,58,59,90,59,21,166,94,254,158,1,190,17,20,17,54,44,54,27,26,26,14,13,15,29,33,21,254,108,71,80,80,70,70,80,80,1,28,102,102,204,204,102,0,4,0,43,255,244,1,141,2,26,0,11,0,23,0,33,
|
||||
0,41,0,0,1,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,2,50,54,53,52,38,34,6,21,20,18,50,22,21,20,32,53,52,1,66,58,9,9,58,9,155,58,9,9,58,9,11,92,58,59,90,59,21,166,
|
||||
94,254,158,1,212,9,52,9,9,52,9,9,52,9,9,52,9,254,86,71,80,80,70,70,80,80,1,28,102,102,204,204,102,0,3,0,24,0,49,1,159,1,136,0,3,0,19,0,35,0,0,37,33,53,33,39,35,34,38,61,1,52,54,59,
|
||||
1,50,22,29,1,20,6,3,35,34,38,61,1,52,54,59,1,50,22,29,1,20,6,1,159,254,121,1,135,161,70,4,7,7,4,70,5,6,6,5,70,4,7,7,4,70,5,6,6,192,59,56,6,5,63,5,6,6,5,63,5,6,254,255,6,5,63,4,7,7,
|
||||
4,63,5,6,0,0,0,0,3,0,12,255,222,1,172,1,166,0,7,0,15,0,35,0,0,55,50,54,53,52,39,7,22,39,20,23,55,38,35,34,6,37,7,22,21,20,35,34,39,7,39,55,38,53,52,54,51,50,23,55,22,222,47,57,10,169,
|
||||
27,56,9,168,27,46,45,59,1,54,61,33,178,75,44,57,34,62,29,94,83,71,46,55,34,43,72,80,42,32,189,37,152,42,31,189,33,70,121,68,52,81,204,40,63,26,70,50,81,102,102,39,63,27,0,0,0,0,2,0,
|
||||
61,255,246,1,123,2,59,0,3,0,26,0,0,1,35,39,51,23,51,17,35,39,14,4,35,34,38,61,1,51,21,20,22,51,50,54,53,1,13,57,119,73,144,68,63,6,2,5,20,23,38,21,77,61,67,38,43,44,53,1,184,131,182,
|
||||
254,124,57,2,10,23,18,14,72,82,244,240,52,52,59,50,0,0,0,2,0,61,255,246,1,123,2,59,0,3,0,26,0,0,1,7,35,55,23,51,17,35,39,14,4,35,34,38,61,1,51,21,20,22,51,50,54,53,1,83,119,56,102,
|
||||
44,68,63,6,2,5,20,23,38,21,77,61,67,38,43,44,53,2,59,131,131,182,254,124,57,2,10,23,18,14,72,82,244,240,52,52,59,50,0,0,2,0,61,255,246,1,123,2,69,0,6,0,29,0,0,19,7,35,55,51,23,35,23,
|
||||
17,35,39,14,4,35,34,38,61,1,51,21,20,22,51,50,54,53,55,220,66,52,90,56,90,52,92,63,6,2,5,20,23,38,21,77,61,67,38,42,45,53,2,2,26,88,131,131,61,254,124,57,2,10,23,18,14,72,82,244,240,
|
||||
52,52,59,50,235,0,0,0,3,0,61,255,246,1,123,2,27,0,11,0,23,0,46,0,0,1,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,23,51,17,35,39,14,4,35,34,38,61,1,51,21,20,22,51,
|
||||
50,54,53,1,63,58,8,8,58,9,155,58,9,9,58,9,128,68,63,6,2,5,20,23,38,21,77,61,67,38,42,45,53,1,213,9,52,9,9,52,9,9,52,9,9,52,9,80,254,124,57,2,10,23,18,14,72,82,244,240,52,52,59,50,0,
|
||||
0,2,0,26,255,107,1,158,2,59,0,17,0,21,0,0,1,51,2,7,14,3,43,1,53,51,50,54,55,3,51,27,1,7,35,55,1,86,72,140,39,14,32,36,25,18,54,46,30,32,22,160,72,123,105,119,56,102,1,133,254,175,98,
|
||||
35,44,18,5,54,46,54,1,127,254,208,1,230,131,131,0,0,0,2,0,50,255,107,1,134,2,32,0,9,0,23,0,0,54,50,54,53,52,38,34,6,21,20,19,50,22,21,20,35,34,39,21,35,17,51,21,54,174,89,55,57,86,
|
||||
56,99,80,91,171,67,32,68,68,31,42,71,80,80,70,70,80,80,1,28,102,102,204,65,202,2,180,208,61,0,0,0,3,0,26,255,107,1,158,2,17,0,17,0,29,0,41,0,0,1,51,2,7,14,3,43,1,53,51,50,54,55,3,51,
|
||||
27,1,35,34,61,1,52,59,1,50,29,1,20,43,1,34,61,1,52,59,1,50,29,1,20,1,86,72,140,39,14,32,36,25,18,54,46,30,32,22,160,72,123,100,57,9,9,57,9,155,58,9,9,58,9,1,133,254,175,98,35,44,18,
|
||||
5,54,46,54,1,127,254,208,1,118,9,52,9,9,52,9,9,52,9,9,52,9,0,0,0,1,0,30,255,249,1,153,2,20,0,43,0,0,1,34,7,51,7,35,6,21,20,21,51,7,35,30,3,51,50,54,55,21,6,35,34,38,39,35,55,51,38,
|
||||
52,55,35,55,51,62,1,51,50,23,21,46,1,1,44,110,20,178,18,163,1,132,17,111,6,27,38,37,23,20,61,27,47,61,88,103,14,65,18,44,2,2,62,18,47,14,103,83,65,48,28,61,1,220,144,36,30,4,17,15,
|
||||
37,44,60,29,10,19,24,71,28,104,95,37,29,9,28,36,95,105,29,72,24,21,0,0,0,0,0,0,14,0,174,0,1,0,0,0,0,0,0,0,1,0,4,0,1,0,0,0,0,0,1,0,1,0,10,0,1,0,0,0,0,0,2,0,1,0,16,0,1,0,0,0,0,0,3,0,
|
||||
29,0,78,0,1,0,0,0,0,0,4,0,1,0,112,0,1,0,0,0,0,0,5,0,9,0,134,0,1,0,0,0,0,0,6,0,1,0,148,0,3,0,1,4,9,0,0,0,2,0,0,0,3,0,1,4,9,0,1,0,2,0,6,0,3,0,1,4,9,0,2,0,2,0,12,0,3,0,1,4,9,0,3,0,58,
|
||||
0,18,0,3,0,1,4,9,0,4,0,2,0,108,0,3,0,1,4,9,0,5,0,18,0,114,0,3,0,1,4,9,0,6,0,2,0,144,0,46,0,0,46,0,0,46,0,0,46,0,0,46,0,0,46,0,0,70,0,111,0,110,0,116,0,70,0,111,0,114,0,103,0,101,0,
|
||||
32,0,50,0,46,0,48,0,32,0,58,0,32,0,46,0,32,0,58,0,32,0,49,0,49,0,45,0,50,0,45,0,50,0,48,0,50,0,54,0,0,70,111,110,116,70,111,114,103,101,32,50,46,48,32,58,32,46,32,58,32,49,49,45,50,
|
||||
45,50,48,50,54,0,0,46,0,0,46,0,0,86,0,101,0,114,0,115,0,105,0,111,0,110,0,32,0,46,0,0,86,101,114,115,105,111,110,32,46,0,0,46,0,0,46,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,192,0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15,0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,0,27,0,28,0,29,0,30,0,31,0,32,0,
|
||||
33,0,34,0,35,0,36,0,37,0,38,0,39,0,40,0,41,0,42,0,43,0,44,0,45,0,46,0,47,0,48,0,49,0,50,0,51,0,52,0,53,0,54,0,55,0,56,0,57,0,58,0,59,0,60,0,61,0,62,0,63,0,64,0,65,0,66,0,67,0,68,0,
|
||||
69,0,70,0,71,0,72,0,73,0,74,0,75,0,76,0,77,0,78,0,79,0,80,0,81,0,82,0,83,0,84,0,85,0,86,0,87,0,88,0,89,0,90,0,91,0,92,0,93,0,94,1,2,0,96,0,97,1,3,0,163,0,132,0,133,0,189,0,150,0,232,
|
||||
0,134,0,142,0,139,0,157,0,169,0,138,1,4,0,131,0,147,0,242,0,243,0,141,0,151,0,136,0,195,0,222,0,241,0,158,0,170,0,245,0,244,0,246,0,162,0,173,0,201,0,199,0,174,0,98,0,99,0,144,0,100,
|
||||
0,203,0,101,0,200,0,202,0,207,0,204,0,205,0,206,0,233,0,102,0,211,0,209,0,175,0,103,0,240,0,145,0,214,0,212,0,213,0,104,0,235,0,237,0,137,0,106,0,105,0,107,0,109,0,108,0,110,0,160,
|
||||
0,111,0,113,0,112,0,114,0,115,0,117,0,116,0,118,0,119,0,234,0,120,0,122,0,121,0,123,0,125,0,124,0,184,0,161,0,127,0,126,0,128,0,129,0,236,0,238,0,186,1,5,11,118,101,114,116,105,99,
|
||||
97,108,98,97,114,7,117,110,105,48,48,56,53,9,111,118,101,114,115,99,111,114,101,4,69,117,114,111,0,0,0,0,0,0,1,255,255,0,2,0,1,0,0,0,12,0,0,0,22,0,0,0,2,0,1,0,98,0,98,0,1,0,4,0,0,0,
|
||||
2,0,0,0,0,0,0,0,1,0,0,0,0,229,13,183,147,0,0,0,0,229,175,187,66,0,0,0,0,229,178,59,232,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
const unsigned char* GetFontBytes( int* outSize )
|
||||
{
|
||||
if ( outSize != NULL )
|
||||
{
|
||||
*outSize = (int)ProggyForeverMinimal_size;
|
||||
}
|
||||
|
||||
return ProggyForeverMinimal_data;
|
||||
}
|
||||
|
||||
const char* GetFontName( void )
|
||||
{
|
||||
return "Proggy Forever";
|
||||
}
|
||||
20
samples/gfx/fonts.h
Normal file
20
samples/gfx/fonts.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// SPDX-FileCopyrightText: 2026 Erin Catto
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
// TTF bytes, valid for the life of the program. Covers printable ASCII, which
|
||||
// is all the samples emit. Anything outside that draws as '?'.
|
||||
const unsigned char* GetFontBytes( int* outSize );
|
||||
|
||||
// Short name for the ImGui atlas and logs.
|
||||
const char* GetFontName( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
|
@ -26,6 +26,8 @@ enum
|
|||
KEY_V = SAPP_KEYCODE_V,
|
||||
KEY_W = SAPP_KEYCODE_W,
|
||||
KEY_SPACE = SAPP_KEYCODE_SPACE,
|
||||
KEY_COMMA = SAPP_KEYCODE_COMMA,
|
||||
KEY_PERIOD = SAPP_KEYCODE_PERIOD,
|
||||
KEY_ESCAPE = SAPP_KEYCODE_ESCAPE,
|
||||
KEY_TAB = SAPP_KEYCODE_TAB,
|
||||
KEY_LEFT_SHIFT = SAPP_KEYCODE_LEFT_SHIFT,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "gfx/sky.h"
|
||||
#include "gfx/text.h"
|
||||
#include "gfx/tone_map.h"
|
||||
#include "gfx/world_text.h"
|
||||
#include "shadow_caster_capsule.glsl.h"
|
||||
#include "shadow_caster_cube.glsl.h"
|
||||
#include "shadow_caster_geom.glsl.h"
|
||||
|
|
@ -1214,6 +1215,7 @@ void InitRenderer( const sg_environment* env )
|
|||
HighlightMaskInit();
|
||||
InitHighlightOutline();
|
||||
OverlayInit();
|
||||
WorldTextInit();
|
||||
s_gfx.swapchainColorFormat = env->defaults.color_format;
|
||||
|
||||
s_gfx.sun.dirToSun = b3Normalize( (b3Vec3){ 0.5f, 0.8f, 0.4f } );
|
||||
|
|
@ -2662,6 +2664,12 @@ void RenderFrame( const sg_swapchain* swapChain, const FrameInput* frame )
|
|||
frame->cameraPosition, frame->time, GetLinearDepthSampleView(), GetAOLinearSampler(), swapChain->color_format,
|
||||
swapChain->depth_format );
|
||||
sg_pop_debug_group();
|
||||
// World labels ride the same pass as the overlays, after them so a label
|
||||
// reads on top of the primitive it names.
|
||||
sg_push_debug_group( "world_text" );
|
||||
WorldTextSubmit( swapChain->width, swapChain->height, &frame->view, &frame->viewInv, &frame->proj, &frame->projInv,
|
||||
frame->cameraPosition, frame->time, swapChain->color_format, swapChain->depth_format );
|
||||
sg_pop_debug_group();
|
||||
sg_end_pass();
|
||||
sg_pop_debug_group();
|
||||
|
||||
|
|
@ -2724,6 +2732,10 @@ void RenderFrameOffscreen( const sg_attachments* attachments, sg_pixel_format ou
|
|||
OverlaySubmit( width, height, &frame->view, &frame->viewInv, &frame->proj, &frame->projInv, frame->cameraPosition,
|
||||
frame->time, GetLinearDepthSampleView(), GetAOLinearSampler(), outputFormat, SG_PIXELFORMAT_NONE );
|
||||
sg_pop_debug_group();
|
||||
sg_push_debug_group( "world_text" );
|
||||
WorldTextSubmit( width, height, &frame->view, &frame->viewInv, &frame->proj, &frame->projInv, frame->cameraPosition,
|
||||
frame->time, outputFormat, SG_PIXELFORMAT_NONE );
|
||||
sg_pop_debug_group();
|
||||
sg_end_pass();
|
||||
sg_pop_debug_group();
|
||||
|
||||
|
|
@ -2837,6 +2849,7 @@ int GetCubeProxyIndexCount( void )
|
|||
void ShutdownRenderer( void )
|
||||
{
|
||||
OverlayShutdown();
|
||||
WorldTextShutdown();
|
||||
ShutdownHighlightOutline();
|
||||
HighlightMaskShutdown();
|
||||
ShutdownHighlightTarget();
|
||||
|
|
|
|||
523
samples/gfx/world_text.c
Normal file
523
samples/gfx/world_text.c
Normal file
|
|
@ -0,0 +1,523 @@
|
|||
// SPDX-FileCopyrightText: 2026 Erin Catto
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#if defined( _MSC_VER ) && !defined( _CRT_SECURE_NO_WARNINGS )
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#include "gfx/world_text.h"
|
||||
|
||||
#include "gfx/fonts.h"
|
||||
#include "gfx/text.h"
|
||||
#include "world_text.glsl.h"
|
||||
|
||||
#define STB_TRUETYPE_IMPLEMENTATION
|
||||
#include "stb_truetype.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <sokol_app.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// Printable ASCII. Labels are numbers, ids and short type names, so this
|
||||
// range covers everything the samples emit. Anything outside draws as '?'.
|
||||
#define FIRST_CHAR 32
|
||||
#define CHAR_COUNT 95
|
||||
|
||||
// Distance range carried around each outline, in pixels. The halo fades inside
|
||||
// it, so this bounds how far the fade can reach.
|
||||
#define SDF_PADDING 4
|
||||
#define SDF_ONEDGE 128
|
||||
|
||||
// One transparent column and row between packed glyphs so a bilinear tap at
|
||||
// a glyph edge cannot reach its neighbour.
|
||||
#define GLYPH_GAP 1
|
||||
|
||||
#define ATLAS_DIM 512
|
||||
|
||||
// 1024 labels of 32 characters, matching text.c's label cap. Overflow drops
|
||||
// glyphs rather than growing.
|
||||
#define MAX_GLYPHS 32768
|
||||
|
||||
// The swap chain (color + depth) and the color-only offscreen test target.
|
||||
// Mirrors overlay.c's cache.
|
||||
#define TEXT_MAX_PIPELINES 2
|
||||
|
||||
// Pen-relative glyph box and atlas window. The box is in pixels and whole, so a
|
||||
// quad placed at a whole pixel covers its atlas cell one texel to one pixel. The
|
||||
// advance stays fractional: rounding every advance instead of every origin would
|
||||
// drift the whole word.
|
||||
typedef struct Glyph
|
||||
{
|
||||
float x0, y0, x1, y1; // origin at the top left of the line box, Y down
|
||||
float u0, v0, u1, v1;
|
||||
float advance;
|
||||
} Glyph;
|
||||
|
||||
static struct
|
||||
{
|
||||
Glyph glyphs[CHAR_COUNT];
|
||||
|
||||
// Built from scratch inside each submit rather than accumulated across the
|
||||
// frame, so a flat array beats the arena the overlay needs.
|
||||
world_text_glyph_instance_t* instances;
|
||||
int glyphCount;
|
||||
|
||||
sg_shader shader;
|
||||
sg_image atlas;
|
||||
sg_view atlasView;
|
||||
sg_sampler atlasSampler;
|
||||
|
||||
sg_buffer instBuf;
|
||||
sg_view instView;
|
||||
|
||||
struct
|
||||
{
|
||||
sg_pixel_format colorFormat;
|
||||
sg_pixel_format depthFormat;
|
||||
sg_pipeline pipeline;
|
||||
} pipelines[TEXT_MAX_PIPELINES];
|
||||
int pipelineCount;
|
||||
|
||||
float pixelHeight;
|
||||
float haloPixels;
|
||||
|
||||
bool ready;
|
||||
} s_text;
|
||||
|
||||
// Rasterize printable ASCII into one RG8 atlas and fill the glyph table. R is a
|
||||
// coverage bitmap, G a distance field, both from the same outlines at the same
|
||||
// scale so they agree on where the edge is.
|
||||
//
|
||||
// The bake tracks the size labels draw at, which is what buys the glyph body its
|
||||
// crispness: a coverage bitmap sampled one texel to one pixel is exactly what a
|
||||
// UI font renderer puts on screen, and no distance field reproduces that at 14
|
||||
// pixels because it cannot grid fit. The halo has no such constraint, so it
|
||||
// keeps the field, which is smooth at any size and gives a fade for free.
|
||||
//
|
||||
// Packing is a shelf: glyphs from a single bake size have near-uniform heights,
|
||||
// so rows waste little and this stands in for a real rect packer.
|
||||
static bool BakeAtlas( void )
|
||||
{
|
||||
int fontSize = 0;
|
||||
const unsigned char* fontData = GetFontBytes( &fontSize );
|
||||
|
||||
stbtt_fontinfo font;
|
||||
if ( stbtt_InitFont( &font, fontData, stbtt_GetFontOffsetForIndex( fontData, 0 ) ) == 0 )
|
||||
{
|
||||
fprintf( stderr, "[world_text] stbtt_InitFont failed on %d embedded bytes of %s\n", fontSize, GetFontName() );
|
||||
return false;
|
||||
}
|
||||
|
||||
// ScaleForPixelHeight makes ascent-to-descent exactly the label height.
|
||||
const float scale = stbtt_ScaleForPixelHeight( &font, s_text.pixelHeight );
|
||||
int ascent, descent, lineGap;
|
||||
stbtt_GetFontVMetrics( &font, &ascent, &descent, &lineGap );
|
||||
|
||||
// Whole pixels, so a glyph box stays whole and lands on the pixel grid. A
|
||||
// fractional baseline would put every horizontal stroke between two rows.
|
||||
const float ascentPixels = floorf( (float)ascent * scale + 0.5f );
|
||||
|
||||
unsigned char* atlas = (unsigned char*)calloc( (size_t)ATLAS_DIM * ATLAS_DIM * 2, 1 );
|
||||
if ( atlas == NULL )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const float invDim = 1.0f / (float)ATLAS_DIM;
|
||||
const float distanceScale = (float)SDF_ONEDGE / (float)SDF_PADDING;
|
||||
|
||||
int penX = 0;
|
||||
int penY = 0;
|
||||
int shelfHeight = 0;
|
||||
bool ok = true;
|
||||
|
||||
for ( int i = 0; i < CHAR_COUNT; ++i )
|
||||
{
|
||||
const int codepoint = FIRST_CHAR + i;
|
||||
Glyph* glyph = &s_text.glyphs[i];
|
||||
memset( glyph, 0, sizeof( *glyph ) );
|
||||
|
||||
int advance, leftBearing;
|
||||
stbtt_GetCodepointHMetrics( &font, codepoint, &advance, &leftBearing );
|
||||
glyph->advance = (float)advance * scale;
|
||||
|
||||
int w = 0, h = 0, xoff = 0, yoff = 0;
|
||||
unsigned char* sdf =
|
||||
stbtt_GetCodepointSDF( &font, scale, codepoint, SDF_PADDING, SDF_ONEDGE, distanceScale, &w, &h, &xoff, &yoff );
|
||||
if ( sdf == NULL )
|
||||
{
|
||||
// Space and friends carry an advance but no outline.
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( penX + w > ATLAS_DIM )
|
||||
{
|
||||
penX = 0;
|
||||
penY += shelfHeight;
|
||||
shelfHeight = 0;
|
||||
}
|
||||
if ( penY + h > ATLAS_DIM )
|
||||
{
|
||||
fprintf( stderr, "[world_text] atlas full at codepoint %d, raise ATLAS_DIM or lower the label size\n", codepoint );
|
||||
stbtt_FreeSDF( sdf, NULL );
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
|
||||
for ( int row = 0; row < h; ++row )
|
||||
{
|
||||
unsigned char* dst = atlas + ( (size_t)( penY + row ) * ATLAS_DIM + penX ) * 2;
|
||||
const unsigned char* src = sdf + (size_t)row * w;
|
||||
for ( int col = 0; col < w; ++col )
|
||||
{
|
||||
dst[col * 2 + 1] = src[col];
|
||||
}
|
||||
}
|
||||
|
||||
// The coverage bitmap shares the cell. stb derives both boxes from the
|
||||
// same glyph box and only the field pads it, so the offsets differ by
|
||||
// exactly the padding, but take it from the reported corners anyway.
|
||||
int bw = 0, bh = 0, bxoff = 0, byoff = 0;
|
||||
unsigned char* bitmap = stbtt_GetCodepointBitmap( &font, scale, scale, codepoint, &bw, &bh, &bxoff, &byoff );
|
||||
if ( bitmap != NULL )
|
||||
{
|
||||
const int insetX = bxoff - xoff;
|
||||
const int insetY = byoff - yoff;
|
||||
for ( int row = 0; row < bh; ++row )
|
||||
{
|
||||
const int y = insetY + row;
|
||||
if ( y < 0 || y >= h )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
unsigned char* dst = atlas + ( (size_t)( penY + y ) * ATLAS_DIM + penX ) * 2;
|
||||
const unsigned char* src = bitmap + (size_t)row * bw;
|
||||
for ( int col = 0; col < bw; ++col )
|
||||
{
|
||||
const int x = insetX + col;
|
||||
if ( x >= 0 && x < w )
|
||||
{
|
||||
dst[x * 2] = src[col];
|
||||
}
|
||||
}
|
||||
}
|
||||
stbtt_FreeBitmap( bitmap, NULL );
|
||||
}
|
||||
|
||||
// stb reports the box against the baseline with Y down. Shift it to
|
||||
// the top of the line box so an anchor lands where ImGui put it, and
|
||||
// existing call sites that pad with leading spaces still read right.
|
||||
glyph->x0 = (float)xoff;
|
||||
glyph->y0 = (float)yoff + ascentPixels;
|
||||
glyph->x1 = (float)( xoff + w );
|
||||
glyph->y1 = (float)yoff + ascentPixels + (float)h;
|
||||
|
||||
glyph->u0 = (float)penX * invDim;
|
||||
glyph->v0 = (float)penY * invDim;
|
||||
glyph->u1 = (float)( penX + w ) * invDim;
|
||||
glyph->v1 = (float)( penY + h ) * invDim;
|
||||
|
||||
penX += w + GLYPH_GAP;
|
||||
if ( h + GLYPH_GAP > shelfHeight )
|
||||
{
|
||||
shelfHeight = h + GLYPH_GAP;
|
||||
}
|
||||
|
||||
stbtt_FreeSDF( sdf, NULL );
|
||||
}
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
// A resize rebakes, so drop whatever the last size produced.
|
||||
if ( s_text.atlasView.id != 0 )
|
||||
{
|
||||
sg_destroy_view( s_text.atlasView );
|
||||
s_text.atlasView.id = 0;
|
||||
}
|
||||
if ( s_text.atlas.id != 0 )
|
||||
{
|
||||
sg_destroy_image( s_text.atlas );
|
||||
s_text.atlas.id = 0;
|
||||
}
|
||||
|
||||
sg_image_desc imgDesc = { 0 };
|
||||
imgDesc.width = ATLAS_DIM;
|
||||
imgDesc.height = ATLAS_DIM;
|
||||
imgDesc.num_mipmaps = 1;
|
||||
imgDesc.pixel_format = SG_PIXELFORMAT_RG8;
|
||||
imgDesc.data.mip_levels[0].ptr = atlas;
|
||||
imgDesc.data.mip_levels[0].size = (size_t)ATLAS_DIM * ATLAS_DIM * 2;
|
||||
imgDesc.label = "world_text_atlas";
|
||||
s_text.atlas = sg_make_image( &imgDesc );
|
||||
|
||||
sg_view_desc viewDesc = { 0 };
|
||||
viewDesc.texture.image = s_text.atlas;
|
||||
viewDesc.label = "world_text_atlas_view";
|
||||
s_text.atlasView = sg_make_view( &viewDesc );
|
||||
|
||||
if ( s_text.atlasSampler.id == 0 )
|
||||
{
|
||||
// Nearest would do for the body, which is sampled one texel to one
|
||||
// pixel, but the field wants filtering at the cell edges.
|
||||
sg_sampler_desc sampDesc = { 0 };
|
||||
sampDesc.min_filter = SG_FILTER_LINEAR;
|
||||
sampDesc.mag_filter = SG_FILTER_LINEAR;
|
||||
sampDesc.wrap_u = SG_WRAP_CLAMP_TO_EDGE;
|
||||
sampDesc.wrap_v = SG_WRAP_CLAMP_TO_EDGE;
|
||||
sampDesc.label = "world_text_atlas_sampler";
|
||||
s_text.atlasSampler = sg_make_sampler( &sampDesc );
|
||||
}
|
||||
}
|
||||
|
||||
free( atlas );
|
||||
return ok;
|
||||
}
|
||||
|
||||
// Lazily create (and cache) the pipeline for one output format pair, same
|
||||
// scheme and same blend state as overlay.c. Depth compare is ALWAYS with
|
||||
// writes off: a label is meant to be read, so it draws over whatever the
|
||||
// scene put in front of it.
|
||||
static bool EnsurePipeline( sg_pixel_format colorFormat, sg_pixel_format depthFormat, sg_pipeline* outPipeline )
|
||||
{
|
||||
for ( int i = 0; i < s_text.pipelineCount; ++i )
|
||||
{
|
||||
if ( s_text.pipelines[i].colorFormat == colorFormat && s_text.pipelines[i].depthFormat == depthFormat )
|
||||
{
|
||||
*outPipeline = s_text.pipelines[i].pipeline;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if ( s_text.pipelineCount >= TEXT_MAX_PIPELINES )
|
||||
{
|
||||
fprintf( stderr, "[world_text] pipeline cache exhausted (max %d format pairs)\n", TEXT_MAX_PIPELINES );
|
||||
return false;
|
||||
}
|
||||
|
||||
sg_pipeline_desc pdesc = { 0 };
|
||||
pdesc.shader = s_text.shader;
|
||||
// No VBO / no IBO, the VS expands six vertices per instance.
|
||||
pdesc.index_type = SG_INDEXTYPE_NONE;
|
||||
pdesc.cull_mode = SG_CULLMODE_NONE;
|
||||
pdesc.colors[0].pixel_format = colorFormat;
|
||||
pdesc.color_count = 1;
|
||||
// Premultiplied-alpha blend. The FS emits premultiplied color, which is
|
||||
// also what makes the halo work: alpha without color resolves to black.
|
||||
pdesc.colors[0].blend.enabled = true;
|
||||
pdesc.colors[0].blend.src_factor_rgb = SG_BLENDFACTOR_ONE;
|
||||
pdesc.colors[0].blend.dst_factor_rgb = SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA;
|
||||
pdesc.colors[0].blend.op_rgb = SG_BLENDOP_ADD;
|
||||
pdesc.colors[0].blend.src_factor_alpha = SG_BLENDFACTOR_ONE;
|
||||
pdesc.colors[0].blend.dst_factor_alpha = SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA;
|
||||
pdesc.colors[0].blend.op_alpha = SG_BLENDOP_ADD;
|
||||
pdesc.depth.pixel_format = depthFormat;
|
||||
pdesc.depth.compare = SG_COMPAREFUNC_ALWAYS;
|
||||
pdesc.depth.write_enabled = false;
|
||||
pdesc.sample_count = 1;
|
||||
pdesc.label = "world_text_pipeline";
|
||||
const sg_pipeline pipeline = sg_make_pipeline( &pdesc );
|
||||
|
||||
s_text.pipelines[s_text.pipelineCount].colorFormat = colorFormat;
|
||||
s_text.pipelines[s_text.pipelineCount].depthFormat = depthFormat;
|
||||
s_text.pipelines[s_text.pipelineCount].pipeline = pipeline;
|
||||
++s_text.pipelineCount;
|
||||
|
||||
*outPipeline = pipeline;
|
||||
return true;
|
||||
}
|
||||
|
||||
void WorldTextInit( void )
|
||||
{
|
||||
if ( s_text.ready )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
s_text.pixelHeight = floorf( 13.0f * sapp_dpi_scale() );
|
||||
s_text.haloPixels = 2.0f;
|
||||
|
||||
if ( BakeAtlas() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
s_text.instances = (world_text_glyph_instance_t*)malloc( (size_t)MAX_GLYPHS * sizeof( world_text_glyph_instance_t ) );
|
||||
if ( s_text.instances == NULL )
|
||||
{
|
||||
fprintf( stderr, "[world_text] failed to allocate glyph instances\n" );
|
||||
|
||||
// Clean up
|
||||
sg_destroy_sampler( s_text.atlasSampler );
|
||||
s_text.atlasSampler.id = 0;
|
||||
sg_destroy_view( s_text.atlasView );
|
||||
s_text.atlasView.id = 0;
|
||||
sg_destroy_image( s_text.atlas );
|
||||
s_text.atlas.id = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sg_buffer_desc bufDesc = { 0 };
|
||||
bufDesc.usage.storage_buffer = true;
|
||||
bufDesc.usage.stream_update = true;
|
||||
bufDesc.size = (size_t)MAX_GLYPHS * sizeof( world_text_glyph_instance_t );
|
||||
bufDesc.label = "world_text_glyph_instances";
|
||||
s_text.instBuf = sg_make_buffer( &bufDesc );
|
||||
|
||||
sg_view_desc instViewDesc = { 0 };
|
||||
instViewDesc.storage_buffer.buffer = s_text.instBuf;
|
||||
instViewDesc.label = "world_text_glyph_instances_view";
|
||||
s_text.instView = sg_make_view( &instViewDesc );
|
||||
|
||||
s_text.shader = sg_make_shader( world_text_prog_shader_desc( sg_query_backend() ) );
|
||||
|
||||
s_text.ready = true;
|
||||
}
|
||||
|
||||
void WorldTextShutdown( void )
|
||||
{
|
||||
if ( !s_text.ready )
|
||||
{
|
||||
return;
|
||||
}
|
||||
for ( int i = 0; i < s_text.pipelineCount; ++i )
|
||||
{
|
||||
sg_destroy_pipeline( s_text.pipelines[i].pipeline );
|
||||
s_text.pipelines[i].pipeline.id = 0;
|
||||
s_text.pipelines[i].colorFormat = SG_PIXELFORMAT_NONE;
|
||||
s_text.pipelines[i].depthFormat = SG_PIXELFORMAT_NONE;
|
||||
}
|
||||
s_text.pipelineCount = 0;
|
||||
sg_destroy_shader( s_text.shader );
|
||||
s_text.shader.id = 0;
|
||||
sg_destroy_view( s_text.instView );
|
||||
s_text.instView.id = 0;
|
||||
sg_destroy_buffer( s_text.instBuf );
|
||||
s_text.instBuf.id = 0;
|
||||
sg_destroy_sampler( s_text.atlasSampler );
|
||||
s_text.atlasSampler.id = 0;
|
||||
sg_destroy_view( s_text.atlasView );
|
||||
s_text.atlasView.id = 0;
|
||||
sg_destroy_image( s_text.atlas );
|
||||
s_text.atlas.id = 0;
|
||||
free( s_text.instances );
|
||||
s_text.instances = NULL;
|
||||
s_text.glyphCount = 0;
|
||||
s_text.ready = false;
|
||||
}
|
||||
|
||||
// Walk this frame's labels and lay each one out into glyph quads. Advances
|
||||
// accumulate along the pen, so a label's characters share an anchor and differ
|
||||
// only in their pen offset, which keeps the whole string bill-boarding as one.
|
||||
// The pen accumulates fractionally and each origin rounds off it, so spacing
|
||||
// stays true across a word while every glyph still starts on a whole pixel.
|
||||
static void BuildGlyphs( void )
|
||||
{
|
||||
s_text.glyphCount = 0;
|
||||
|
||||
const int count = GetTextCount();
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
const TextEntry* entry = GetTextAt( i );
|
||||
if ( entry->space != TEXT_SPACE_WORLD )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Vec4 color = entry->color;
|
||||
float pen = 0.0f;
|
||||
|
||||
for ( const char* p = entry->text; *p != '\0'; ++p )
|
||||
{
|
||||
int index = (unsigned char)*p - FIRST_CHAR;
|
||||
if ( index < 0 || index >= CHAR_COUNT )
|
||||
{
|
||||
index = '?' - FIRST_CHAR;
|
||||
}
|
||||
const Glyph* glyph = &s_text.glyphs[index];
|
||||
|
||||
// Space has an advance but no box, and nothing else should reach
|
||||
// the rasterizer with zero area either.
|
||||
if ( glyph->x1 > glyph->x0 && glyph->y1 > glyph->y0 )
|
||||
{
|
||||
if ( s_text.glyphCount >= MAX_GLYPHS )
|
||||
{
|
||||
return;
|
||||
}
|
||||
const float originX = floorf( pen + 0.5f );
|
||||
|
||||
world_text_glyph_instance_t* inst = &s_text.instances[s_text.glyphCount];
|
||||
inst->anchor = MakeVec4( entry->worldPos.x, entry->worldPos.y, entry->worldPos.z, 0.0f );
|
||||
inst->rect = MakeVec4( originX + glyph->x0, glyph->y0, glyph->x1 - glyph->x0, glyph->y1 - glyph->y0 );
|
||||
inst->uv = MakeVec4( glyph->u0, glyph->v0, glyph->u1, glyph->v1 );
|
||||
inst->color = color;
|
||||
s_text.glyphCount++;
|
||||
}
|
||||
|
||||
pen += glyph->advance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WorldTextSubmit( int width, int height, const Mat4* view, const Mat4* viewInv, const Mat4* proj, const Mat4* projInv,
|
||||
b3Vec3 cameraPos, float time, sg_pixel_format colorFormat, sg_pixel_format depthFormat )
|
||||
{
|
||||
if ( !s_text.ready )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BuildGlyphs();
|
||||
if ( s_text.glyphCount == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sg_pipeline pipeline = { 0 };
|
||||
if ( !EnsurePipeline( colorFormat, depthFormat, &pipeline ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const Mat4 view_proj = MulMM4( *proj, *view );
|
||||
// inv(P*V) = inv(V)*inv(P), see overlay.c for why both inverses arrive
|
||||
// prebuilt rather than being inverted here.
|
||||
const Mat4 inv_view_proj = MulMM4( *viewInv, *projInv );
|
||||
const float w = (float)width;
|
||||
const float h = (float)height;
|
||||
|
||||
world_text_ub_frame_t ub = { 0 };
|
||||
ub.view = *view;
|
||||
ub.proj = *proj;
|
||||
ub.view_proj = view_proj;
|
||||
ub.inv_view_proj = inv_view_proj;
|
||||
ub.camera_pos = MakeVec4( cameraPos.x, cameraPos.y, cameraPos.z, time );
|
||||
ub.viewport = MakeVec4( w, h, w > 0.0f ? 1.0f / w : 0.0f, h > 0.0f ? 1.0f / h : 0.0f );
|
||||
|
||||
// Halo width in pixels plus the distance one pixel spans, which the bake fixes
|
||||
// since the field is rasterized at the size it draws at. The field saturates
|
||||
// SDF_PADDING pixels out, so that is the ceiling on the fade.
|
||||
world_text_ub_text_style_t styleUb = { 0 };
|
||||
const float distancePerPixel = ( (float)SDF_ONEDGE / (float)SDF_PADDING ) / 255.0f;
|
||||
styleUb.style_params = MakeVec4( s_text.haloPixels, (float)SDF_ONEDGE / 255.0f, distancePerPixel, 0.0f );
|
||||
|
||||
// .w is strength at the glyph edge
|
||||
styleUb.halo_params = MakeVec4( 0.2f, 0.2f, 0.2f, 0.2f );
|
||||
|
||||
sg_range instanceRange;
|
||||
instanceRange.ptr = s_text.instances;
|
||||
instanceRange.size = (size_t)s_text.glyphCount * sizeof( world_text_glyph_instance_t );
|
||||
sg_update_buffer( s_text.instBuf, &instanceRange );
|
||||
|
||||
sg_apply_pipeline( pipeline );
|
||||
sg_bindings bindings = { 0 };
|
||||
bindings.views[VIEW_world_text_glyph_instances] = s_text.instView;
|
||||
bindings.views[VIEW_world_text_tex_sdf] = s_text.atlasView;
|
||||
bindings.samplers[SMP_world_text_smp_sdf] = s_text.atlasSampler;
|
||||
sg_apply_bindings( &bindings );
|
||||
sg_apply_uniforms( UB_world_text_ub_frame, &SG_RANGE( ub ) );
|
||||
sg_apply_uniforms( UB_world_text_ub_text_style, &SG_RANGE( styleUb ) );
|
||||
sg_draw( 0, 6, s_text.glyphCount );
|
||||
}
|
||||
57
samples/gfx/world_text.h
Normal file
57
samples/gfx/world_text.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
// SPDX-FileCopyrightText: 2026 Erin Catto
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// World-space text: rasterized glyphs over a distance field halo.
|
||||
//
|
||||
// Owns the glyph atlas, one pipeline, and a per-frame glyph instance arena.
|
||||
// Labels themselves are not submitted here: text.c already collects them via
|
||||
// DrawString, and this module drains the world-space ones at submit time and
|
||||
// turns each character into a quad. Screen-space labels stay with ImGui,
|
||||
// which is the right tool for something genuinely 2D.
|
||||
//
|
||||
// A label anchors at a world point but holds a fixed pixel height and ignores
|
||||
// scene depth, matching the ImGui labels it replaced. What this buys over those
|
||||
// is the halo and one draw call for the whole frame.
|
||||
//
|
||||
// The atlas bakes at init from the embedded TTF, two channels from one pass of
|
||||
// stb_truetype: coverage for the glyph body, a distance field for the halo. It
|
||||
// bakes at the size labels draw at, and the quads land on whole pixels, so the
|
||||
// body samples one texel to one pixel and reads as crisply as a UI font. A
|
||||
// distance field alone cannot manage that at 14 pixels, since resolving
|
||||
// coverage from it means a smoothstep across a good part of a stem and there is
|
||||
// no grid fitting to fall back on. Scale independence is no loss here: labels
|
||||
// are one fixed size, and a size change just rebakes.
|
||||
//
|
||||
// Pass placement matches overlay.c exactly: the renderer calls WorldTextSubmit
|
||||
// in the post-tone map pass, after tone map and the highlight outline.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gfx/utility.h"
|
||||
#include "sokol_gfx.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
// Bakes the glyph atlas from the embedded font, so labels do not depend on the
|
||||
// working directory. Logs and stays inert if the bake fails rather than taking
|
||||
// the whole app with it.
|
||||
void WorldTextInit( void );
|
||||
void WorldTextShutdown( void );
|
||||
|
||||
// Encode world label draws into the currently-open render pass. Called once
|
||||
// per frame from the post-tone map pass, after tone map + highlight outline.
|
||||
// No-op when no world labels were submitted this frame.
|
||||
//
|
||||
// Arguments match OverlaySubmit minus the depth pre-pass views, which labels
|
||||
// have no use for, see overlay.h for what each one carries.
|
||||
void WorldTextSubmit( int width, int height, const Mat4* view, const Mat4* viewInv, const Mat4* proj, const Mat4* projInv,
|
||||
b3Vec3 cameraPos, float time, sg_pixel_format colorFormat, sg_pixel_format depthFormat );
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
|
@ -192,6 +192,27 @@ void Camera::SetOrbit( float yawRadians, float pitchRadians, float radius )
|
|||
RebuildBasisAndView( *this );
|
||||
}
|
||||
|
||||
void Camera::SetTarget( b3Pos target )
|
||||
{
|
||||
// The sim->display map is a uniform scale plus an optional quarter turn, so apply it directly
|
||||
// rather than through the float matrix. In large world mode that keeps the range the pivot is
|
||||
// double for; a matrix multiply would round it away.
|
||||
const double s = 1.0 / m_lengthUnitsPerMeter;
|
||||
m_pivot.x = s * target.x;
|
||||
if ( m_zUp )
|
||||
{
|
||||
m_pivot.y = s * target.z;
|
||||
m_pivot.z = -s * target.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pivot.y = s * target.y;
|
||||
m_pivot.z = s * target.z;
|
||||
}
|
||||
|
||||
RebuildBasisAndView( *this );
|
||||
}
|
||||
|
||||
void Camera::SetView( float yawDegrees, float pitchDegrees, float radius, b3Pos pivot )
|
||||
{
|
||||
SetPivot( pivot );
|
||||
|
|
@ -322,6 +343,12 @@ void Camera::OnEvent( const sapp_event* e )
|
|||
case SAPP_KEYCODE_D:
|
||||
m_dDown = true;
|
||||
break;
|
||||
case SAPP_KEYCODE_Q:
|
||||
m_qDown = true;
|
||||
break;
|
||||
case SAPP_KEYCODE_E:
|
||||
m_eDown = true;
|
||||
break;
|
||||
case SAPP_KEYCODE_LEFT_ALT:
|
||||
case SAPP_KEYCODE_RIGHT_ALT:
|
||||
m_altDown = true;
|
||||
|
|
@ -345,6 +372,12 @@ void Camera::OnEvent( const sapp_event* e )
|
|||
case SAPP_KEYCODE_D:
|
||||
m_dDown = false;
|
||||
break;
|
||||
case SAPP_KEYCODE_Q:
|
||||
m_qDown = false;
|
||||
break;
|
||||
case SAPP_KEYCODE_E:
|
||||
m_eDown = false;
|
||||
break;
|
||||
case SAPP_KEYCODE_LEFT_ALT:
|
||||
case SAPP_KEYCODE_RIGHT_ALT:
|
||||
m_altDown = false;
|
||||
|
|
@ -363,6 +396,8 @@ void Camera::OnEvent( const sapp_event* e )
|
|||
m_aDown = false;
|
||||
m_sDown = false;
|
||||
m_dDown = false;
|
||||
m_qDown = false;
|
||||
m_eDown = false;
|
||||
m_altDown = false;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -425,6 +460,7 @@ void Camera::Update( float dt, int width, int height )
|
|||
|
||||
float wasdF = 0.0f; // +forward = backwards, since forward = pivot->eye
|
||||
float wasdR = 0.0f;
|
||||
float wasdU = 0.0f; // Q/E rise and fall, along world up rather than the view basis
|
||||
if ( m_wDown )
|
||||
wasdF -= 1.0f;
|
||||
if ( m_sDown )
|
||||
|
|
@ -433,9 +469,13 @@ void Camera::Update( float dt, int width, int height )
|
|||
wasdR += 1.0f;
|
||||
if ( m_aDown )
|
||||
wasdR -= 1.0f;
|
||||
if ( m_eDown )
|
||||
wasdU += 1.0f;
|
||||
if ( m_qDown )
|
||||
wasdU -= 1.0f;
|
||||
|
||||
b3Pos eye = eyeBefore;
|
||||
if ( wasdF != 0.0f || wasdR != 0.0f )
|
||||
if ( wasdF != 0.0f || wasdR != 0.0f || wasdU != 0.0f )
|
||||
{
|
||||
// Right = normalize(worldUp x forward), matching Box3D's
|
||||
// UpdateTransform. worldUp = (0,1,0).
|
||||
|
|
@ -449,9 +489,9 @@ void Camera::Update( float dt, int width, int height )
|
|||
right.z /= rlen;
|
||||
}
|
||||
const float step = m_speed * dt;
|
||||
eye.x += forward.x * wasdF * step + right.x * wasdR * step;
|
||||
eye.y += forward.y * wasdF * step + right.y * wasdR * step;
|
||||
eye.z += forward.z * wasdF * step + right.z * wasdR * step;
|
||||
eye.x += forward.x * wasdF * step + right.x * wasdR * step + worldUp.x * wasdU * step;
|
||||
eye.y += forward.y * wasdF * step + right.y * wasdR * step + worldUp.y * wasdU * step;
|
||||
eye.z += forward.z * wasdF * step + right.z * wasdR * step + worldUp.z * wasdU * step;
|
||||
}
|
||||
|
||||
// Back-derive the pivot so Position() stays consistent and a return
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
// FLY (right mouse held, no Alt)
|
||||
// right-drag : FPS look (yaw/pitch the view direction)
|
||||
// WASD : translate eye along view forward/right at m_speed
|
||||
// QE : translate eye along world down/up at m_speed
|
||||
// scroll : tune m_speed
|
||||
//
|
||||
// Always
|
||||
|
|
@ -112,11 +113,12 @@ public:
|
|||
{
|
||||
m_pivot = pivot;
|
||||
}
|
||||
|
||||
void SetTarget( b3Pos target )
|
||||
{
|
||||
m_pivot = target;
|
||||
}
|
||||
|
||||
// Aim at a point given in simulation space: length units and the simulation up axis, mapped
|
||||
// into the display frame the pivot lives in, then the transform refreshed. Follow cams read
|
||||
// positions straight from the world, so they land here. Counterpart to DrawOrigin, which maps
|
||||
// the eye back the other way. SetPivot takes a point already in display space.
|
||||
void SetTarget( b3Pos target );
|
||||
|
||||
// Frame an AABB: keep current yaw/pitch, move pivot to the AABB center,
|
||||
// and refit radius so the AABB fits in view at the current FOV+aspect.
|
||||
|
|
@ -252,4 +254,6 @@ public:
|
|||
bool m_aDown = false;
|
||||
bool m_sDown = false;
|
||||
bool m_dDown = false;
|
||||
bool m_qDown = false;
|
||||
bool m_eDown = false;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@
|
|||
#include "gui.h"
|
||||
|
||||
#include "gfx/draw.h"
|
||||
#include "gfx/fonts.h"
|
||||
#include "gfx/projection.h"
|
||||
#include "gfx/renderer.h"
|
||||
#include "gfx/text.h"
|
||||
#include "gfx/world_text.h"
|
||||
#include "imgui.h"
|
||||
#include "implot.h"
|
||||
#include "sokol_app.h"
|
||||
|
|
@ -135,7 +137,6 @@ void InitUI( const sg_environment* env, DrawUiFcn* drawGuiFcn )
|
|||
desc.sample_count = env->defaults.sample_count;
|
||||
desc.ini_filename = "imgui.ini";
|
||||
desc.logger.func = slog_func;
|
||||
// Skip ImGui's auto-pick so we always get the vector font we add below.
|
||||
desc.no_default_font = true;
|
||||
simgui_setup( &desc );
|
||||
|
||||
|
|
@ -168,9 +169,9 @@ void InitUI( const sg_environment* env, DrawUiFcn* drawGuiFcn )
|
|||
style.ScaleAllSizes( s_uiScale );
|
||||
}
|
||||
|
||||
// 13px base for the proportional UI font, scaled to a whole physical
|
||||
// pixel. Rasterizer density is 1.0 (DisplayFramebufferScale 1.0), so the
|
||||
// atlas bakes at exactly this - floorf keeps it on a whole-pixel size.
|
||||
// 13px base, scaled to a whole physical pixel. Rasterizer density is 1.0
|
||||
// (DisplayFramebufferScale 1.0), so the atlas bakes at exactly this -
|
||||
// floorf keeps it on a whole-pixel size.
|
||||
style.FontSizeBase = floorf( 13.0f * s_uiScale );
|
||||
|
||||
s_uiInitialized = true;
|
||||
|
|
@ -288,12 +289,11 @@ void EndPanel( void )
|
|||
}
|
||||
|
||||
// Text overlay. Drain the per-frame label arena (filled by DrawString /
|
||||
// DrawScreenString and the Box3D adapter's DrawString callback). World
|
||||
// entries project to screen pixels with the last rendered camera, screen
|
||||
// entries pass through their pixel position, and both emit into ImGui's
|
||||
// background draw list - labels sit on the scene but under any ImGui
|
||||
// windows. The drain runs in StartUIFrame because the calling app
|
||||
// guarantees RenderFrame already ran this frame, so GetCameraState
|
||||
// DrawScreenString and the Box3D adapter's DrawString callback). Screen
|
||||
// entries pass through their pixel position into ImGui's background draw
|
||||
// list, so labels sit on the scene but under any ImGui windows. World
|
||||
// entries belong to the SDF pass. The drain runs in StartUIFrame because the calling
|
||||
// app guarantees RenderFrame already ran this frame, so GetCameraState
|
||||
// returns the matrices the scene was actually rasterized with.
|
||||
static void RenderText()
|
||||
{
|
||||
|
|
@ -321,6 +321,11 @@ static void RenderText()
|
|||
for ( int i = 0; i < n; ++i )
|
||||
{
|
||||
const TextEntry* e = GetTextAt( i );
|
||||
if ( e->space == TEXT_SPACE_WORLD )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float sx, sy;
|
||||
if ( !ResolveTextScreenPos( e, cam.view, cam.proj, vpW, vpH, &sx, &sy ) )
|
||||
{
|
||||
|
|
@ -336,8 +341,12 @@ static void RenderText()
|
|||
v = 1.0f;
|
||||
return (uint32_t)( v * 255.0f + 0.5f );
|
||||
};
|
||||
const uint32_t col = IM_COL32( byte( e->color.x ), byte( e->color.y ), byte( e->color.z ), byte( e->color.w ) );
|
||||
dl->AddText( nullptr, 0.0f, ImVec2( origin.x + sx, origin.y + sy ), col, e->text );
|
||||
const uint32_t alpha = byte( e->color.w );
|
||||
const uint32_t col = IM_COL32( byte( e->color.x ), byte( e->color.y ), byte( e->color.z ), alpha );
|
||||
|
||||
const float x = origin.x + sx;
|
||||
const float y = origin.y + sy;
|
||||
dl->AddText( nullptr, 0.0f, ImVec2( x, y ), col, e->text );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ static void OnInit( void )
|
|||
#if defined( _WIN32 )
|
||||
timeBeginPeriod( 1 );
|
||||
#endif
|
||||
|
||||
const sg_environment env = sglue_environment();
|
||||
InitRenderer( &env );
|
||||
InitUI( &env, OnDrawUI );
|
||||
|
|
@ -214,11 +213,15 @@ static void OnEvent( const sapp_event* e )
|
|||
// Ctrl+O opens the fuzzy picker. Force the UI visible so it shows.
|
||||
s_context.showUI = true;
|
||||
s_context.openSamplePicker = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
s_context.singleStep += ( mods & SAPP_MODIFIER_SHIFT ) ? 5 : 1;
|
||||
}
|
||||
s_context.sample->Keyboard( e->key_code, ACTION_PRESS, mods );
|
||||
break;
|
||||
|
||||
// Step forward. Backward is , and only a sample that can rewind
|
||||
// handles it, so that key falls through to the sample.
|
||||
case KEY_PERIOD:
|
||||
s_context.singleStep += ( mods & SAPP_MODIFIER_SHIFT ) ? 5 : 1;
|
||||
break;
|
||||
|
||||
case SAPP_KEYCODE_P:
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include "gfx/renderer.h"
|
||||
#include "gfx/shadow.h"
|
||||
#include "gfx/text.h"
|
||||
#include "host/gui.h"
|
||||
#include "human.h"
|
||||
#include "imgui.h"
|
||||
#include "implot.h"
|
||||
|
|
@ -1597,7 +1598,7 @@ static void DrawMenuBar( SampleContext* context )
|
|||
if ( ImGui::BeginMenu( "Sim" ) )
|
||||
{
|
||||
ImGui::MenuItem( "Pause", "P", &context->pause );
|
||||
if ( ImGui::MenuItem( "Single Step", "O" ) )
|
||||
if ( ImGui::MenuItem( "Single Step", "." ) )
|
||||
{
|
||||
context->singleStep += 1;
|
||||
}
|
||||
|
|
@ -1769,7 +1770,8 @@ static void DrawMenuBar( SampleContext* context )
|
|||
DrawRow( "Tab", "Show / hide UI" );
|
||||
DrawRow( "M", "Show / hide diagnostics" );
|
||||
DrawRow( "P", "Pause / resume" );
|
||||
DrawRow( "O", "Single step (Shift: 5)" );
|
||||
DrawRow( ".", "Single step (Shift: 5)" );
|
||||
DrawRow( ",", "Step back, replay only (Shift: 5)" );
|
||||
DrawRow( "R", "Restart sample" );
|
||||
DrawRow( "[ ]", "Previous / next sample" );
|
||||
DrawRow( "Ctrl+O", "Open sample picker" );
|
||||
|
|
@ -1788,7 +1790,7 @@ static void DrawMenuBar( SampleContext* context )
|
|||
DrawRow( "Alt + left drag", "Orbit camera" );
|
||||
DrawRow( "Alt + middle drag", "Pan camera" );
|
||||
DrawRow( "Alt + right drag", "Zoom (dolly)" );
|
||||
DrawRow( "Right drag", "Fly look (WASD to move)" );
|
||||
DrawRow( "Right drag", "Fly look (WASD, Q / E to move)" );
|
||||
DrawRow( "Scroll", "Zoom" );
|
||||
DrawRow( "Shift + left", "Shoot (Ctrl spin, Alt ragdoll)" );
|
||||
ImGui::EndTable();
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ public:
|
|||
b3Quat quat = b3Body_GetRotation( m_topId );
|
||||
b3Vec3 axis = b3RotateVector( quat, b3Vec3_axisY );
|
||||
b3Vec3 omega = b3Body_GetAngularVelocity( m_topId );
|
||||
float spin = b3Dot( omega , axis );
|
||||
float spin = b3Dot( omega, axis );
|
||||
float cosTilt = b3ClampFloat( axis.y, -1.0f, 1.0f );
|
||||
float expected = ExpectedRate( spin, cosTilt );
|
||||
|
||||
|
|
@ -1180,3 +1180,99 @@ public:
|
|||
};
|
||||
|
||||
static int sampleFixedRotation = RegisterSample( "Bodies", "Fixed Rotation", FixedRotation::Create );
|
||||
|
||||
// A spinning class ring flips its heavy gem from bottom to top, like this video:
|
||||
// https://www.youtube.com/watch?v=_up0BiLCliA
|
||||
// This is a fiddley test and requires careful tuning.
|
||||
class ClassRing : public Sample
|
||||
{
|
||||
public:
|
||||
explicit ClassRing( SampleContext* context )
|
||||
: Sample( context )
|
||||
{
|
||||
if ( context->restart == false )
|
||||
{
|
||||
m_camera->SetView( 40.0f, 30.0f, 15.0f, { 0.0f, 2.0f, 0.0f } );
|
||||
}
|
||||
|
||||
AddGroundBox( 100.0f );
|
||||
|
||||
constexpr int n = 24;
|
||||
constexpr float r = 1.0f;
|
||||
constexpr float tubeRadius = 0.1f * r;
|
||||
constexpr float axisRadius = r - tubeRadius;
|
||||
|
||||
b3BodyDef bodyDef = b3DefaultBodyDef();
|
||||
bodyDef.type = b3_dynamicBody;
|
||||
bodyDef.position = { 0.0f, r, 0.0f };
|
||||
bodyDef.rotation = b3MakeQuatFromAxisAngle( b3Vec3_axisX, 13.0f * B3_PI / 180.0f );
|
||||
bodyDef.allowFastRotation = true;
|
||||
bodyDef.enableContactRecycling = false;
|
||||
b3BodyId bodyId = b3CreateBody( m_worldId, &bodyDef );
|
||||
|
||||
b3ShapeDef shapeDef = b3DefaultShapeDef();
|
||||
shapeDef.density = 1.0f;
|
||||
|
||||
// Band built from a loop of capsules.
|
||||
b3Vec3 vertices[n];
|
||||
float deltaAngle = 2.0f * B3_PI / n;
|
||||
b3CosSin cs = b3ComputeCosSin( deltaAngle );
|
||||
float x = axisRadius, y = 0.0f;
|
||||
for ( int i = 0; i < n; ++i )
|
||||
{
|
||||
vertices[i] = { x, y, 0.0f };
|
||||
float x2 = cs.cosine * x - cs.sine * y;
|
||||
float y2 = cs.sine * x + cs.cosine * y;
|
||||
x = x2;
|
||||
y = y2;
|
||||
}
|
||||
|
||||
for ( int i = 0; i < n; ++i )
|
||||
{
|
||||
b3Capsule capsule = { vertices[i], vertices[( i + 1 ) % n], tubeRadius };
|
||||
b3CreateCapsuleShape( bodyId, &shapeDef, &capsule );
|
||||
}
|
||||
|
||||
// Heavy gem provides the mass asymmetry that drives the inversion
|
||||
shapeDef.density = 2.0f;
|
||||
b3Sphere sphere = { .center = { 0.0f, -0.65f * r, 0.0f }, .radius = 0.3f };
|
||||
b3CreateSphereShape( bodyId, &shapeDef, &sphere );
|
||||
|
||||
b3Vec3 angularVelocity = b3RotateVector( bodyDef.rotation, { 0.0f, 100.0f, 0.0f } );
|
||||
b3Body_SetAngularVelocity( bodyId, angularVelocity );
|
||||
|
||||
m_ringId = bodyId;
|
||||
}
|
||||
|
||||
void Step() override
|
||||
{
|
||||
// This needs a high simulation rate so that contact points keep up with the high speed rotation.
|
||||
float hertz = m_context->hertz;
|
||||
int subStepCount = m_context->subStepCount;
|
||||
|
||||
// 960Hz simulation
|
||||
int multiplier = 16;
|
||||
m_context->hertz = multiplier * 60.0f;
|
||||
m_context->subStepCount = 8;
|
||||
|
||||
// Multiple hidden steps to keep the render real-time.
|
||||
for ( int i = 0; i < multiplier - 1; ++i )
|
||||
{
|
||||
b3World_Step( m_worldId, 1.0f / m_context->hertz, m_context->subStepCount );
|
||||
}
|
||||
|
||||
Sample::Step();
|
||||
|
||||
m_context->hertz = hertz;
|
||||
m_context->subStepCount = subStepCount;
|
||||
}
|
||||
|
||||
static Sample* Create( SampleContext* context )
|
||||
{
|
||||
return new ClassRing( context );
|
||||
}
|
||||
|
||||
b3BodyId m_ringId;
|
||||
};
|
||||
|
||||
static int sampleClassRing = RegisterSample( "Bodies", "Class Ring", ClassRing::Create );
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "gfx/debug_adapter.h"
|
||||
#include "gfx/draw.h"
|
||||
#include "gfx/keycodes.h"
|
||||
#include "gfx/text.h"
|
||||
#include "imgui.h"
|
||||
#include "sample.h"
|
||||
|
|
@ -240,6 +241,7 @@ public:
|
|||
m_hoverQuery = -1;
|
||||
m_revealSelection = false;
|
||||
m_drawAllQueries = false;
|
||||
m_followSelection = false;
|
||||
m_queryIndexBuilt = false;
|
||||
m_querySearch[0] = '\0';
|
||||
m_querySearchKind = 0;
|
||||
|
|
@ -510,6 +512,37 @@ public:
|
|||
m_replayWorldId = b3RecPlayer_GetWorldId( m_player );
|
||||
}
|
||||
|
||||
// Jump to a recorded frame. Rewinds through the nearest keyframe, so a backward hop costs the
|
||||
// re-simulation from there.
|
||||
void SeekTo( int frame )
|
||||
{
|
||||
b3RecPlayer_SeekFrame( m_player, frame );
|
||||
m_replayWorldId = b3RecPlayer_GetWorldId( m_player );
|
||||
m_frameAccumulator = 0.0f;
|
||||
}
|
||||
|
||||
// , steps backward. Forward is the global single step on . so it works in every sample, and the
|
||||
// step count lands in the context. Shift moves five frames, matching that key.
|
||||
void Keyboard( int key, int action, int mods ) override
|
||||
{
|
||||
if ( m_generating )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_player == nullptr || action != ACTION_PRESS || ( mods & ( MOD_CTRL | MOD_ALT ) ) != 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( key == KEY_COMMA )
|
||||
{
|
||||
int back = ( mods & MOD_SHIFT ) ? 5 : 1;
|
||||
SeekTo( b3RecPlayer_GetFrame( m_player ) - back );
|
||||
m_context->pause = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Step() override
|
||||
{
|
||||
SetDrawOrigin( m_camera->DrawOrigin() );
|
||||
|
|
@ -524,9 +557,11 @@ public:
|
|||
|
||||
if ( m_player != nullptr )
|
||||
{
|
||||
if ( m_context->pause && m_context->singleStep > 0 )
|
||||
if ( m_context->singleStep > 0 )
|
||||
{
|
||||
// Stepping takes over from playback, like the transport buttons.
|
||||
m_context->singleStep = b3MaxInt( 0, m_context->singleStep - 1 );
|
||||
m_context->pause = true;
|
||||
if ( b3RecPlayer_IsAtEnd( m_player ) == false )
|
||||
{
|
||||
AdvanceOne( m_subStepOnCreate );
|
||||
|
|
@ -567,6 +602,13 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
// Retarget after the frame advances so the follow reads the pose about to be drawn, and before
|
||||
// the cull box below is taken, since both it and the draw origin hang off the eye.
|
||||
if ( UpdateFollowCamera() )
|
||||
{
|
||||
SetDrawOrigin( m_camera->DrawOrigin() );
|
||||
}
|
||||
|
||||
// Draw the replay world through the same adapter path the live samples use.
|
||||
b3DebugDraw debugDraw;
|
||||
MakeDebugDraw( &debugDraw );
|
||||
|
|
@ -576,8 +618,13 @@ public:
|
|||
|
||||
// Drive the shared outline highlight from the selection. A shape selection outlines that
|
||||
// shape alone, a body selection outlines the whole body. Set before the draw so the mask
|
||||
// is filled by the draw callback.
|
||||
if ( m_selKind == SelShape )
|
||||
// is filled by the draw callback. Following already centers the selection, so the outline
|
||||
// would only wrap and obscure the thing being watched.
|
||||
if ( m_followSelection )
|
||||
{
|
||||
ClearSelection();
|
||||
}
|
||||
else if ( m_selKind == SelShape )
|
||||
{
|
||||
SetSelectedShape( SelectedShape() );
|
||||
}
|
||||
|
|
@ -592,8 +639,6 @@ public:
|
|||
|
||||
b3World_Draw( m_replayWorldId, &debugDraw, B3_DEFAULT_MASK_BITS );
|
||||
|
||||
DrawSelectionHighlight();
|
||||
|
||||
// Overlay query geometry and recorded hits on top of the world. The toggle draws every recorded
|
||||
// query, otherwise just the selected one. Re-resolve the pinned query to this frame so a repeated
|
||||
// query keeps drawing as the recording steps; it vanishes only on a frame that does not issue it.
|
||||
|
|
@ -680,6 +725,58 @@ public:
|
|||
FrameRecording();
|
||||
}
|
||||
|
||||
// Where the follow cam should sit this frame. A body, shape or joint selection tracks the body's
|
||||
// center of mass, the stable point to watch even while a shape spins about it. A query tracks the
|
||||
// center of its recorded bounds. False when the selection resolves to nothing at this frame, which
|
||||
// happens before a body spawns or on a frame that does not issue the pinned query.
|
||||
bool FollowTarget( b3Pos* position ) const
|
||||
{
|
||||
if ( m_player == nullptr )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( m_selKind == SelQuery )
|
||||
{
|
||||
int sel = ResolveSelectedQuery();
|
||||
if ( sel < 0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
b3AABB aabb = b3RecPlayer_GetFrameQuery( m_player, sel ).aabb;
|
||||
if ( b3IsValidAABB( aabb ) == false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
*position = b3ToPos( b3AABB_Center( aabb ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
b3BodyId body = SelectedBody();
|
||||
if ( m_selKind == SelNone || b3Body_IsValid( body ) == false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
*position = b3Body_GetWorldCenter( body );
|
||||
return true;
|
||||
}
|
||||
|
||||
// Ride the selection. Returns true when the eye moved, so the caller can relatch the draw origin.
|
||||
bool UpdateFollowCamera()
|
||||
{
|
||||
b3Pos position;
|
||||
if ( m_followSelection == false || FollowTarget( &position ) == false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_camera->SetTarget( position );
|
||||
return true;
|
||||
}
|
||||
|
||||
// Transport row shared by the right panel and the Timeline tab. Play is green, Pause red.
|
||||
void DrawTransport()
|
||||
{
|
||||
|
|
@ -687,16 +784,12 @@ public:
|
|||
|
||||
if ( ImGui::Button( "|<" ) )
|
||||
{
|
||||
b3RecPlayer_SeekFrame( m_player, 0 );
|
||||
m_replayWorldId = b3RecPlayer_GetWorldId( m_player );
|
||||
m_frameAccumulator = 0.0f;
|
||||
SeekTo( 0 );
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if ( ImGui::Button( "<" ) )
|
||||
{
|
||||
b3RecPlayer_SeekFrame( m_player, frame - 1 );
|
||||
m_replayWorldId = b3RecPlayer_GetWorldId( m_player );
|
||||
m_frameAccumulator = 0.0f;
|
||||
SeekTo( frame - 1 );
|
||||
m_context->pause = true;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
|
|
@ -730,21 +823,18 @@ public:
|
|||
if ( m_subStepOnCreate )
|
||||
{
|
||||
AdvanceOne( true );
|
||||
m_frameAccumulator = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
b3RecPlayer_SeekFrame( m_player, frame + 1 );
|
||||
m_replayWorldId = b3RecPlayer_GetWorldId( m_player );
|
||||
SeekTo( frame + 1 );
|
||||
}
|
||||
m_frameAccumulator = 0.0f;
|
||||
m_context->pause = true;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if ( ImGui::Button( ">|" ) )
|
||||
{
|
||||
b3RecPlayer_SeekFrame( m_player, m_info.frameCount );
|
||||
m_replayWorldId = b3RecPlayer_GetWorldId( m_player );
|
||||
m_frameAccumulator = 0.0f;
|
||||
SeekTo( m_info.frameCount );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -767,6 +857,11 @@ public:
|
|||
// Overlay every recorded query, not just the one selected in the outline.
|
||||
ImGui::Checkbox( "Draw All Queries", &m_drawAllQueries );
|
||||
|
||||
// Keep the selection centered as the recording plays. Orbit and zoom still aim the view, and the
|
||||
// cursor is untouched, so picking and the scene tree keep working while it follows. The
|
||||
// silhouette outline drops while following, since a centered body needs no pointing at.
|
||||
ImGui::Checkbox( "Follow Selection", &m_followSelection );
|
||||
|
||||
// View-only stand-up for recordings authored with +Z as up. The simulation is untouched.
|
||||
// Reframe on a toggle so the rotated bounds stay centered, matching the fit done on load.
|
||||
if ( ImGui::Checkbox( "Z-up View", &m_context->viewZUp ) )
|
||||
|
|
@ -953,53 +1048,6 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
// Selection overlays drawn on top of the outline highlight: body axes, center of mass, and
|
||||
// contacts. Joints mark both connected body centers.
|
||||
void DrawSelectionHighlight()
|
||||
{
|
||||
if ( m_selKind == SelShape )
|
||||
{
|
||||
b3ShapeId shape = SelectedShape();
|
||||
if ( b3Shape_IsValid( shape ) == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
b3BodyId body = b3Shape_GetBody( shape );
|
||||
DrawAxes( b3Body_GetTransform( body ), 0.5f );
|
||||
DrawPoint( b3Body_GetWorldCenter( body ), 8.0f, MakeColor( b3_colorYellow ) );
|
||||
DrawBodyContacts( body );
|
||||
}
|
||||
else if ( m_selKind == SelBody )
|
||||
{
|
||||
b3BodyId body = SelectedBody();
|
||||
if ( b3Body_IsValid( body ) == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
DrawAxes( b3Body_GetTransform( body ), 0.5f );
|
||||
DrawPoint( b3Body_GetWorldCenter( body ), 8.0f, MakeColor( b3_colorYellow ) );
|
||||
DrawBodyContacts( body );
|
||||
}
|
||||
else if ( m_selKind == SelJoint )
|
||||
{
|
||||
b3JointId joint = SelectedJoint();
|
||||
if ( b3Joint_IsValid( joint ) == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
b3BodyId a = b3Joint_GetBodyA( joint );
|
||||
b3BodyId b = b3Joint_GetBodyB( joint );
|
||||
if ( b3Body_IsValid( a ) )
|
||||
{
|
||||
DrawPoint( b3Body_GetWorldCenter( a ), 8.0f, MakeColor( b3_colorMagenta ) );
|
||||
}
|
||||
if ( b3Body_IsValid( b ) )
|
||||
{
|
||||
DrawPoint( b3Body_GetWorldCenter( b ), 8.0f, MakeColor( b3_colorMagenta ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Left-edge Outline window plus the keyframe-policy popup. The selection detail lives in the right
|
||||
// info panel (DrawControls), so the tree owns the whole column.
|
||||
void DrawSampleWindows() override
|
||||
|
|
@ -1157,10 +1205,8 @@ public:
|
|||
ImGui::PopStyleColor();
|
||||
if ( clicked )
|
||||
{
|
||||
b3RecPlayer_SeekFrame( m_player, row.frame );
|
||||
m_replayWorldId = b3RecPlayer_GetWorldId( m_player );
|
||||
SeekTo( row.frame );
|
||||
m_context->pause = true;
|
||||
m_frameAccumulator = 0.0f;
|
||||
m_selKind = SelQuery;
|
||||
m_selQueryKey = row.key;
|
||||
FormatQueryLabel( m_selQueryLabel, sizeof( m_selQueryLabel ), row.name, row.id, row.type, row.kindOrdinal );
|
||||
|
|
@ -1663,9 +1709,7 @@ public:
|
|||
ImGui::PushItemWidth( -FLT_MIN );
|
||||
if ( ImGui::SliderInt( "##frame", &scrub, 0, m_info.frameCount ) )
|
||||
{
|
||||
b3RecPlayer_SeekFrame( m_player, scrub );
|
||||
m_replayWorldId = b3RecPlayer_GetWorldId( m_player );
|
||||
m_frameAccumulator = 0.0f;
|
||||
SeekTo( scrub );
|
||||
m_context->pause = true;
|
||||
}
|
||||
ImGui::PopItemWidth();
|
||||
|
|
@ -1758,6 +1802,11 @@ public:
|
|||
bool m_drawAllQueries; // overlay every recorded query, not just the selected one
|
||||
int m_hoverQuery; // outline query row under the cursor, drawn as a transient highlight
|
||||
|
||||
// Follow cam. Unlike the third person camera the character samples use, this drives the pivot only.
|
||||
// The cursor stays free, so picking, the timeline and the scene tree keep working and orbit still
|
||||
// aims the view.
|
||||
bool m_followSelection;
|
||||
|
||||
// Re-usable buffer for getting all shapes from a body.
|
||||
std::vector<b3ShapeId> m_shapeBuffer;
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ add_shader(highlight_outline "post/highlight_outline.glsl")
|
|||
# overlay
|
||||
add_shader(overlay_line "overlays/line.glsl")
|
||||
add_shader(overlay_point "overlays/point.glsl")
|
||||
add_shader(world_text "overlays/world_text.glsl")
|
||||
|
||||
get_property(_outputs GLOBAL PROPERTY SHADER_OUTPUTS)
|
||||
get_property(_inputs GLOBAL PROPERTY SHADER_INPUTS)
|
||||
|
|
|
|||
922
samples/shaders/generated/world_text.glsl.h
Normal file
922
samples/shaders/generated/world_text.glsl.h
Normal file
|
|
@ -0,0 +1,922 @@
|
|||
#pragma once
|
||||
/*
|
||||
#version:1# (machine generated, don't edit!)
|
||||
|
||||
Generated by sokol-shdc (https://github.com/floooh/sokol-tools)
|
||||
|
||||
Cmdline:
|
||||
sokol-shdc --input E:/box/box3d/samples/shaders/overlays/world_text.glsl --output E:/box/box3d/samples/shaders/generated/world_text.glsl.h --slang hlsl5:metal_macos:glsl430
|
||||
|
||||
Overview:
|
||||
=========
|
||||
Shader program: 'prog':
|
||||
Get shader desc: world_text_prog_shader_desc(sg_query_backend());
|
||||
Vertex Shader: vs
|
||||
Fragment Shader: fs
|
||||
Attributes:
|
||||
Bindings:
|
||||
Uniform block 'ub_frame':
|
||||
C struct: world_text_ub_frame_t
|
||||
Bind slot: UB_world_text_ub_frame => 0
|
||||
Uniform block 'ub_text_style':
|
||||
C struct: world_text_ub_text_style_t
|
||||
Bind slot: UB_world_text_ub_text_style => 1
|
||||
Storage buffer 'glyph_instances':
|
||||
C struct: world_text_glyph_instance_t
|
||||
Bind slot: VIEW_world_text_glyph_instances => 0
|
||||
Readonly: true
|
||||
Texture 'tex_sdf':
|
||||
Image type: SG_IMAGETYPE_2D
|
||||
Sample type: SG_IMAGESAMPLETYPE_FLOAT
|
||||
Multisampled: false
|
||||
Bind slot: VIEW_world_text_tex_sdf => 1
|
||||
Sampler 'smp_sdf':
|
||||
Type: SG_SAMPLERTYPE_FILTERING
|
||||
Bind slot: SMP_world_text_smp_sdf => 0
|
||||
*/
|
||||
#if !defined(SOKOL_GFX_INCLUDED)
|
||||
#error "Please include sokol_gfx.h before world_text.glsl.h"
|
||||
#endif
|
||||
#if !defined(SOKOL_SHDC_ALIGN)
|
||||
#if defined(_MSC_VER)
|
||||
#define SOKOL_SHDC_ALIGN(a) __declspec(align(a))
|
||||
#else
|
||||
#define SOKOL_SHDC_ALIGN(a) __attribute__((aligned(a)))
|
||||
#endif
|
||||
#endif
|
||||
#define UB_world_text_ub_frame (0)
|
||||
#define UB_world_text_ub_text_style (1)
|
||||
#define VIEW_world_text_glyph_instances (0)
|
||||
#define VIEW_world_text_tex_sdf (1)
|
||||
#define SMP_world_text_smp_sdf (0)
|
||||
#pragma pack(push,1)
|
||||
SOKOL_SHDC_ALIGN(16) typedef struct world_text_ub_frame_t {
|
||||
Mat4 view;
|
||||
Mat4 proj;
|
||||
Mat4 view_proj;
|
||||
Mat4 inv_view_proj;
|
||||
Vec4 camera_pos;
|
||||
Vec4 viewport;
|
||||
} world_text_ub_frame_t;
|
||||
#pragma pack(pop)
|
||||
#pragma pack(push,1)
|
||||
SOKOL_SHDC_ALIGN(16) typedef struct world_text_ub_text_style_t {
|
||||
Vec4 style_params;
|
||||
Vec4 halo_params;
|
||||
} world_text_ub_text_style_t;
|
||||
#pragma pack(pop)
|
||||
#pragma pack(push,1)
|
||||
SOKOL_SHDC_ALIGN(16) typedef struct world_text_glyph_instance_t {
|
||||
Vec4 anchor;
|
||||
Vec4 rect;
|
||||
Vec4 uv;
|
||||
Vec4 color;
|
||||
} world_text_glyph_instance_t;
|
||||
#pragma pack(pop)
|
||||
/*
|
||||
#version 430
|
||||
|
||||
struct glyph_instance
|
||||
{
|
||||
vec4 anchor;
|
||||
vec4 rect;
|
||||
vec4 uv;
|
||||
vec4 color;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) readonly buffer glyph_instances
|
||||
{
|
||||
glyph_instance instances[];
|
||||
} _15;
|
||||
|
||||
uniform vec4 ub_frame[18];
|
||||
layout(location = 0) out vec2 v_uv;
|
||||
layout(location = 1) flat out vec4 v_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
bool _46 = gl_VertexID == 2;
|
||||
bool _50 = gl_VertexID == 4;
|
||||
vec2 _75 = (vec2((((gl_VertexID == 1) || _46) || _50) ? 1.0 : (-1.0), ((_46 || _50) || (gl_VertexID == 5)) ? 1.0 : (-1.0)) * 0.5) + vec2(0.5);
|
||||
vec4 _92 = mat4(ub_frame[8], ub_frame[9], ub_frame[10], ub_frame[11]) * vec4(_15.instances[gl_InstanceID].anchor.xyz, 1.0);
|
||||
float _99 = _92.w;
|
||||
vec2 _123 = _15.instances[gl_InstanceID].rect.xy + (_75 * _15.instances[gl_InstanceID].rect.zw);
|
||||
gl_Position = vec4(((((floor(((((_92.xy / vec2(_99)) * 0.5) + vec2(0.5)) * ub_frame[17].xy) + vec2(0.5)) + vec2(_123.x, -_123.y)) * ub_frame[17].zw) * 2.0) - vec2(1.0)) * _99, _92.z, _99);
|
||||
v_uv = mix(_15.instances[gl_InstanceID].uv.xy, _15.instances[gl_InstanceID].uv.zw, _75);
|
||||
v_color = _15.instances[gl_InstanceID].color;
|
||||
}
|
||||
|
||||
*/
|
||||
static const uint8_t world_text_vs_source_glsl430[1132] = {
|
||||
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x73,0x74,
|
||||
0x72,0x75,0x63,0x74,0x20,0x67,0x6c,0x79,0x70,0x68,0x5f,0x69,0x6e,0x73,0x74,0x61,
|
||||
0x6e,0x63,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x61,
|
||||
0x6e,0x63,0x68,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,
|
||||
0x72,0x65,0x63,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x75,
|
||||
0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,
|
||||
0x72,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x62,0x69,
|
||||
0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x30,0x2c,0x20,0x73,0x74,0x64,0x34,0x33,
|
||||
0x30,0x29,0x20,0x72,0x65,0x61,0x64,0x6f,0x6e,0x6c,0x79,0x20,0x62,0x75,0x66,0x66,
|
||||
0x65,0x72,0x20,0x67,0x6c,0x79,0x70,0x68,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,
|
||||
0x65,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x79,0x70,0x68,0x5f,0x69,
|
||||
0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
|
||||
0x73,0x5b,0x5d,0x3b,0x0a,0x7d,0x20,0x5f,0x31,0x35,0x3b,0x0a,0x0a,0x75,0x6e,0x69,
|
||||
0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x75,0x62,0x5f,0x66,0x72,0x61,
|
||||
0x6d,0x65,0x5b,0x31,0x38,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
|
||||
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,
|
||||
0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x5f,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,
|
||||
0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,
|
||||
0x20,0x66,0x6c,0x61,0x74,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x76,
|
||||
0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,
|
||||
0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,
|
||||
0x5f,0x34,0x36,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,
|
||||
0x44,0x20,0x3d,0x3d,0x20,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,
|
||||
0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,
|
||||
0x49,0x44,0x20,0x3d,0x3d,0x20,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,
|
||||
0x32,0x20,0x5f,0x37,0x35,0x20,0x3d,0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x28,0x28,
|
||||
0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x20,0x3d,0x3d,0x20,
|
||||
0x31,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x34,0x36,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x35,
|
||||
0x30,0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,
|
||||
0x29,0x2c,0x20,0x28,0x28,0x5f,0x34,0x36,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,
|
||||
0x20,0x7c,0x7c,0x20,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,
|
||||
0x20,0x3d,0x3d,0x20,0x35,0x29,0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,0x20,0x3a,0x20,
|
||||
0x28,0x2d,0x31,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,
|
||||
0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
||||
0x76,0x65,0x63,0x34,0x20,0x5f,0x39,0x32,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,
|
||||
0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x38,0x5d,0x2c,0x20,0x75,0x62,0x5f,
|
||||
0x66,0x72,0x61,0x6d,0x65,0x5b,0x39,0x5d,0x2c,0x20,0x75,0x62,0x5f,0x66,0x72,0x61,
|
||||
0x6d,0x65,0x5b,0x31,0x30,0x5d,0x2c,0x20,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,
|
||||
0x5b,0x31,0x31,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x31,0x35,
|
||||
0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x67,0x6c,0x5f,0x49,0x6e,
|
||||
0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x5d,0x2e,0x61,0x6e,0x63,0x68,0x6f,0x72,
|
||||
0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
||||
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x39,0x20,0x3d,0x20,0x5f,0x39,0x32,0x2e,
|
||||
0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31,0x32,0x33,
|
||||
0x20,0x3d,0x20,0x5f,0x31,0x35,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,
|
||||
0x5b,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x5d,0x2e,
|
||||
0x72,0x65,0x63,0x74,0x2e,0x78,0x79,0x20,0x2b,0x20,0x28,0x5f,0x37,0x35,0x20,0x2a,
|
||||
0x20,0x5f,0x31,0x35,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x67,
|
||||
0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x5d,0x2e,0x72,0x65,
|
||||
0x63,0x74,0x2e,0x7a,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,
|
||||
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x28,
|
||||
0x28,0x28,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x28,0x28,0x28,0x28,0x5f,0x39,0x32,
|
||||
0x2e,0x78,0x79,0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x39,0x39,0x29,0x29,
|
||||
0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x30,
|
||||
0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,
|
||||
0x31,0x37,0x5d,0x2e,0x78,0x79,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x30,
|
||||
0x2e,0x35,0x29,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x31,0x32,0x33,
|
||||
0x2e,0x78,0x2c,0x20,0x2d,0x5f,0x31,0x32,0x33,0x2e,0x79,0x29,0x29,0x20,0x2a,0x20,
|
||||
0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x31,0x37,0x5d,0x2e,0x7a,0x77,0x29,
|
||||
0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x31,
|
||||
0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x39,0x39,0x2c,0x20,0x5f,0x39,0x32,0x2e,
|
||||
0x7a,0x2c,0x20,0x5f,0x39,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x75,
|
||||
0x76,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x31,0x35,0x2e,0x69,0x6e,0x73,0x74,
|
||||
0x61,0x6e,0x63,0x65,0x73,0x5b,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,
|
||||
0x65,0x49,0x44,0x5d,0x2e,0x75,0x76,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x31,0x35,0x2e,
|
||||
0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x67,0x6c,0x5f,0x49,0x6e,0x73,
|
||||
0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x5d,0x2e,0x75,0x76,0x2e,0x7a,0x77,0x2c,0x20,
|
||||
0x5f,0x37,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,
|
||||
0x72,0x20,0x3d,0x20,0x5f,0x31,0x35,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
|
||||
0x73,0x5b,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x5d,
|
||||
0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
};
|
||||
/*
|
||||
#version 430
|
||||
|
||||
uniform vec4 ub_text_style[2];
|
||||
layout(binding = 0) uniform sampler2D tex_sdf_smp_sdf;
|
||||
|
||||
layout(location = 0) in vec2 v_uv;
|
||||
layout(location = 1) flat in vec4 v_color;
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 _24 = texture(tex_sdf_smp_sdf, v_uv);
|
||||
float _51 = _24.x * v_color.w;
|
||||
float _68 = (1.0 - smoothstep(0.0, ub_text_style[0].x * ub_text_style[0].z, -(_24.y - ub_text_style[0].y))) * ub_text_style[1].w;
|
||||
float _73 = 1.0 - _51;
|
||||
out_color = vec4((v_color.xyz * _51) + ((ub_text_style[1].xyz * _68) * _73), _51 + (_68 * _73));
|
||||
}
|
||||
|
||||
*/
|
||||
static const uint8_t world_text_fs_source_glsl430[583] = {
|
||||
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x75,0x6e,
|
||||
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x75,0x62,0x5f,0x74,0x65,
|
||||
0x78,0x74,0x5f,0x73,0x74,0x79,0x6c,0x65,0x5b,0x32,0x5d,0x3b,0x0a,0x6c,0x61,0x79,
|
||||
0x6f,0x75,0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x30,0x29,
|
||||
0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,
|
||||
0x32,0x44,0x20,0x74,0x65,0x78,0x5f,0x73,0x64,0x66,0x5f,0x73,0x6d,0x70,0x5f,0x73,
|
||||
0x64,0x66,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,
|
||||
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,
|
||||
0x32,0x20,0x76,0x5f,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
|
||||
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x66,0x6c,0x61,
|
||||
0x74,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,
|
||||
0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,
|
||||
0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,
|
||||
0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,
|
||||
0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,
|
||||
0x65,0x63,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,
|
||||
0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x64,0x66,0x5f,0x73,0x6d,0x70,0x5f,0x73,0x64,
|
||||
0x66,0x2c,0x20,0x76,0x5f,0x75,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
|
||||
0x6f,0x61,0x74,0x20,0x5f,0x35,0x31,0x20,0x3d,0x20,0x5f,0x32,0x34,0x2e,0x78,0x20,
|
||||
0x2a,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x38,0x20,0x3d,0x20,0x28,0x31,0x2e,
|
||||
0x30,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,
|
||||
0x2e,0x30,0x2c,0x20,0x75,0x62,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x74,0x79,0x6c,
|
||||
0x65,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x2a,0x20,0x75,0x62,0x5f,0x74,0x65,0x78,0x74,
|
||||
0x5f,0x73,0x74,0x79,0x6c,0x65,0x5b,0x30,0x5d,0x2e,0x7a,0x2c,0x20,0x2d,0x28,0x5f,
|
||||
0x32,0x34,0x2e,0x79,0x20,0x2d,0x20,0x75,0x62,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,
|
||||
0x74,0x79,0x6c,0x65,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x29,0x29,0x20,0x2a,0x20,0x75,
|
||||
0x62,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x74,0x79,0x6c,0x65,0x5b,0x31,0x5d,0x2e,
|
||||
0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x37,0x33,
|
||||
0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x35,0x31,0x3b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,
|
||||
0x63,0x34,0x28,0x28,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,
|
||||
0x2a,0x20,0x5f,0x35,0x31,0x29,0x20,0x2b,0x20,0x28,0x28,0x75,0x62,0x5f,0x74,0x65,
|
||||
0x78,0x74,0x5f,0x73,0x74,0x79,0x6c,0x65,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x20,
|
||||
0x2a,0x20,0x5f,0x36,0x38,0x29,0x20,0x2a,0x20,0x5f,0x37,0x33,0x29,0x2c,0x20,0x5f,
|
||||
0x35,0x31,0x20,0x2b,0x20,0x28,0x5f,0x36,0x38,0x20,0x2a,0x20,0x5f,0x37,0x33,0x29,
|
||||
0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
};
|
||||
/*
|
||||
struct glyph_instance
|
||||
{
|
||||
float4 anchor;
|
||||
float4 rect;
|
||||
float4 uv;
|
||||
float4 color;
|
||||
};
|
||||
|
||||
ByteAddressBuffer _15 : register(t0);
|
||||
cbuffer ub_frame : register(b0)
|
||||
{
|
||||
row_major float4x4 _80_view : packoffset(c0);
|
||||
row_major float4x4 _80_proj : packoffset(c4);
|
||||
row_major float4x4 _80_view_proj : packoffset(c8);
|
||||
row_major float4x4 _80_inv_view_proj : packoffset(c12);
|
||||
float4 _80_camera_pos : packoffset(c16);
|
||||
float4 _80_viewport : packoffset(c17);
|
||||
};
|
||||
|
||||
|
||||
static float4 gl_Position;
|
||||
static int gl_VertexIndex;
|
||||
static int gl_InstanceIndex;
|
||||
static float2 v_uv;
|
||||
static float4 v_color;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint gl_VertexIndex : SV_VertexID;
|
||||
uint gl_InstanceIndex : SV_InstanceID;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 v_uv : TEXCOORD0;
|
||||
nointerpolation float4 v_color : TEXCOORD1;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
glyph_instance _23;
|
||||
_23.anchor = asfloat(_15.Load4(gl_InstanceIndex * 64 + 0));
|
||||
_23.rect = asfloat(_15.Load4(gl_InstanceIndex * 64 + 16));
|
||||
_23.uv = asfloat(_15.Load4(gl_InstanceIndex * 64 + 32));
|
||||
_23.color = asfloat(_15.Load4(gl_InstanceIndex * 64 + 48));
|
||||
bool _46 = gl_VertexIndex == 2;
|
||||
bool _50 = gl_VertexIndex == 4;
|
||||
float2 _75 = (float2((((gl_VertexIndex == 1) || _46) || _50) ? 1.0f : (-1.0f), ((_46 || _50) || (gl_VertexIndex == 5)) ? 1.0f : (-1.0f)) * 0.5f) + 0.5f.xx;
|
||||
float4 _92 = mul(float4(_23.anchor.xyz, 1.0f), _80_view_proj);
|
||||
float _99 = _92.w;
|
||||
float2 _123 = _23.rect.xy + (_75 * _23.rect.zw);
|
||||
gl_Position = float4(((((floor(((((_92.xy / _99.xx) * 0.5f) + 0.5f.xx) * _80_viewport.xy) + 0.5f.xx) + float2(_123.x, -_123.y)) * _80_viewport.zw) * 2.0f) - 1.0f.xx) * _99, _92.z, _99);
|
||||
v_uv = lerp(_23.uv.xy, _23.uv.zw, _75);
|
||||
v_color = _23.color;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_VertexIndex = int(stage_input.gl_VertexIndex);
|
||||
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.v_uv = v_uv;
|
||||
stage_output.v_color = v_color;
|
||||
return stage_output;
|
||||
}
|
||||
*/
|
||||
static const uint8_t world_text_vs_source_hlsl5[2157] = {
|
||||
0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67,0x6c,0x79,0x70,0x68,0x5f,0x69,0x6e,0x73,
|
||||
0x74,0x61,0x6e,0x63,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
||||
0x74,0x34,0x20,0x61,0x6e,0x63,0x68,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
||||
0x6c,0x6f,0x61,0x74,0x34,0x20,0x72,0x65,0x63,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
||||
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
||||
0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x3b,0x0a,
|
||||
0x0a,0x42,0x79,0x74,0x65,0x41,0x64,0x64,0x72,0x65,0x73,0x73,0x42,0x75,0x66,0x66,
|
||||
0x65,0x72,0x20,0x5f,0x31,0x35,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,
|
||||
0x72,0x28,0x74,0x30,0x29,0x3b,0x0a,0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x75,
|
||||
0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,
|
||||
0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,
|
||||
0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,
|
||||
0x5f,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,
|
||||
0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
|
||||
0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,
|
||||
0x34,0x20,0x5f,0x38,0x30,0x5f,0x70,0x72,0x6f,0x6a,0x20,0x3a,0x20,0x70,0x61,0x63,
|
||||
0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x34,0x78,0x34,0x20,0x5f,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,
|
||||
0x6a,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,
|
||||
0x38,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,
|
||||
0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x38,0x30,0x5f,0x69,
|
||||
0x6e,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x20,0x3a,0x20,0x70,
|
||||
0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x31,0x32,0x29,0x3b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x38,0x30,0x5f,0x63,
|
||||
0x61,0x6d,0x65,0x72,0x61,0x5f,0x70,0x6f,0x73,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,
|
||||
0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x31,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,
|
||||
0x70,0x6f,0x72,0x74,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,
|
||||
0x74,0x28,0x63,0x31,0x37,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x0a,0x73,0x74,0x61,
|
||||
0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,
|
||||
0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,
|
||||
0x6e,0x74,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,
|
||||
0x78,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x74,0x20,0x67,0x6c,
|
||||
0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x3b,0x0a,
|
||||
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x5f,
|
||||
0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x34,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,
|
||||
0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,
|
||||
0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x20,
|
||||
0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x3a,
|
||||
0x20,0x53,0x56,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x3b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x75,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,
|
||||
0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x3a,0x20,0x53,0x56,0x5f,0x49,0x6e,0x73,
|
||||
0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,
|
||||
0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,
|
||||
0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
||||
0x61,0x74,0x32,0x20,0x76,0x5f,0x75,0x76,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,
|
||||
0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x69,0x6e,0x74,0x65,
|
||||
0x72,0x70,0x6f,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
||||
0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,
|
||||
0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
||||
0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,
|
||||
0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,
|
||||
0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,
|
||||
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x79,0x70,0x68,0x5f,0x69,0x6e,0x73,
|
||||
0x74,0x61,0x6e,0x63,0x65,0x20,0x5f,0x32,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,
|
||||
0x32,0x33,0x2e,0x61,0x6e,0x63,0x68,0x6f,0x72,0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,
|
||||
0x6f,0x61,0x74,0x28,0x5f,0x31,0x35,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x67,0x6c,
|
||||
0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x2a,
|
||||
0x20,0x36,0x34,0x20,0x2b,0x20,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,
|
||||
0x32,0x33,0x2e,0x72,0x65,0x63,0x74,0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,0x6f,0x61,
|
||||
0x74,0x28,0x5f,0x31,0x35,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x67,0x6c,0x5f,0x49,
|
||||
0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x2a,0x20,0x36,
|
||||
0x34,0x20,0x2b,0x20,0x31,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x32,
|
||||
0x33,0x2e,0x75,0x76,0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,
|
||||
0x31,0x35,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,
|
||||
0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x2a,0x20,0x36,0x34,0x20,0x2b,
|
||||
0x20,0x33,0x32,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x32,0x33,0x2e,0x63,
|
||||
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,
|
||||
0x31,0x35,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,
|
||||
0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x2a,0x20,0x36,0x34,0x20,0x2b,
|
||||
0x20,0x34,0x38,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,
|
||||
0x5f,0x34,0x36,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,
|
||||
0x6e,0x64,0x65,0x78,0x20,0x3d,0x3d,0x20,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,
|
||||
0x6f,0x6f,0x6c,0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,
|
||||
0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x3d,0x3d,0x20,0x34,0x3b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x37,0x35,0x20,0x3d,0x20,
|
||||
0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x28,0x28,0x28,0x67,0x6c,0x5f,0x56,0x65,
|
||||
0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x3d,0x3d,0x20,0x31,0x29,0x20,
|
||||
0x7c,0x7c,0x20,0x5f,0x34,0x36,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,0x20,
|
||||
0x3f,0x20,0x31,0x2e,0x30,0x66,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x66,0x29,
|
||||
0x2c,0x20,0x28,0x28,0x5f,0x34,0x36,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,0x20,
|
||||
0x7c,0x7c,0x20,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,
|
||||
0x65,0x78,0x20,0x3d,0x3d,0x20,0x35,0x29,0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,0x66,
|
||||
0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x66,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,
|
||||
0x35,0x66,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x66,0x2e,0x78,0x78,0x3b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x39,0x32,0x20,0x3d,0x20,
|
||||
0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x32,0x33,0x2e,0x61,
|
||||
0x6e,0x63,0x68,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,
|
||||
0x2c,0x20,0x5f,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x29,
|
||||
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x39,0x20,
|
||||
0x3d,0x20,0x5f,0x39,0x32,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
||||
0x61,0x74,0x32,0x20,0x5f,0x31,0x32,0x33,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x72,
|
||||
0x65,0x63,0x74,0x2e,0x78,0x79,0x20,0x2b,0x20,0x28,0x5f,0x37,0x35,0x20,0x2a,0x20,
|
||||
0x5f,0x32,0x33,0x2e,0x72,0x65,0x63,0x74,0x2e,0x7a,0x77,0x29,0x3b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
|
||||
0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x28,0x28,0x66,0x6c,0x6f,0x6f,0x72,
|
||||
0x28,0x28,0x28,0x28,0x28,0x5f,0x39,0x32,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,0x39,
|
||||
0x39,0x2e,0x78,0x78,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2b,0x20,
|
||||
0x30,0x2e,0x35,0x66,0x2e,0x78,0x78,0x29,0x20,0x2a,0x20,0x5f,0x38,0x30,0x5f,0x76,
|
||||
0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x2e,0x78,0x79,0x29,0x20,0x2b,0x20,0x30,0x2e,
|
||||
0x35,0x66,0x2e,0x78,0x78,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,
|
||||
0x5f,0x31,0x32,0x33,0x2e,0x78,0x2c,0x20,0x2d,0x5f,0x31,0x32,0x33,0x2e,0x79,0x29,
|
||||
0x29,0x20,0x2a,0x20,0x5f,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,
|
||||
0x2e,0x7a,0x77,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x66,0x29,0x20,0x2d,0x20,0x31,
|
||||
0x2e,0x30,0x66,0x2e,0x78,0x78,0x29,0x20,0x2a,0x20,0x5f,0x39,0x39,0x2c,0x20,0x5f,
|
||||
0x39,0x32,0x2e,0x7a,0x2c,0x20,0x5f,0x39,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
||||
0x76,0x5f,0x75,0x76,0x20,0x3d,0x20,0x6c,0x65,0x72,0x70,0x28,0x5f,0x32,0x33,0x2e,
|
||||
0x75,0x76,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x32,0x33,0x2e,0x75,0x76,0x2e,0x7a,0x77,
|
||||
0x2c,0x20,0x5f,0x37,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x63,0x6f,
|
||||
0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x3b,
|
||||
0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,
|
||||
0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,
|
||||
0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,
|
||||
0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,
|
||||
0x3d,0x20,0x69,0x6e,0x74,0x28,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,
|
||||
0x74,0x2e,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,
|
||||
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,
|
||||
0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x73,0x74,
|
||||
0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x49,0x6e,0x73,
|
||||
0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,
|
||||
0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,
|
||||
0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,
|
||||
0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,
|
||||
0x3d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,
|
||||
0x76,0x5f,0x75,0x76,0x20,0x3d,0x20,0x76,0x5f,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x76,0x5f,
|
||||
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,
|
||||
0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,
|
||||
0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
|
||||
};
|
||||
/*
|
||||
cbuffer ub_text_style : register(b1)
|
||||
{
|
||||
float4 _34_style_params : packoffset(c0);
|
||||
float4 _34_halo_params : packoffset(c1);
|
||||
};
|
||||
|
||||
Texture2D<float4> tex_sdf : register(t0);
|
||||
SamplerState smp_sdf : register(s0);
|
||||
|
||||
static float2 v_uv;
|
||||
static float4 v_color;
|
||||
static float4 out_color;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 v_uv : TEXCOORD0;
|
||||
nointerpolation float4 v_color : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 out_color : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _24 = tex_sdf.Sample(smp_sdf, v_uv);
|
||||
float _51 = _24.x * v_color.w;
|
||||
float _68 = (1.0f - smoothstep(0.0f, _34_style_params.x * _34_style_params.z, -(_24.y - _34_style_params.y))) * _34_halo_params.w;
|
||||
float _73 = 1.0f - _51;
|
||||
out_color = float4((v_color.xyz * _51) + ((_34_halo_params.xyz * _68) * _73), _51 + (_68 * _73));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
v_uv = stage_input.v_uv;
|
||||
v_color = stage_input.v_color;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.out_color = out_color;
|
||||
return stage_output;
|
||||
}
|
||||
*/
|
||||
static const uint8_t world_text_fs_source_hlsl5[1071] = {
|
||||
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x75,0x62,0x5f,0x74,0x65,0x78,0x74,0x5f,
|
||||
0x73,0x74,0x79,0x6c,0x65,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,
|
||||
0x28,0x62,0x31,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x34,0x20,0x5f,0x33,0x34,0x5f,0x73,0x74,0x79,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,
|
||||
0x6d,0x73,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,
|
||||
0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
|
||||
0x5f,0x33,0x34,0x5f,0x68,0x61,0x6c,0x6f,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,
|
||||
0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x31,0x29,
|
||||
0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,
|
||||
0x66,0x6c,0x6f,0x61,0x74,0x34,0x3e,0x20,0x74,0x65,0x78,0x5f,0x73,0x64,0x66,0x20,
|
||||
0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x74,0x30,0x29,0x3b,0x0a,
|
||||
0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61,0x74,0x65,0x20,0x73,0x6d,0x70,
|
||||
0x5f,0x73,0x64,0x66,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,
|
||||
0x73,0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,
|
||||
0x61,0x74,0x32,0x20,0x76,0x5f,0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
|
||||
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,
|
||||
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,
|
||||
0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,
|
||||
0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,
|
||||
0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,
|
||||
0x20,0x76,0x5f,0x75,0x76,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
|
||||
0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x69,0x6e,0x74,0x65,0x72,0x70,0x6f,
|
||||
0x6c,0x61,0x74,0x69,0x6f,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,
|
||||
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
|
||||
0x31,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,
|
||||
0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,
|
||||
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,
|
||||
0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x53,0x56,0x5f,0x54,0x61,0x72,
|
||||
0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,
|
||||
0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d,0x20,0x74,0x65,
|
||||
0x78,0x5f,0x73,0x64,0x66,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,
|
||||
0x5f,0x73,0x64,0x66,0x2c,0x20,0x76,0x5f,0x75,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x31,0x20,0x3d,0x20,0x5f,0x32,0x34,
|
||||
0x2e,0x78,0x20,0x2a,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x3b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x38,0x20,0x3d,0x20,
|
||||
0x28,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,
|
||||
0x65,0x70,0x28,0x30,0x2e,0x30,0x66,0x2c,0x20,0x5f,0x33,0x34,0x5f,0x73,0x74,0x79,
|
||||
0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x78,0x20,0x2a,0x20,0x5f,0x33,
|
||||
0x34,0x5f,0x73,0x74,0x79,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x7a,
|
||||
0x2c,0x20,0x2d,0x28,0x5f,0x32,0x34,0x2e,0x79,0x20,0x2d,0x20,0x5f,0x33,0x34,0x5f,
|
||||
0x73,0x74,0x79,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x79,0x29,0x29,
|
||||
0x29,0x20,0x2a,0x20,0x5f,0x33,0x34,0x5f,0x68,0x61,0x6c,0x6f,0x5f,0x70,0x61,0x72,
|
||||
0x61,0x6d,0x73,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x20,0x5f,0x37,0x33,0x20,0x3d,0x20,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x5f,0x35,
|
||||
0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
|
||||
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x76,0x5f,0x63,0x6f,0x6c,
|
||||
0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x35,0x31,0x29,0x20,0x2b,0x20,
|
||||
0x28,0x28,0x5f,0x33,0x34,0x5f,0x68,0x61,0x6c,0x6f,0x5f,0x70,0x61,0x72,0x61,0x6d,
|
||||
0x73,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x36,0x38,0x29,0x20,0x2a,0x20,0x5f,
|
||||
0x37,0x33,0x29,0x2c,0x20,0x5f,0x35,0x31,0x20,0x2b,0x20,0x28,0x5f,0x36,0x38,0x20,
|
||||
0x2a,0x20,0x5f,0x37,0x33,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,
|
||||
0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,
|
||||
0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,
|
||||
0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,
|
||||
0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x75,0x76,0x20,0x3d,0x20,
|
||||
0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x5f,0x75,0x76,
|
||||
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,
|
||||
0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x5f,0x63,0x6f,
|
||||
0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,
|
||||
0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,
|
||||
0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,
|
||||
0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,
|
||||
0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x6f,0x75,0x74,0x5f,
|
||||
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,
|
||||
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,
|
||||
0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
|
||||
};
|
||||
/*
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct glyph_instance
|
||||
{
|
||||
float4 anchor;
|
||||
float4 rect;
|
||||
float4 uv;
|
||||
float4 color;
|
||||
};
|
||||
|
||||
struct glyph_instances
|
||||
{
|
||||
glyph_instance instances[1];
|
||||
};
|
||||
|
||||
struct ub_frame
|
||||
{
|
||||
float4x4 view;
|
||||
float4x4 proj;
|
||||
float4x4 view_proj;
|
||||
float4x4 inv_view_proj;
|
||||
float4 camera_pos;
|
||||
float4 viewport;
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float2 v_uv [[user(locn0)]];
|
||||
float4 v_color [[user(locn1)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(constant ub_frame& _80 [[buffer(0)]], const device glyph_instances& _15 [[buffer(8)]], uint gl_InstanceIndex [[instance_id]], uint gl_VertexIndex [[vertex_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
bool _46 = int(gl_VertexIndex) == 2;
|
||||
bool _50 = int(gl_VertexIndex) == 4;
|
||||
float2 _75 = (float2((((int(gl_VertexIndex) == 1) || _46) || _50) ? 1.0 : (-1.0), ((_46 || _50) || (int(gl_VertexIndex) == 5)) ? 1.0 : (-1.0)) * 0.5) + float2(0.5);
|
||||
float4 _92 = _80.view_proj * float4(_15.instances[int(gl_InstanceIndex)].anchor.xyz, 1.0);
|
||||
float _99 = _92.w;
|
||||
float2 _123 = _15.instances[int(gl_InstanceIndex)].rect.xy + (_75 * _15.instances[int(gl_InstanceIndex)].rect.zw);
|
||||
out.gl_Position = float4(((((floor(((((_92.xy / float2(_99)) * 0.5) + float2(0.5)) * _80.viewport.xy) + float2(0.5)) + float2(_123.x, -_123.y)) * _80.viewport.zw) * 2.0) - float2(1.0)) * _99, _92.z, _99);
|
||||
out.v_uv = mix(_15.instances[int(gl_InstanceIndex)].uv.xy, _15.instances[int(gl_InstanceIndex)].uv.zw, _75);
|
||||
out.v_color = _15.instances[int(gl_InstanceIndex)].color;
|
||||
return out;
|
||||
}
|
||||
|
||||
*/
|
||||
static const uint8_t world_text_vs_source_metal_macos[1618] = {
|
||||
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
|
||||
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
|
||||
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
|
||||
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
|
||||
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67,
|
||||
0x6c,0x79,0x70,0x68,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x0a,0x7b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x6e,0x63,0x68,0x6f,
|
||||
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x72,0x65,
|
||||
0x63,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,
|
||||
0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,
|
||||
0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
|
||||
0x67,0x6c,0x79,0x70,0x68,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x0a,
|
||||
0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x79,0x70,0x68,0x5f,0x69,0x6e,0x73,0x74,
|
||||
0x61,0x6e,0x63,0x65,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x31,
|
||||
0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x75,0x62,
|
||||
0x5f,0x66,0x72,0x61,0x6d,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
||||
0x61,0x74,0x34,0x78,0x34,0x20,0x76,0x69,0x65,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
||||
0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x70,0x72,0x6f,0x6a,0x3b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x76,0x69,0x65,0x77,
|
||||
0x5f,0x70,0x72,0x6f,0x6a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x34,0x78,0x34,0x20,0x69,0x6e,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,
|
||||
0x6a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x61,
|
||||
0x6d,0x65,0x72,0x61,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
|
||||
0x6f,0x61,0x74,0x34,0x20,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x3b,0x0a,0x7d,
|
||||
0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
|
||||
0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,
|
||||
0x20,0x76,0x5f,0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,
|
||||
0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x34,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,
|
||||
0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
||||
0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,
|
||||
0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,
|
||||
0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,
|
||||
0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x63,0x6f,0x6e,0x73,0x74,
|
||||
0x61,0x6e,0x74,0x20,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x26,0x20,0x5f,0x38,
|
||||
0x30,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,
|
||||
0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20,0x67,0x6c,
|
||||
0x79,0x70,0x68,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x26,0x20,0x5f,
|
||||
0x31,0x35,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x38,0x29,0x5d,0x5d,
|
||||
0x2c,0x20,0x75,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,
|
||||
0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x5b,0x5b,0x69,0x6e,0x73,0x74,0x61,0x6e,
|
||||
0x63,0x65,0x5f,0x69,0x64,0x5d,0x5d,0x2c,0x20,0x75,0x69,0x6e,0x74,0x20,0x67,0x6c,
|
||||
0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x5b,0x5b,0x76,
|
||||
0x65,0x72,0x74,0x65,0x78,0x5f,0x69,0x64,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,
|
||||
0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,
|
||||
0x34,0x36,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,
|
||||
0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x3d,0x3d,0x20,0x32,0x3b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,0x69,0x6e,
|
||||
0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,
|
||||
0x29,0x20,0x3d,0x3d,0x20,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
||||
0x74,0x32,0x20,0x5f,0x37,0x35,0x20,0x3d,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,
|
||||
0x28,0x28,0x28,0x28,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,
|
||||
0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x3d,0x3d,0x20,0x31,0x29,0x20,0x7c,0x7c,
|
||||
0x20,0x5f,0x34,0x36,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,0x20,0x3f,0x20,
|
||||
0x31,0x2e,0x30,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x29,0x2c,0x20,0x28,0x28,
|
||||
0x5f,0x34,0x36,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,0x20,0x7c,0x7c,0x20,0x28,
|
||||
0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,
|
||||
0x65,0x78,0x29,0x20,0x3d,0x3d,0x20,0x35,0x29,0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,
|
||||
0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,
|
||||
0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,
|
||||
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x39,0x32,0x20,
|
||||
0x3d,0x20,0x5f,0x38,0x30,0x2e,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x20,
|
||||
0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x31,0x35,0x2e,0x69,0x6e,0x73,
|
||||
0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,
|
||||
0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x5d,0x2e,0x61,0x6e,
|
||||
0x63,0x68,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x39,0x20,0x3d,0x20,
|
||||
0x5f,0x39,0x32,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x32,0x20,0x5f,0x31,0x32,0x33,0x20,0x3d,0x20,0x5f,0x31,0x35,0x2e,0x69,0x6e,0x73,
|
||||
0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,
|
||||
0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x5d,0x2e,0x72,0x65,
|
||||
0x63,0x74,0x2e,0x78,0x79,0x20,0x2b,0x20,0x28,0x5f,0x37,0x35,0x20,0x2a,0x20,0x5f,
|
||||
0x31,0x35,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x69,0x6e,0x74,
|
||||
0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,
|
||||
0x78,0x29,0x5d,0x2e,0x72,0x65,0x63,0x74,0x2e,0x7a,0x77,0x29,0x3b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,
|
||||
0x6e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x28,0x28,0x66,
|
||||
0x6c,0x6f,0x6f,0x72,0x28,0x28,0x28,0x28,0x28,0x5f,0x39,0x32,0x2e,0x78,0x79,0x20,
|
||||
0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x5f,0x39,0x39,0x29,0x29,0x20,0x2a,
|
||||
0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,
|
||||
0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x5f,0x38,0x30,0x2e,0x76,0x69,0x65,0x77,0x70,
|
||||
0x6f,0x72,0x74,0x2e,0x78,0x79,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,
|
||||
0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,
|
||||
0x5f,0x31,0x32,0x33,0x2e,0x78,0x2c,0x20,0x2d,0x5f,0x31,0x32,0x33,0x2e,0x79,0x29,
|
||||
0x29,0x20,0x2a,0x20,0x5f,0x38,0x30,0x2e,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,
|
||||
0x2e,0x7a,0x77,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x20,0x2d,0x20,0x66,0x6c,
|
||||
0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x39,0x39,
|
||||
0x2c,0x20,0x5f,0x39,0x32,0x2e,0x7a,0x2c,0x20,0x5f,0x39,0x39,0x29,0x3b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x75,0x76,0x20,0x3d,0x20,0x6d,0x69,
|
||||
0x78,0x28,0x5f,0x31,0x35,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,
|
||||
0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,
|
||||
0x6e,0x64,0x65,0x78,0x29,0x5d,0x2e,0x75,0x76,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x31,
|
||||
0x35,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x69,0x6e,0x74,0x28,
|
||||
0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,
|
||||
0x29,0x5d,0x2e,0x75,0x76,0x2e,0x7a,0x77,0x2c,0x20,0x5f,0x37,0x35,0x29,0x3b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,
|
||||
0x3d,0x20,0x5f,0x31,0x35,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,
|
||||
0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,
|
||||
0x6e,0x64,0x65,0x78,0x29,0x5d,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,
|
||||
0x0a,0x00,
|
||||
};
|
||||
/*
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct ub_text_style
|
||||
{
|
||||
float4 style_params;
|
||||
float4 halo_params;
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_color [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float2 v_uv [[user(locn0)]];
|
||||
float4 v_color [[user(locn1), flat]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], constant ub_text_style& _34 [[buffer(1)]], texture2d<float> tex_sdf [[texture(0)]], sampler smp_sdf [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _24 = tex_sdf.sample(smp_sdf, in.v_uv);
|
||||
float _51 = _24.x * in.v_color.w;
|
||||
float _68 = (1.0 - smoothstep(0.0, _34.style_params.x * _34.style_params.z, -(_24.y - _34.style_params.y))) * _34.halo_params.w;
|
||||
float _73 = 1.0 - _51;
|
||||
out.out_color = float4((in.v_color.xyz * _51) + ((_34.halo_params.xyz * _68) * _73), _51 + (_68 * _73));
|
||||
return out;
|
||||
}
|
||||
|
||||
*/
|
||||
static const uint8_t world_text_fs_source_metal_macos[874] = {
|
||||
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
|
||||
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
|
||||
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
|
||||
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
|
||||
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x75,
|
||||
0x62,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x74,0x79,0x6c,0x65,0x0a,0x7b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x79,0x6c,0x65,0x5f,
|
||||
0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
||||
0x74,0x34,0x20,0x68,0x61,0x6c,0x6f,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,
|
||||
0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,
|
||||
0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x34,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,
|
||||
0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,
|
||||
0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x5f,0x75,0x76,0x20,
|
||||
0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,
|
||||
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x63,0x6f,
|
||||
0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,
|
||||
0x29,0x2c,0x20,0x66,0x6c,0x61,0x74,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,
|
||||
0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,
|
||||
0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,
|
||||
0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,
|
||||
0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x75,0x62,0x5f,0x74,0x65,
|
||||
0x78,0x74,0x5f,0x73,0x74,0x79,0x6c,0x65,0x26,0x20,0x5f,0x33,0x34,0x20,0x5b,0x5b,
|
||||
0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,
|
||||
0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65,
|
||||
0x78,0x5f,0x73,0x64,0x66,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,
|
||||
0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x73,0x6d,
|
||||
0x70,0x5f,0x73,0x64,0x66,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,
|
||||
0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,
|
||||
0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d,
|
||||
0x20,0x74,0x65,0x78,0x5f,0x73,0x64,0x66,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,
|
||||
0x73,0x6d,0x70,0x5f,0x73,0x64,0x66,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x5f,0x75,0x76,
|
||||
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x31,
|
||||
0x20,0x3d,0x20,0x5f,0x32,0x34,0x2e,0x78,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x76,0x5f,
|
||||
0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
||||
0x61,0x74,0x20,0x5f,0x36,0x38,0x20,0x3d,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,
|
||||
0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,
|
||||
0x5f,0x33,0x34,0x2e,0x73,0x74,0x79,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
|
||||
0x2e,0x78,0x20,0x2a,0x20,0x5f,0x33,0x34,0x2e,0x73,0x74,0x79,0x6c,0x65,0x5f,0x70,
|
||||
0x61,0x72,0x61,0x6d,0x73,0x2e,0x7a,0x2c,0x20,0x2d,0x28,0x5f,0x32,0x34,0x2e,0x79,
|
||||
0x20,0x2d,0x20,0x5f,0x33,0x34,0x2e,0x73,0x74,0x79,0x6c,0x65,0x5f,0x70,0x61,0x72,
|
||||
0x61,0x6d,0x73,0x2e,0x79,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x33,0x34,0x2e,0x68,
|
||||
0x61,0x6c,0x6f,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x77,0x3b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x37,0x33,0x20,0x3d,0x20,0x31,0x2e,
|
||||
0x30,0x20,0x2d,0x20,0x5f,0x35,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,
|
||||
0x2e,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,
|
||||
0x61,0x74,0x34,0x28,0x28,0x69,0x6e,0x2e,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,
|
||||
0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x35,0x31,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,
|
||||
0x33,0x34,0x2e,0x68,0x61,0x6c,0x6f,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x78,
|
||||
0x79,0x7a,0x20,0x2a,0x20,0x5f,0x36,0x38,0x29,0x20,0x2a,0x20,0x5f,0x37,0x33,0x29,
|
||||
0x2c,0x20,0x5f,0x35,0x31,0x20,0x2b,0x20,0x28,0x5f,0x36,0x38,0x20,0x2a,0x20,0x5f,
|
||||
0x37,0x33,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
|
||||
0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
};
|
||||
static inline const sg_shader_desc* world_text_prog_shader_desc(sg_backend backend) {
|
||||
if (backend == SG_BACKEND_GLCORE) {
|
||||
static sg_shader_desc desc;
|
||||
static bool valid;
|
||||
if (!valid) {
|
||||
valid = true;
|
||||
desc.vertex_func.source = (const char*)world_text_vs_source_glsl430;
|
||||
desc.vertex_func.entry = "main";
|
||||
desc.fragment_func.source = (const char*)world_text_fs_source_glsl430;
|
||||
desc.fragment_func.entry = "main";
|
||||
desc.uniform_blocks[0].stage = SG_SHADERSTAGE_VERTEX;
|
||||
desc.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140;
|
||||
desc.uniform_blocks[0].size = 288;
|
||||
desc.uniform_blocks[0].glsl_uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
|
||||
desc.uniform_blocks[0].glsl_uniforms[0].array_count = 18;
|
||||
desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "ub_frame";
|
||||
desc.uniform_blocks[1].stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.uniform_blocks[1].layout = SG_UNIFORMLAYOUT_STD140;
|
||||
desc.uniform_blocks[1].size = 32;
|
||||
desc.uniform_blocks[1].glsl_uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
|
||||
desc.uniform_blocks[1].glsl_uniforms[0].array_count = 2;
|
||||
desc.uniform_blocks[1].glsl_uniforms[0].glsl_name = "ub_text_style";
|
||||
desc.views[0].storage_buffer.stage = SG_SHADERSTAGE_VERTEX;
|
||||
desc.views[0].storage_buffer.readonly = true;
|
||||
desc.views[0].storage_buffer.glsl_binding_n = 0;
|
||||
desc.views[1].texture.stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.views[1].texture.image_type = SG_IMAGETYPE_2D;
|
||||
desc.views[1].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT;
|
||||
desc.views[1].texture.multisampled = false;
|
||||
desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
|
||||
desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.texture_sampler_pairs[0].view_slot = 1;
|
||||
desc.texture_sampler_pairs[0].sampler_slot = 0;
|
||||
desc.texture_sampler_pairs[0].glsl_name = "tex_sdf_smp_sdf";
|
||||
desc.label = "world_text_prog_shader";
|
||||
}
|
||||
return &desc;
|
||||
}
|
||||
if (backend == SG_BACKEND_D3D11) {
|
||||
static sg_shader_desc desc;
|
||||
static bool valid;
|
||||
if (!valid) {
|
||||
valid = true;
|
||||
desc.vertex_func.source = (const char*)world_text_vs_source_hlsl5;
|
||||
desc.vertex_func.d3d11_target = "vs_5_0";
|
||||
desc.vertex_func.entry = "main";
|
||||
desc.fragment_func.source = (const char*)world_text_fs_source_hlsl5;
|
||||
desc.fragment_func.d3d11_target = "ps_5_0";
|
||||
desc.fragment_func.entry = "main";
|
||||
desc.uniform_blocks[0].stage = SG_SHADERSTAGE_VERTEX;
|
||||
desc.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140;
|
||||
desc.uniform_blocks[0].size = 288;
|
||||
desc.uniform_blocks[0].hlsl_register_b_n = 0;
|
||||
desc.uniform_blocks[1].stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.uniform_blocks[1].layout = SG_UNIFORMLAYOUT_STD140;
|
||||
desc.uniform_blocks[1].size = 32;
|
||||
desc.uniform_blocks[1].hlsl_register_b_n = 1;
|
||||
desc.views[0].storage_buffer.stage = SG_SHADERSTAGE_VERTEX;
|
||||
desc.views[0].storage_buffer.readonly = true;
|
||||
desc.views[0].storage_buffer.hlsl_register_t_n = 0;
|
||||
desc.views[1].texture.stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.views[1].texture.image_type = SG_IMAGETYPE_2D;
|
||||
desc.views[1].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT;
|
||||
desc.views[1].texture.multisampled = false;
|
||||
desc.views[1].texture.hlsl_register_t_n = 0;
|
||||
desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
|
||||
desc.samplers[0].hlsl_register_s_n = 0;
|
||||
desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.texture_sampler_pairs[0].view_slot = 1;
|
||||
desc.texture_sampler_pairs[0].sampler_slot = 0;
|
||||
desc.label = "world_text_prog_shader";
|
||||
}
|
||||
return &desc;
|
||||
}
|
||||
if (backend == SG_BACKEND_METAL_MACOS) {
|
||||
static sg_shader_desc desc;
|
||||
static bool valid;
|
||||
if (!valid) {
|
||||
valid = true;
|
||||
desc.vertex_func.source = (const char*)world_text_vs_source_metal_macos;
|
||||
desc.vertex_func.entry = "main0";
|
||||
desc.fragment_func.source = (const char*)world_text_fs_source_metal_macos;
|
||||
desc.fragment_func.entry = "main0";
|
||||
desc.uniform_blocks[0].stage = SG_SHADERSTAGE_VERTEX;
|
||||
desc.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140;
|
||||
desc.uniform_blocks[0].size = 288;
|
||||
desc.uniform_blocks[0].msl_buffer_n = 0;
|
||||
desc.uniform_blocks[1].stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.uniform_blocks[1].layout = SG_UNIFORMLAYOUT_STD140;
|
||||
desc.uniform_blocks[1].size = 32;
|
||||
desc.uniform_blocks[1].msl_buffer_n = 1;
|
||||
desc.views[0].storage_buffer.stage = SG_SHADERSTAGE_VERTEX;
|
||||
desc.views[0].storage_buffer.readonly = true;
|
||||
desc.views[0].storage_buffer.msl_buffer_n = 8;
|
||||
desc.views[1].texture.stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.views[1].texture.image_type = SG_IMAGETYPE_2D;
|
||||
desc.views[1].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT;
|
||||
desc.views[1].texture.multisampled = false;
|
||||
desc.views[1].texture.msl_texture_n = 0;
|
||||
desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
|
||||
desc.samplers[0].msl_sampler_n = 0;
|
||||
desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
||||
desc.texture_sampler_pairs[0].view_slot = 1;
|
||||
desc.texture_sampler_pairs[0].sampler_slot = 0;
|
||||
desc.label = "world_text_prog_shader";
|
||||
}
|
||||
return &desc;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
144
samples/shaders/overlays/world_text.glsl
Normal file
144
samples/shaders/overlays/world_text.glsl
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
// SPDX-FileCopyrightText: 2026 Erin Catto
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// World-space text shader. Glyph coverage plus a distance field halo, the two
|
||||
// channels of one atlas baked at the size labels draw at.
|
||||
//
|
||||
// One instance per glyph. Per-instance data (label anchor, pen rect, atlas
|
||||
// UVs, color) lives in a storage buffer indexed by
|
||||
// gl_InstanceIndex, the VS expands six vertices per instance from
|
||||
// gl_VertexIndex with no VBO/IBO bound, same scheme as line.glsl and
|
||||
// point.glsl. Quad corner order matches point.glsl:
|
||||
//
|
||||
// 0 -> (-1, -1) 3 -> (-1, -1)
|
||||
// 1 -> (+1, -1) 4 -> (+1, +1)
|
||||
// 2 -> (+1, +1) 5 -> (-1, +1)
|
||||
//
|
||||
// Glyphs are screen-aligned, not world-oriented: the anchor projects to
|
||||
// clip space and the quad expands in pixels around it. Labels stay readable
|
||||
// from any camera angle, which world-oriented text does not.
|
||||
//
|
||||
// Labels hold one pixel height whatever their distance, so a readout stays
|
||||
// legible across a scene the way the ImGui labels this replaced did. They
|
||||
// also ignore scene depth: a label names a thing, and a name you cannot read
|
||||
// because a wall moved in front of it is worse than one that floats.
|
||||
//
|
||||
// The halo is why the field is still here. A rasterized bitmap gives the crisp
|
||||
// body a distance field cannot at these sizes, but knows nothing about what
|
||||
// lies outside a glyph, and the fading pad needs exactly that. One fetch reads
|
||||
// both. The alternative in a UI draw list is re-emitting the whole string four
|
||||
// times, and that only ever buys a hard outline.
|
||||
|
||||
#pragma sokol @module world_text
|
||||
|
||||
#pragma sokol @ctype mat4 Mat4
|
||||
#pragma sokol @ctype vec4 Vec4
|
||||
|
||||
#pragma sokol @vs vs
|
||||
|
||||
layout(binding = 0)uniform ub_frame
|
||||
{
|
||||
mat4 view;
|
||||
mat4 proj;
|
||||
mat4 view_proj;
|
||||
mat4 inv_view_proj;
|
||||
vec4 camera_pos; // .xyz = pos, .w = time
|
||||
vec4 viewport; // .xy = size px, .zw = 1/size
|
||||
};
|
||||
|
||||
struct glyph_instance
|
||||
{
|
||||
vec4 anchor; // .xyz = label world anchor, .w unused
|
||||
vec4 rect; // .xy = pen offset in pixels, .zw = glyph size in pixels
|
||||
vec4 uv; // .xy = atlas uv min, .zw = atlas uv max
|
||||
vec4 color; // linear RGBA, not premultiplied
|
||||
};
|
||||
|
||||
layout(binding = 0) readonly buffer glyph_instances
|
||||
{
|
||||
glyph_instance instances[];
|
||||
};
|
||||
|
||||
out vec2 v_uv;
|
||||
flat out vec4 v_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
glyph_instance inst = instances[gl_InstanceIndex];
|
||||
|
||||
int index = gl_VertexIndex;
|
||||
float corner_x = ((index == 1)||(index == 2)||(index == 4)) ? 1.0 : -1.0;
|
||||
float corner_y = ((index == 2)||(index == 4)||(index == 5)) ? 1.0 : -1.0;
|
||||
vec2 corner = vec2(corner_x, corner_y) * 0.5 + 0.5; // 0..1 across the glyph cell
|
||||
|
||||
vec4 clip_c = view_proj * vec4(inst.anchor.xyz, 1.0);
|
||||
|
||||
// Snap the anchor to a whole pixel. Every glyph in a label then shares one
|
||||
// pixel phase, so the horizontal strokes they have in common land on the
|
||||
// grid together instead of each smearing by its own fraction of a pixel.
|
||||
vec2 anchor_px = ((clip_c.xy / clip_c.w) * 0.5 + 0.5) * viewport.xy;
|
||||
anchor_px = floor(anchor_px + 0.5);
|
||||
|
||||
// Pen space runs Y down like the atlas and like the glyph metrics that
|
||||
// produced the rect, clip space runs Y up, so flip on the way out. The rect
|
||||
// is already whole pixels, so with a snapped anchor the quad covers its
|
||||
// atlas cell one texel to one pixel.
|
||||
vec2 pen_px = inst.rect.xy + corner * inst.rect.zw;
|
||||
vec2 pos_px = anchor_px + vec2(pen_px.x, -pen_px.y);
|
||||
vec2 pos_ndc = pos_px * viewport.zw * 2.0 - 1.0;
|
||||
|
||||
// Back through the divide the rasterizer is about to do, so the snapped
|
||||
// pixel position survives and depth / clipping stay as projected.
|
||||
gl_Position = vec4(pos_ndc * clip_c.w, clip_c.z, clip_c.w);
|
||||
v_uv = mix(inst.uv.xy, inst.uv.zw, corner);
|
||||
v_color = inst.color;
|
||||
}
|
||||
#pragma sokol @end
|
||||
|
||||
#pragma sokol @fs fs
|
||||
|
||||
// Bindings are disjoint across storage buffers and textures for the whole
|
||||
// program, so the glyph buffer's binding=0 in the VS pushes the atlas up.
|
||||
#pragma sokol @image_sample_type tex_sdf float
|
||||
layout(binding = 1)uniform texture2D tex_sdf;
|
||||
|
||||
#pragma sokol @sampler_type smp_sdf filtering
|
||||
layout(binding = 0)uniform sampler smp_sdf;
|
||||
|
||||
layout(binding = 1)uniform ub_text_style
|
||||
{
|
||||
vec4 style_params; // .x = halo width in pixels, .y = on-edge value, .z = distance per pixel, .w = reserved
|
||||
vec4 halo_params; // .rgb = halo color, .a = halo strength at the glyph edge
|
||||
};
|
||||
|
||||
in vec2 v_uv;
|
||||
flat in vec4 v_color;
|
||||
out vec4 out_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
// R is glyph coverage, G a signed distance positive inside the glyph and
|
||||
// biased by the on-edge value the atlas was baked with.
|
||||
vec2 tap = texture(sampler2D(tex_sdf, smp_sdf), v_uv).rg;
|
||||
float d = tap.g - style_params.y;
|
||||
|
||||
// The body is the rasterizer's own coverage, sampled one texel to one pixel,
|
||||
// so it needs no reconstruction here. That is the whole reason for the
|
||||
// second channel: a distance field has to infer coverage from a smoothstep,
|
||||
// and at label sizes that ramp is a large part of a stem.
|
||||
float glyph = tap.r * v_color.a;
|
||||
|
||||
// The halo fades outward from the glyph edge instead of ending at a fixed
|
||||
// offset. A hard ring reads as a sticker outline and, worse, fills the
|
||||
// counter of an o at label sizes, where the ring closes in from both
|
||||
// sides. A falloff leaves the middle of the counter mostly clear.
|
||||
float halo = (1.0 - smoothstep(0.0, style_params.x * style_params.z, -d)) * halo_params.a;
|
||||
|
||||
// Glyph over halo, emitted premultiplied to match the blend state.
|
||||
float alpha = glyph + halo * (1.0 - glyph);
|
||||
vec3 rgb = v_color.rgb * glyph + halo_params.rgb * halo * (1.0 - glyph);
|
||||
out_color = vec4(rgb, alpha);
|
||||
}
|
||||
#pragma sokol @end
|
||||
|
||||
#pragma sokol @program prog vs fs
|
||||
5079
samples/stb_truetype.h
Normal file
5079
samples/stb_truetype.h
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1429,20 +1429,20 @@ void b3World_Draw( b3WorldId worldId, b3DebugDraw* draw, uint64_t maskBits )
|
|||
const char* name = b3FindName( &world->names, body->nameId );
|
||||
if ( name != NULL )
|
||||
{
|
||||
draw->DrawStringFcn( p, name, b3_colorOrange, draw->context );
|
||||
draw->DrawStringFcn( p, name, b3_colorWhite, draw->context );
|
||||
}
|
||||
}
|
||||
|
||||
if ( draw->drawMass && body->type == b3_dynamicBody )
|
||||
{
|
||||
b3Vec3 offset = { 0.1f, 0.1f, 0.1f };
|
||||
b3Vec3 offset = { 0.05f, 0.05f, 0.05f };
|
||||
|
||||
b3WorldTransform transform = { bodySim->center, bodySim->transform.q };
|
||||
draw->DrawTransformFcn( transform, draw->context );
|
||||
b3Pos p = b3TransformWorldPoint( transform, offset );
|
||||
|
||||
char buffer[32];
|
||||
snprintf( buffer, 32, " %.2f", body->mass );
|
||||
snprintf( buffer, 32, "%.2f", body->mass );
|
||||
draw->DrawStringFcn( p, buffer, b3_colorWhite, draw->context );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,9 +107,8 @@ static bool b3SensorQueryCallback( int proxyId, uint64_t userData, void* context
|
|||
b3World* world = queryContext->world;
|
||||
b3Shape* otherShape = b3Array_Get( world->shapes, shapeId );
|
||||
|
||||
// Mesh vs mesh is not supported
|
||||
if ( ( otherShape->type == b3_meshShape || otherShape->type == b3_heightShape ) &&
|
||||
( sensorShape->type == b3_meshShape || sensorShape->type == b3_heightShape ) )
|
||||
// Visitors must be convex.
|
||||
if ( b3IsConvex( otherShape->type ) == false )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,3 +153,8 @@ static inline bool b3ShouldQueryCollide( const b3Filter* shapeFilter, const b3Qu
|
|||
return ( shapeFilter->categoryBits & queryFilter->maskBits ) != 0 &&
|
||||
( shapeFilter->maskBits & queryFilter->categoryBits ) != 0;
|
||||
}
|
||||
|
||||
static inline bool b3IsConvex( b3ShapeType type )
|
||||
{
|
||||
return type == b3_sphereShape || type == b3_capsuleShape || type == b3_hullShape;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue