Skip to content

Commit 88331c7

Browse files
committed
initial
0 parents  commit 88331c7

File tree

91 files changed

+15045
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+15045
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vscode/

README-RUS.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
IFB-LIB — Библиотека для оптимизации графики
2+
===
3+
[Eng](./README.md) | [Rus](./README-RUS.md)
4+
**C# / C++** кроссплатформенная библиотека для оптимизации 3D-графики.
5+
***
6+
7+
## Оглавление
8+
9+
- [Возможности](#возможности)
10+
- [Демонстрация](#демонстрация)
11+
- [Установка](#установка)
12+
- [Обзор проектов](#обзор-проектов)
13+
- [C++ библиотека](#cpp-lib)
14+
- [C# библиотека](#cs-lib)
15+
- [Unity-пакет](#unity-package)
16+
17+
***
18+
19+
## Возможности
20+
21+
- **Кроссплатформенность**
22+
- > [Android arm64](https://ссылка_на_android_build)
23+
- > [Windows x64](https://ссылка_на_win64_build)
24+
25+
<br>
26+
27+
- **Потокобезопасность**`ConcurrentManagedMesh`, `ConcurrentFastUnityMesh`
28+
- **Простота API**`SimplifyMeshFast(...)`, `SimplifyMeshFastAsync(...)`, `MonoMeshSimplifier`
29+
- **Быстрая симплификация мешей в рантайме** — на основе алгоритмов [Zeux](https://github.com/zeux/meshoptimizer)
30+
- **Отсутствие зависимостей при сборке**
31+
- **[Поддержка Unity](https://ссылка_на_unity_package) и других C# приложений для работы с 3D**
32+
33+
***
34+
35+
## Демонстрация
36+
37+
**Исходная сцена**
38+
![Исходная сцена](/images/default_192k_tris.png)
39+
40+
**После симплификации**
41+
![Применение симплификации](/images/result.png)
42+
43+
> | Тип | Треугольники |
44+
> |----------|--------------|
45+
> | NONE | 191.8k |
46+
> | LOW | 124.0k |
47+
> | MEDIUM | 88.4k |
48+
> | HIGH | 66.9k |
49+
50+
**Пример отображения на устройстве**
51+
52+
> **LOW**
53+
> ![LOW](/images/device_0_low.png)
54+
55+
> **MEDIUM**
56+
> ![MEDIUM](/images/device_1_medium.png)
57+
58+
> **HIGH**
59+
> ![HIGH](/images/device_2_high.png)
60+
61+
***
62+
63+
## Установка
64+
65+
> **Unity**
66+
> - Требуется [UniTask](https://github.com/Cysharp/UniTask)
67+
> - Установите [ifb-lib Unity package](https://ссылка_На_unity_package)
68+
69+
<br>
70+
71+
> **Другие C# приложения**
72+
> - Скачайте и подключите [ifblib .NET библиотеку](https://ссылка_на_cs_сборку). Используйте её API.
73+
> - Для работы .NET-библиотеки требуется C++-библиотека. Скачайте и разместите [ifblib C++ библиотеку](https://ссылка_на_cpp_сборку) рядом с вашим исполняемым файлом.
74+
75+
***
76+
77+
## Обзор проектов
78+
79+
---
80+
81+
### C++ библиотека
82+
> [/ifb-lib-cpp/](./ifb-lib-cpp/)
83+
84+
### C# библиотека
85+
> [/ifb-lib-net/](./ifb-lib-net/)
86+
87+
### Unity-пакет
88+
> [/ifb-lib-unity/](./ifb-lib-unity/)

README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
IFB-LIB — Graphics Optimization Library
2+
===
3+
4+
[Eng](./README.md) | [Rus](./README-RUS.md)
5+
6+
7+
**C# / C++** cross-platform library for real-time 3D mesh optimization.
8+
9+
***
10+
11+
## Table of Contents
12+
13+
- [Features](#features)
14+
- [Demo](#demo)
15+
- [Installation](#installation)
16+
- [Project Overview](#project-overview)
17+
- [C++ Library](#cpp-lib)
18+
- [C# Library](#cs-lib)
19+
- [Unity Package](#unity-package)
20+
21+
***
22+
23+
## Features
24+
25+
- **Cross-platform**
26+
- > [Android arm64](https://link_to_android_build)
27+
- > [Windows x64](https://link_to_win64_build)
28+
29+
<br>
30+
31+
- **Thread-safe**`ConcurrentManagedMesh`, `ConcurrentFastUnityMesh`
32+
- **Simple API**`SimplifyMeshFast(...)`, `SimplifyMeshFastAsync(...)`, `MonoMeshSimplifier`
33+
- **Fast real-time mesh simplification** — powered by [Zeux's algorithm](https://github.com/zeux/meshoptimizer)
34+
- **No external dependencies required for build**
35+
- **[Unity support](https://link_to_unity_package)** and compatibility with other C# 3D applications
36+
37+
***
38+
39+
## Demo
40+
41+
**Original Scene**
42+
![Original Scene](/images/default_192k_tris.png)
43+
44+
**After Simplification**
45+
![Simplified Scene](/images/result.png)
46+
47+
> | Mode | Triangles |
48+
> |--------|-------------|
49+
> | NONE | 191.8k |
50+
> | LOW | 124.0k |
51+
> | MEDIUM | 88.4k |
52+
> | HIGH | 66.9k |
53+
54+
**Device Preview**
55+
56+
> **LOW**
57+
> ![LOW](/images/device_0_low.png)
58+
59+
> **MEDIUM**
60+
> ![MEDIUM](/images/device_1_medium.png)
61+
62+
> **HIGH**
63+
> ![HIGH](/images/device_2_high.png)
64+
65+
***
66+
67+
## Installation
68+
69+
> **Unity**
70+
> - Requires [UniTask](https://github.com/Cysharp/UniTask)
71+
> - Install the [ifb-lib Unity package](https://link_to_unity_package)
72+
73+
<br>
74+
75+
> **Other C# Applications**
76+
> - Download and reference the [ifblib .NET library](https://link_to_cs_build). Use its API.
77+
> - The .NET library requires the native C++ library. Download and place the [ifblib C++ build](https://link_to_cpp_build) next to your executable.
78+
79+
***
80+
81+
## Project Overview
82+
83+
---
84+
85+
### C++ Library
86+
> [/ifb-lib-cpp/](./ifb-lib-cpp/)
87+
88+
### C# Library
89+
> [/ifb-lib-net/](./ifb-lib-net/)
90+
91+
### Unity Package
92+
> [/ifb-lib-unity/](./ifb-lib-unity/)

ifb-lib-cpp/.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Help tools that honor '.gitignore' (redundant for Git itself).
2+
/.git
3+
4+
/CMakeUserPresets.json
5+
6+
# Common build directories
7+
/build*/
8+
9+
# CI jobs that run in symlinked trees produce these artifacts.
10+
/real_work/
11+
/work
12+
13+
# MacOS Finder files.
14+
.DS_Store
15+
16+
# Python compile output.
17+
*.pyc
18+
19+
# See Utilities/Sphinx/tutorial_archive.cmake
20+
/Help/_generated
21+
22+
# CLion work directory
23+
/.idea/
24+
# CLion build directories
25+
/cmake-build-*/
26+
27+
# QtCreator files.
28+
/CMakeLists.txt.user*
29+
30+
# Visual Studio Code
31+
/.vscode/
32+
/.cache/
33+
34+
# Visual Studio work directory
35+
/.vs/
36+
# Visual Studio build directory
37+
/out/
38+
39+
# clang-tidy output
40+
/clang-tidy-fixes.patch

ifb-lib-cpp/CMakeLists.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
cmake_minimum_required (VERSION 3.8)
2+
3+
if (EXISTS "${CMAKE_BINARY_DIR}/CMakeCache.txt")
4+
file(REMOVE "${CMAKE_BINARY_DIR}/CMakeCache.txt")
5+
endif()
6+
7+
if (POLICY CMP0141)
8+
cmake_policy(SET CMP0141 NEW)
9+
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
10+
endif()
11+
12+
if(UNIX AND NOT APPLE)
13+
# for android support when build in linux *.so (linux shared library)
14+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
15+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
16+
endif()
17+
18+
project ("ifblib")
19+
20+
# Add source to this project's executable.
21+
file(GLOB_RECURSE SOURCES "src/*.cpp")
22+
#
23+
# -DBUILD_AS_LIBRARY=ON -DBUILD_SHARED=ON
24+
25+
option(BUILD_AS_LIBRARY "Build as library" OFF)
26+
option(BUILD_SHARED "Build as dynamic library" OFF)
27+
option(BUILD_DEBUG "Build as Debug" OFF)
28+
29+
message(STATUS "BUILD_AS_LIBRARY = ${BUILD_AS_LIBRARY}")
30+
message(STATUS "BUILD_SHARED = ${BUILD_SHARED}")
31+
message(STATUS "BUILD_DEBUG = ${BUILD_DEBUG}")
32+
33+
##########
34+
if(BUILD_AS_LIBRARY)
35+
if(BUILD_SHARED)
36+
set(LIB_TYPE SHARED)
37+
else()
38+
set(LIB_TYPE STATIC)
39+
endif()
40+
add_library(ifblib ${LIB_TYPE} ${SOURCES})
41+
else()
42+
add_executable (ifblib ${SOURCES})
43+
endif()
44+
45+
if(BUILD_DEBUG)
46+
target_compile_definitions(ifblib PUBLIC IFB_LIB_DEBUG)
47+
endif()
48+
49+
if (CMAKE_VERSION VERSION_GREATER 3.12)
50+
set_property(TARGET ifblib PROPERTY CXX_STANDARD 20)
51+
endif()

0 commit comments

Comments
 (0)