Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0d5efd0
add numpy interfaces
koide3 Dec 27, 2025
36e6e07
more imgui bindings
koide3 Dec 28, 2025
5cbaada
return viewer shader setting reference
koide3 Dec 29, 2025
648bb84
Merge branch 'master' of github.com:koide3/iridescence into pyrev
koide3 Dec 29, 2025
56f1a13
refactor shader setting
koide3 Dec 29, 2025
c3071e9
vertex colormap
koide3 Dec 29, 2025
d227bf9
move camera along z
koide3 Dec 29, 2025
4a74972
fix vertex color
koide3 Dec 29, 2025
5c479ed
replace shared_ptr with unique_ptr
koide3 Dec 29, 2025
2683eff
rapidhash
koide3 Dec 29, 2025
292eaee
replace string name with hash name in glsl_shader
koide3 Dec 30, 2025
b1532bf
flat shader parameters
koide3 Dec 30, 2025
8b091a9
refactor and warn
koide3 Dec 30, 2025
4775081
tune ssao intensity
koide3 Dec 30, 2025
5d669b8
remove Eigen::aligned_allocator and fix array uniform bug
koide3 Dec 30, 2025
5213f74
support int and float arrays
koide3 Dec 30, 2025
2e1e406
add fullscreen
koide3 Dec 30, 2025
bdabbec
hovered and cmap
koide3 Dec 30, 2025
562b200
fix bugs
koide3 Dec 30, 2025
9794b88
install stubs
koide3 Dec 30, 2025
135e633
update README
koide3 Dec 30, 2025
508cd1d
update docs
koide3 Dec 30, 2025
3c0050a
remove link to doc
koide3 Dec 30, 2025
f478563
doc
koide3 Dec 30, 2025
97afa9e
include global funcs
koide3 Dec 30, 2025
48517cd
doc ci
koide3 Dec 30, 2025
1f8af31
add links to API docs
koide3 Dec 30, 2025
9af4da7
trigger on only tags
koide3 Dec 30, 2025
a860482
fix ppa
koide3 Dec 30, 2025
87fe2a0
imgui windows
koide3 Dec 31, 2025
e7de001
add rainbow settings
koide3 Dec 31, 2025
f73fb5c
japanese docs
koide3 Dec 31, 2025
b9571c5
fix site url
koide3 Dec 31, 2025
0578a6f
yodan
koide3 Dec 31, 2025
965c25e
add image
koide3 Dec 31, 2025
923d5fc
fix typo
koide3 Dec 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: doc

on:
push:
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
gendoc:
name: Generate documentation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com

- name : Install dependencies
run: sudo apt-get install -y git cmake build-essential doxygen graphviz python3-dev python3-pip python3-pybind11 pybind11-dev libglm-dev libglfw3-dev libpng-dev libjpeg-dev libeigen3-dev python3-numpy python3-sphinx python3-sphinx-rtd-theme

- name: Install python dependencies
run: python -m pip install pybind11 mkdocs mkdocs-material

- name: Generate documentation
run: cd docs && make all

