-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from bean-mhm/documentation
0.4.3-alpha + updated documentation
- Loading branch information
Showing
79 changed files
with
640 additions
and
974 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 --> | ||
<a name="readme-top"></a> | ||
<!-- | ||
|
@@ -28,10 +29,6 @@ | |
|
||
|
||
|
||
### NOTE: This page is outdated and demands rewriting. I'm currently working on it. | ||
|
||
|
||
|
||
<!-- TABLE OF CONTENTS --> | ||
<details> | ||
<summary>Table of Contents</summary> | ||
|
@@ -53,30 +50,31 @@ | |
<!-- INTRODUCTION --> | ||
## Introduction | ||
|
||
RealBloom lets you simulate physically accurate bloom effect for your 3D renders, or any HDR image. | ||
RealBloom is a physically accurate bloom simulation software for adding more realism to 3D renders and HDR images in general. | ||
|
||
![RealBloom Screenshot](images/screenshot3.png) | ||
![RealBloom Screenshot](images/1-main.png) | ||
|
||
![RealBloom Screenshot](images/screenshot4.png) | ||
![RealBloom Screenshot](images/2-main-conv.png) | ||
|
||
RealBloom was started as a hobby project in late August 2022. This project was inspired by [AngeTheGreat's video](https://www.youtube.com/watch?v=QWqb5Gewbx8) on bloom and how to simulate it. **I highly recommend watching this video** in order to have a basic understanding of how RealBloom works. Make sure to check out their [GitHub page](https://github.com/ange-yaghi) and their other projcets as well! | ||
RealBloom was started as a hobby project in late August 2022, inspired by [AngeTheGreat's video](https://www.youtube.com/watch?v=QWqb5Gewbx8) on bloom and how to simulate it. **I highly recommend watching this video** in order to have a basic understanding of how RealBloom works. Make sure to check out their [GitHub page](https://github.com/ange-yaghi) and their other projcets as well! | ||
|
||
The ultimate goal of writing this project was to achieve more realism in 3D renders that contain bright spots on dark backgrounds. For example, the sun in a blue sky, a car headlight at night, bright lights at a concert, or a flashlight pointing directly at the camera. You can learn about some other lens effects such as [Lens Flare](https://en.wikipedia.org/wiki/Lens_flare) and [Bokeh](https://en.wikipedia.org/wiki/Bokeh). If you're a [Blender](https://blender.org/) user like myself, you might want to watch [this video](https://www.youtube.com/watch?v=UDvuhuU9tFg) on applying a custom bokeh effect in Blender. The custom bokeh effect can be used alongside convolutional bloom to achieve a more life-like render. | ||
The ultimate goal is to achieve more realism in 3D renders that contain bright spots on dark backgrounds. For example, the sun in a blue sky, a car headlight at night, bright lights at a concert, a flashlight pointing directly at the camera, you name it. | ||
|
||
### How It's Made | ||
|
||
RealBloom is written in C++ using Visual Studio 2022. The target platform is Windows. However, considering the fact that all the libraries used and most of the code for RealBloom are platform-independent, it should be fairly easy to port it to another platform. I personally don't plan on doing that. | ||
RealBloom is written in C++ using Visual Studio 2022. The target platform is Windows. However, considering the fact that all the libraries used and most of the code for RealBloom are platform-independent, it should be fairly easy to port it to another platform. | ||
|
||
RealBloom uses the following libraries: | ||
| Library | Used for | | ||
|--|--| | ||
| [FFTW](https://www.fftw.org/) | Generating diffraction patterns | | ||
| [GLEW](https://glew.sourceforge.net/) | OpenGL extensions | | ||
| [GLFW](https://www.glfw.org/) | Window and context creation for use in ImGui | | ||
| [Dear ImGui](https://github.com/ocornut/imgui) | Graphical user interface | | ||
| [LibTIFF](https://libtiff.gitlab.io/libtiff/) | Reading and writing TIFF image files | | ||
| [LodePNG](https://lodev.org/lodepng/) | Reading and writing PNG image files | | ||
| [OpenColorIO](https://opencolorio.org/) | Color management | | ||
| [OpenImageIO](https://sites.google.com/site/openimageio/) | Reading and writing images | | ||
| [PocketFFT](https://github.com/mreineck/pocketfft) | 2D Fast Fourier Transforms | | ||
| [NFD](https://github.com/mlabbe/nativefiledialog) | Native file dialogs | | ||
| [Rapidcsv](https://github.com/d99kris/rapidcsv) | Parsing CSV files | | ||
| [inih](https://github.com/jtilly/inih) | Parsing config files | | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
@@ -86,13 +84,7 @@ RealBloom uses the following libraries: | |
<!-- RUNNING --> | ||
## Running RealBloom | ||
|
||
To run RealBloom, [Visual C++ Runtime](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) needs to be installed. Chances are you already have it installed, but regardless, a 64-bit version of the installer is included with every release build, in the `prerequisites` folder. | ||
|
||
You can get the latest release [here](https://github.com/bean-mhm/realbloom/releases). | ||
|
||
### Recommended Specs | ||
|
||
To perform convolutional bloom, you need powerful hardware. My recommendation would be a Windows 10/11 PC with a high-end GPU. If you have a dedicated GPU, always use that for convolution, instead of the CPU. RealBloom doesn't use a lot of RAM. | ||
[Microsoft Visual C++ Runtime](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) is required to run RealBloom. Chances are you already have it installed, though. To get RealBloom, you can [download the latest release here](https://github.com/bean-mhm/realbloom/releases). | ||
|
||
### Minimum Requirements | ||
|
||
|
@@ -102,16 +94,14 @@ You can get the latest release [here](https://github.com/bean-mhm/realbloom/rele | |
|
||
- GPU with OpenGL 3.2 support | ||
|
||
My Specs: As the developer, RealBloom runs quite well on my laptop with a Ryzen 7 3750H, a GTX 1650, and 16 GB of RAM. | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
|
||
|
||
<!-- USAGE --> | ||
## Using RealBloom | ||
|
||
Check out [this page](USAGE.md) for a detailed step-by-step tutorial on getting started with RealBloom. | ||
Check out [this page](USAGE.md) for a step-by-step tutorial on getting started with RealBloom. This tutorial will cover most of what you need to know. | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
|
@@ -132,25 +122,28 @@ The project was made for Windows and built with MSVC, so you're going to need a | |
|
||
2. Open the solution `RealBloomCPP.sln` in Visual Studio. | ||
|
||
3. `RealBloomCPP` is the main project, while `RealBloomGPUConv` is a helper program that gets used by the main program.* | ||
3. `RealBloomCPP` is the main project, while `RealBloomGPUConv` is a GPU helper program that gets used by the main program. | ||
|
||
4. Build the solution and run `RealBloom.exe`. Feel free to explore and play with the code! | ||
|
||
>*`RealBloomGPUConv.exe` takes an input file containing buffers and parameters required for GPU convolution, performs convolution, then writes the result to an output file which gets read by `RealBloom.exe`. | ||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
|
||
|
||
<!-- ROADMAP --> | ||
## Roadmap | ||
|
||
- [ ] Color Management System | ||
- [ ] OpenEXR support | ||
- [x] Color Management System | ||
- [x] OpenEXR support | ||
- [x] Command Line Interface | ||
- [ ] GPU FFT Convolution | ||
- [ ] GPU Dispersion | ||
- [ ] GPU Diffraction Pattern | ||
- [ ] GPU Image Transforms | ||
- [ ] Node-based workflow | ||
- [ ] Support for animated apertures, kernels and input images | ||
- [ ] ~~Support for animated apertures, kernels and input images~~ | ||
|
||
See the [open issues](https://github.com/bean-mhm/realbloom/issues) for a full list of proposed features (and known issues). | ||
See [open issues](https://github.com/bean-mhm/realbloom/issues) for a full list of proposed features (and known issues). | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
|
@@ -160,13 +153,13 @@ See the [open issues](https://github.com/bean-mhm/realbloom/issues) for a full l | |
|
||
I have in mind to make RealBloom's interface more generic and robust by making it node-based. Here's the concept represented using Blender's node system: | ||
|
||
![Node-based approach](images/node-based.png) | ||
![Node-based approach](images/3-nodes.png) | ||
|
||
Unfortunately, I can't afford the time to work on this as of now, because of school and other things in life. However, I do plan on doing it after I get into a university. If you do have the time and some knowledge on node-based applications, feel free to fork the repo and work on it, which would be really appreciated! | ||
Unfortunately, I can't afford the time to work on this as of now, but I do plan on doing it whenever possible. If you do have the time and some knowledge on node-based applications, feel free to fork the repo and work on it, which would be really appreciated! | ||
|
||
For some initial ideas, there could be a specific XML format for representing nodes, a core program that runs a node-tree, and a GUI program that displays the nodes and allows for creating, importing, and exporting node trees, as well as using the core program to run them and show the status. | ||
For some initial ideas, there could be a specific text format - based on XML, JSON, or anything else - for representing nodes, a core library that runs a node-tree, and a GUI for creating, managing, and displaying nodes. | ||
|
||
Nodes should have unique IDs, cached buffers - *with their own unique IDs* - that only get reprocessed when the node's input parameters change, status and progress indicators, etc. You can see some example nodes in the image above. | ||
Nodes could have unique IDs, cached buffers that only get reprocessed when the node's input parameters change, status and progress indicators, etc. You can see some example nodes in the image above. | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
|
@@ -202,7 +195,9 @@ Distributed under the [AGPL-3.0 license](https://github.com/bean-mhm/realbloom/b | |
<!-- CONTACT --> | ||
## Contact | ||
|
||
Harry Bean - [[email protected]](mailto:[email protected]) | ||
Harry Bean (Developer) | ||
- Email: [[email protected]](mailto:[email protected]) | ||
- Discord: `!bean#0446` | ||
|
||
Project Link: [https://github.com/bean-mhm/realbloom](https://github.com/bean-mhm/realbloom) | ||
|
||
|
@@ -214,3 +209,4 @@ Project Link: [https://github.com/bean-mhm/realbloom](https://github.com/bean-mh | |
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> | ||
[product-screenshot]: images/screenshot.png | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# This is a script for using RealBloom's CLI to apply convolutional bloom on a sequence of frames. | ||
# https://github.com/bean-mhm/realbloom | ||
|
||
import subprocess | ||
import time | ||
|
||
# Paths | ||
rb_path = "path to RealBloom.exe" | ||
frames_dir = "path to the folder containing the frames, must end with a (back)slash" | ||
kernel_path = "path to the kernel" | ||
output_dir = "path to the folder containing the output frames, must end with a (back)slash" | ||
|
||
# Frames | ||
frame_start = 1 | ||
frame_end = 50 | ||
|
||
# Example: frame0001.exr | ||
frame_prefix = "frame" | ||
frame_length = 4 | ||
frame_suffix = ".exr" | ||
|
||
# Color Spaces (w = working space) | ||
frames_cs = "w" | ||
kernel_cs = "w" | ||
output_cs = "w" | ||
|
||
# Additional Arguments | ||
arguments = "--kernel-contrast 0.05 --kernel-crop 0.8 --autoexp --mix 0.15" | ||
|
||
""" | ||
Arguments: | ||
--input, -i * Input filename | ||
--input-space, -a * Input color space | ||
--kernel, -k * Kernel filename | ||
--kernel-space, -b * Kernel color space | ||
--output, -o * Output filename | ||
--output-space, -c * Output color space | ||
--kernel-exposure, -e Kernel exposure [def: 0] | ||
--kernel-contrast, -f Kernel contrast [def: 0] | ||
--kernel-rotation, -r Kernel rotation [def: 0] | ||
--kernel-scale, -s Kernel scale [def: 1] | ||
--kernel-crop, -q Kernel crop [def: 1] | ||
--kernel-center, -u Kernel center [def: 0.5,0.5] | ||
--threshold, -t Threshold [def: 0] | ||
--knee, -w Threshold knee [def: 0] | ||
--autoexp, -n Auto-Exposure | ||
--input-mix, -x Input mix (additive blending) | ||
--conv-mix, -y Output mix (additive blending) | ||
--mix, -m Blend between input and output (normal blending) [def: 1] | ||
--conv-exposure, -z Conv. output exposure [def: 0] | ||
--verbose, -v Enable verbose logging | ||
""" | ||
|
||
for i in range(frame_start, frame_end + 1): | ||
filename = frame_prefix + str(i).zfill(frame_length) + frame_suffix | ||
command = "\"{}\" conv -i \"{}\" -a \"{}\" -k \"{}\" -b \"{}\" -o \"{}\" -c \"{}\" {}" | ||
command = command.format( | ||
rb_path, | ||
frames_dir + filename, | ||
frames_cs, | ||
kernel_path, | ||
kernel_cs, | ||
output_dir + filename, | ||
output_cs, | ||
arguments | ||
) | ||
start = time.time() | ||
subprocess.call(command) | ||
end = time.time() | ||
print(filename + " done in {:.1f} ms".format((end - start) * 1000.0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
#include "Async.h" | ||
|
||
std::unordered_map<std::string, void*> Async::s_shared; | ||
std::mutex Async::s_sharedMutex; | ||
std::unordered_map<std::string, void*> Async::S_SHARED; | ||
std::mutex Async::S_SHARED_MUTEX; | ||
|
||
std::deque<std::packaged_task<void()>> Async::s_tasks; | ||
std::mutex Async::s_tasksMutex; | ||
std::deque<std::packaged_task<void()>> Async::S_TASKS; | ||
std::mutex Async::S_TASKS_MUTEX; | ||
|
||
void Async::schedule(std::function<void()> job) | ||
{ | ||
std::packaged_task<void()> task(job); | ||
{ | ||
std::lock_guard<std::mutex> lock(s_tasksMutex); | ||
s_tasks.push_back(std::move(task)); | ||
std::lock_guard<std::mutex> lock(S_TASKS_MUTEX); | ||
S_TASKS.push_back(std::move(task)); | ||
} | ||
} | ||
|
||
void Async::putShared(std::string key, void* value) | ||
{ | ||
std::lock_guard<std::mutex> lock(s_sharedMutex); | ||
s_shared[key] = value; | ||
std::lock_guard<std::mutex> lock(S_SHARED_MUTEX); | ||
S_SHARED[key] = value; | ||
} | ||
|
||
void* Async::getShared(std::string key) | ||
{ | ||
if (s_shared.contains(key)) | ||
return s_shared[key]; | ||
if (S_SHARED.contains(key)) | ||
return S_SHARED[key]; | ||
return nullptr; | ||
} |
Oops, something went wrong.