- uses: actions/upload-artifact@v4
with:
name: site
path: ./site/*

- name: Deploy documentation
run: cd docs && make deploy
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ add_library(iridescence
thirdparty/imgui/backends/imgui_impl_opengl3.cpp
# glk
src/glk/path_std.cpp
src/glk/hash.cpp
src/glk/mesh.cpp
src/glk/mesh_model.cpp
src/glk/lines.cpp
Expand Down Expand Up @@ -186,6 +187,7 @@ add_library(iridescence
src/guik/camera/projection_control.cpp
src/guik/camera/basic_projection_control.cpp
src/guik/viewer/plot_data.cpp
src/guik/viewer/shader_setting.cpp
src/guik/viewer/light_viewer.cpp
src/guik/viewer/light_viewer_context.cpp
src/guik/viewer/light_viewer_context_util.cpp
Expand All @@ -205,6 +207,7 @@ target_include_directories(iridescence PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/implot>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/portable-file-dialogs>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gl3w>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/rapidhash>
$<INSTALL_INTERFACE:include/iridescence>
)
target_link_libraries(iridescence PUBLIC
Expand Down Expand Up @@ -351,6 +354,9 @@ if(BUILD_PYTHON_BINDINGS)
LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}
COMPONENT python
)

# install stubs in src/python/stubs
install(DIRECTORY src/python/stubs/ DESTINATION ${PYTHON_INSTALL_DIR})
endif()

#############
Expand Down
94 changes: 44 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
![Iridescence](docs/assets/logo.png)

**Iridescence** is a light-weight visualization library for rapid prototyping of 3D algorithms. This library is designed for accelerating personal research and development projects (mainly focusing on point-cloud-related algorithms) and is NOT intended to be a general-purpose visualization library with rich rendering capabilities.
**Iridescence** is a light-weight visualization library for rapid prototyping of 3D algorithms. This library is designed for accelerating personal research and development projects (mainly focuing on point-cloud-related algorithms) and is NOT intended to be a general-purpose visualization library with rich rendering capabilities.

[![Build](https://github.com/koide3/iridescence/actions/workflows/build.yml/badge.svg)](https://github.com/koide3/iridescence/actions/workflows/build.yml) on Ubuntu 20.04 / 22.04 / 24.04
**[Documentation (en)](https://koide3.github.io/iridescence/)**, **[Documentation (日本語)](https://koide3.github.io/iridescence/ja)**, **[API(C++)](https://koide3.github.io/iridescence/doc_cpp/), [API(Python)](https://koide3.github.io/iridescence/doc_py/)**

[![ppa](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.launchpad.net%2F1.0%2F~koide3%2F%2Barchive%2Fubuntu%2Firidescence%3Fws.op%3DgetPublishedSources%26status%3DPublished&query=entries.0.source_package_version&label=ppa)](https://launchpad.net/~koide3/+archive/ubuntu/iridescence) [![PyPI - Version](https://img.shields.io/pypi/v/pyridescence)](https://pypi.org/project/pyridescence/) [![Build](https://github.com/koide3/iridescence/actions/workflows/build.yml/badge.svg)](https://github.com/koide3/iridescence/actions/workflows/build.yml) on Ubuntu 22.04 / 24.04 and Windows

## Features

Expand All @@ -24,68 +26,59 @@ See **[documentation](https://koide3.github.io/iridescence/)** for details.
- [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) ([MIT license](https://github.com/CedricGuillemet/ImGuizmo/blob/master/LICENSE))
- [implot](https://github.com/epezent/implot) ([MIT license](https://github.com/epezent/implot/blob/master/LICENSE))
- [Eigen](https://eigen.tuxfamily.org/index.php) ([MPL2 license](https://www.mozilla.org/en-US/MPL/2.0/))
- [rapidhash](https://github.com/Nicoshev/rapidhash) ([MIT license](https://github.com/Nicoshev/rapidhash/blob/master/LICENSE))
- [portable-file-dialogs](https://github.com/samhocevar/portable-file-dialogs) ([WTFPL license](https://github.com/samhocevar/portable-file-dialogs/blob/main/COPYING))

## Installation

### Install from source
### C++ : Install from [PPA](https://launchpad.net/~koide3/+archive/ubuntu/iridescence) (Ubuntu)

```bash
# Install dependencies
sudo apt-get install -y libglm-dev libglfw3-dev libpng-dev libjpeg-dev libeigen3-dev

# Build and install Iridescence
git clone https://github.com/koide3/iridescence --recursive
mkdir iridescence/build && cd iridescence/build
cmake ..
make -j
sudo make install

# [Optional] Build and install python bindings
cd ..
pip install .

# [Optional2] Install stubs for autocomplete
pip install pybind11-stubgen

cd ~/.local/lib/python3.12/site-packages
# If you are using a virtual environment, you can find the path with:
# cd $(dirname $(which python))/../lib/python3.12/site-packages

pybind11-stubgen -o . pyridescence
# Install from PPA
sudo add-apt-repository -y ppa:koide3/iridescence
sudo apt install libiridescence-dev
```

### Install from [PPA](https://github.com/koide3/ppa) [AMD64, ARM64]
### Python : Install from [PyPI](https://pypi.org/project/pyridescence/) (Ubuntu and Windows)

#### Ubuntu 24.04
Note : Source installation is required for Python 3.14.

```bash
curl -s --compressed "https://koide3.github.io/ppa/ubuntu2404/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/ubuntu2404 ./" | sudo tee /etc/apt/sources.list.d/koide3_ppa.list

sudo apt update && sudo apt install -y libiridescence-dev
# Install from PyPI
pip install pyridescence
```

#### Ubuntu 22.04
<details>
<summary>Install from source</summary>


### C++ : Install from source (Ubuntu)

```bash
curl -s --compressed "https://koide3.github.io/ppa/ubuntu2204/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/ubuntu2204 ./" | sudo tee /etc/apt/sources.list.d/koide3_ppa.list
# Install dependencies
sudo apt-get install -y libglm-dev libglfw3-dev libpng-dev libjpeg-dev libeigen3-dev

sudo apt update && sudo apt install -y libiridescence-dev
# Build and install Iridescence
git clone https://github.com/koide3/iridescence --recursive
mkdir iridescence/build && cd iridescence/build
cmake ..
make -j
sudo make install
```

#### Ubuntu 20.04
### Python : Install from source

```bash
curl -s --compressed "https://koide3.github.io/ppa/ubuntu2004/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/ubuntu2004 ./" | sudo tee /etc/apt/sources.list.d/koide3_ppa.list

sudo apt update && sudo apt install -y libiridescence-dev
git clone https://github.com/koide3/iridescence --recursive
cd iridescence
pip install .
```

</details>

## Usage

## Use Iridescence in your cmake project
### C++ : Use Iridescence in your cmake project

```cmake
# Find package
Expand All @@ -101,7 +94,7 @@ target_link_libraries(your_program
```


## Minimum example
### C++ : Minimum example

C++:
```cpp
Expand All @@ -128,8 +121,10 @@ int main(int argc, char** argv) {
// Spin the viewer until it gets closed
while (viewer->spin_once()) {
// Objects to be rendered are called "drawables" and managed with unique names.
// Here, solid and wire spheres are registered to the viewer respectively with the "Rainbow" and "FlatColor" coloring schemes.
// The "Rainbow" coloring scheme encodes the height of each fragment using the turbo colormap by default.
// Here, solid and wire spheres are registered to the viewer respectively with
// the "Rainbow" and "FlatColor" coloring schemes.
// The "Rainbow" coloring scheme encodes the height of each fragment using the
// turbo colormap by default.
Eigen::AngleAxisf transform(angle, Eigen::Vector3f::UnitZ());
viewer->update_drawable("sphere", glk::Primitives::sphere(), guik::Rainbow(transform));
viewer->update_drawable("wire_sphere", glk::Primitives::wire_sphere(), guik::FlatColor({0.1f, 0.7f, 1.0f, 1.0f}, transform));
Expand All @@ -139,8 +134,7 @@ int main(int argc, char** argv) {
}
```

<details>
<summary>Python version</summary>
### Python : Minimum example

```py
#!/usr/bin/python3
Expand Down Expand Up @@ -171,16 +165,16 @@ viewer.register_ui_callback('ui', ui_callback)
# Spin the viewer until it gets closed
while viewer.spin_once():
# Objects to be rendered are called "drawables" and managed with unique names.
# Here, solid and wire spheres are registered to the viewer respectively with the "Rainbow" and "FlatColor" coloring schemes.
# The "Rainbow" coloring scheme encodes the height of each fragment using the turbo colormap by default.
# Here, solid and wire spheres are registered to the viewer respectively with
# the "Rainbow" and "FlatColor" coloring schemes.
# The "Rainbow" coloring scheme encodes the height of each fragment using the
# turbo colormap by default.
transform = numpy.identity(4)
transform[:3, :3] = Rotation.from_rotvec([0.0, 0.0, angle]).as_matrix()
viewer.update_drawable('sphere', glk.primitives.sphere(), guik.Rainbow(transform))
viewer.update_drawable('wire_sphere', glk.primitives.wire_sphere(), guik.FlatColor(0.1, 0.7, 1.0, 1.0, transform))

```
</details>


![example_01](https://user-images.githubusercontent.com/31344317/210127177-31630466-f8a1-45b6-8bc7-2fdd2e4c9548.gif)

Expand Down
14 changes: 11 additions & 3 deletions data/shader/rainbow.vert
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,28 @@ uniform mat4 projection_matrix;
// colormode = 1 : material_color
// colormode = 2 : vert_color
// colormode = 3 : texture_color
// colormode = 4 : vert_cmap (color map)
uniform int color_mode;
uniform vec4 material_color;
uniform sampler2D colormap_sampler;
uniform sampler2D texture_sampler;

uniform vec2 z_range;
uniform vec2 cmap_range;
uniform vec3 colormap_axis;

in vec3 vert_position;
in vec4 vert_color;
in vec2 vert_texcoord;
in vec3 vert_normal;
in float vert_cmap;

out vec4 frag_color;
out vec2 frag_texcoord;
out vec3 frag_normal;

vec4 rainbow(vec3 position) {
float p = (dot(position, colormap_axis) - z_range[0]) / (z_range[1] - z_range[0]);
vec4 rainbow(float val, vec2 range) {
float p = (val - range[0]) / (range[1] - range[0]);
return texture(colormap_sampler, vec2(p, 0.0));
}

Expand All @@ -49,7 +52,7 @@ void main() {

switch(color_mode) {
case 0:
frag_color = rainbow(frag_world_position);
frag_color = rainbow(dot(frag_world_position, colormap_axis), z_range);
frag_color.a = material_color.a;
break;

Expand All @@ -64,6 +67,11 @@ void main() {
case 3:
frag_texcoord = vert_texcoord;
break;

case 4:
frag_color = rainbow(vert_cmap, cmap_range);
frag_color.a = material_color.a;
break;
}

if(normal_enabled) {
Expand Down
2 changes: 1 addition & 1 deletion data/shader/ssao.frag
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ void main() {
return;
}

final_color = frag_color * (1 - frag_occlusion);
final_color = frag_color * (1 - clamp(frag_occlusion - 0.2, 0.0, 1.0));
}
Loading
Loading