Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
naavis committed Feb 20, 2021
2 parents 48ad57e + b657251 commit 89a159c
Show file tree
Hide file tree
Showing 116 changed files with 47,998 additions and 2,114 deletions.
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
build/*
build/
build-*/
.vscode/*
src/version.h
Testing/
.vs/*
**/*.user
*.json
**/.qmake.stash
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,112 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 3.0.0 - 2021-02-21

### Added

- Created a realistic sky and sun model based on Hosek-Wilkie and Preetham papers
- Simulation rate shown in status bar
- Ice crystals now have adjustable pyramidal caps
- Possibility to save and load simulations
- Added controls for prism face distances from the crystal C-axis
- Preview window for crystal shape and orientation
- Better logging and error handling
- Checkbox to enable or disable a crystal population

### Changed

- Forced application to use native desktop OpenGL instead of ANGLE or software renderer
- Build system switched to qmake from CMake
- Rewrote most of the GUI code to use Qt model/view architecture
- Triangle normals are now cached during raytracing
- The settings groups in the side panel are now collapsible
- Adjusting sliders with arrow kys now uses smaller steps
- Light is now allowed to bounce inside ice crystal for a 100 times instead of 10

### Fixed

- Fixed bug where intensity of halos changed with rays per frame setting
- Fixed a tiny raytracing artifact in the middle of the view

## 2.4.0 - 2019-07-29

### Added

- Show error dialog and exit if GPU does not support OpenGL 4.4

### Fixed

- Bug where changing multiple scattering probability did not trigger a new
render if maximum iterations were reached
- Crashing on Intel GPUs with Linux and Mesa3D

## 2.3.1 - 2019-07-14

### Fixed

- Build configuration bug where resources were not being linked on Linux

## 2.3.0 - 2019-07-13

### Added

- Added menu bar with option to save simulation result as image
- Added slider for setting the probability of simple double scattering

### Changed

- Replaced Add Population and Remove Population texts with icons

## 2.2.0 - 2019-07-09

### Added

- Created an application icon for HaloRay
- Added possibility to add preset crystal populations

### Changed

- Disabled "Remove population" button when there is only one population in simulation
- Added multiple crystal populations by default

## 2.1.1 - 2019-07-08

### Fixed

- Fixed bug where removing the only crystal population caused the UI controls not to work anymore

## 2.1.0 - 2019-07-07

### Added

- Gave main window an initial size hint
- Support for multiple crystal populations

### Changed

- Made sidebar scrollable when the window is small enough
- Made UI show field of view in degrees
- Limited field of view for stereographic, rectilinear and orthographic projections

### Fixed

- Fixed bug where field of view sometimes did not update correctly when choosing a new projection

## 2.0.0 - 2019-07-02

### Changed

- Replaced Nuklear UI with Qt

## 1.1.0 - 2019-06-17

### Changed

- Renamed C-axis orientation to simply C-axis tilt

### Fixed

- Fixed bug where uniform C-axis orientation was messing with C-axis rotation

## 1.0.0 - 2019-06-16
Expand Down
45 changes: 0 additions & 45 deletions CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Samuli Vuorinen
Copyright (c) 2021 Samuli Vuorinen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
112 changes: 91 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# HaloRay ![](images/hexagon_small.png)

[![Build status](https://ci.appveyor.com/api/projects/status/5k9laekby84x2ex1/branch/develop?svg=true)](https://ci.appveyor.com/project/naavis/haloray/branch/develop)

HaloRay simulates the reflection and refraction of sun light inside hexagonal
Expand All @@ -11,7 +12,10 @@ done using OpenGL compute and fragment shaders.

HaloRay currently supports Windows and Linux.

![Simulation of a column crystal halo display](images/plate-column-random-halo-screenshot.png)
An OpenGL 4.4 compliant GPU is required to run HaloRay. On Windows you also need
the [latest Microsoft Visual C++ Redistributable for Visual Studio 2019.](https://aka.ms/vs/16/release/vc_redist.x64.exe)

![Simulation of a column crystal halo display](images/ui-screenshot.png)

## How to use?

Expand All @@ -35,9 +39,9 @@ Here are some general settings for the whole simulation.
- **Sun altitude:** Sun altitude from the horizon in degrees
- **Sun diameter:** Angular diameter of the sun in degrees
- **Rays per frame:** Number of rays traced through individual crystals per
rendered frame
rendered frame
- If the user interface slows down a lot during rendering, lower this value
- On an NVIDIA GeForce GTX 1070 a good value seems to be around 500 000
- On an NVIDIA GeForce RTX 3070 a good value seems to be around 500 000
- The maximum value for this parameter may be limited by your GPU
- **Maximum frames:** Simulation stops after rendering this many frames
- **Double scattering:** Probability of a single light ray to scatter from two
Expand All @@ -56,7 +60,8 @@ in the **Crystal population** dropdown menu. Each population has a relative
weight, which can be changed by adjusting the **Population weight** spin box.
For example, giving weights 1 and 3 to two crystal populations respectively
would trace three times as many rays through the latter population than the
former.
former. It is also possible to enable or disable a crystal population
temporarily with the **Population enabled** checkbox.

The crystals are hexagonal, and have three named axes as shown in the image
below.
Expand All @@ -74,7 +79,7 @@ The following table shows parameters needed to simulate crystal orientations
known to happen in nature.

| Orientation | Tilt around a-axis | Rotation around c-axis |
|-------------|--------------------|------------------------|
| ----------- | ------------------ | ---------------------- |
| Column | 90 | Uniform |
| Plate | 0 | Uniform |
| Parry | 90 | 0 |
Expand All @@ -96,6 +101,32 @@ C-axis horizontal. Crystals with a small C/A ratio are called plate
crystals. They tend to orient themselves with the C-axis vertical. Both
kinds of crystals are shown in the image above.

The ice crystals also have adjustable pyramidal end caps. Both the upper and
lower caps have the following settings:

- **Apex angle:** Defines the apex angle of the pyramid cap in degrees
- Ranges from 0.0 to 180.0 degrees, where low numbers mean a very pointy cap
while high numbers mean the opposite
- Typically the apex angle is 56 degrees on water ice crystals
- **Apex average height:** Defines the height of the pyramid cap
- Ranges from 0.0 to 1.0, where 0.0 means the cap is totally flat and 1.0
means a cap that converges to a sharp point
- **Apex height std:** Standard deviation of the pyramid cap height

![Graphic of pyramidal ice crystal](images/pyramid-crystal.png)

Above is a representation of an ice crystal with pyramidal end caps.
Currently HaloRay is limited to convex ice crystals, so the end caps
cannot extend inwards to make hollow ice crystals.

HaloRay provides six sliders you can use to adjust the **distance of each prism
face** of the hexagonal ice crystals from the crystal C-axis.

![Graphic of a non-regular shaped ice crystal](images/non-regular-crystal.png)

The above image shows a crystal where every other prism face has the default
distance of 1.0 from the C-axis, while every other is reduced to 0.7.

### View settings

These settings affect how the results of the simulation are shown on the screen.
Expand All @@ -108,37 +139,54 @@ These settings affect how the results of the simulation are shown on the screen.
- **Hide sub-horizon:** Hides any halos below the horizon level
- **Lock to light source:** Locks the camera to the sun

## How to build?
### Atmosphere settings

HaloRay renders a realistic sky and sun disk based on a blend of Hosek-Wilkie and
Preetham models. The sky model has only a few adjustable parameters:

- **Atmosphere enabled:** Toggles rendering of the sky and sun
- **Turbidity:** The amount of aerosols/haze in the atmosphere
- **Ground albedo:** Albedo of the ground plane
- 0.0 means the ground does not reflect any light
- 1.0 means the ground reflects all light

### Menus

The top menus should be pretty self-explanatory. Entries in the _File_ menu
allow you to reset the simulation, save and load simulation parameters, and save
the simulation output to an image file on disk.

_View -> Crystal preview_ lets you see a wireframe preview of the an average
ice crystal in the currently selected crystal population.

HaloRay requires an OpenGL 4.4 compliant GPU.
The build is done using [CMake](https://cmake.org/).
## How to build?

The user interface is built with [Qt 5](https://www.qt.io/), so you need to
[download the Qt libraries](https://www.qt.io/download-qt-installer) before
compiling HaloRay.

On Linux you can also install Qt using your package manager. On Ubuntu Linux
you can install Qt by running:
The build is handled with Qt's build tool qmake. You can also use the Qt Creator
IDE to open and build the code.

On Linux you can install Qt using your package manager. On Ubuntu Linux you can
install Qt by running:

```bash
sudo apt-get install qt5-default
```

On Windows you need to set either `Qt5_DIR` or `CMAKE_PREFIX_PATH` environment
variable to point to the Qt prefix path, e.g.
`C:\Qt\5.12.3\msvc2017_64\`

Otherwise CMake won't be able to find the Qt libraries.

Finally build the project by running:

```bash
mkdir build
cd build
cmake ..
cmake --build . --config Release
cd src
qmake main.pro -o ..\build\
cd ..\build
make
```

You can use `nmake` instead of `make` on Windows.

On Windows you need to add the Qt5 binary directory to your PATH environment
variable or copy at least the following Qt DLL files to the same folder as the
resulting executable:
Expand All @@ -155,11 +203,33 @@ shipped with Qt 5. This is the recommended way.
You can check `scripts\build.ps1` to see how the project is built on the
Appveyor CI server.

## FAQ - Frequently asked questions

### UI components are scaled all wrong on a 4K display in Windows, what to do?

On high-DPI screens Windows scales UI elements by default. HaloRay doesn't fully
adapt to this scaling yet. For now, you can either disable the scaling on an
operating system level by setting UI scale to 100% in Windows display settings,
or try running HaloRay with
[special command-line parameters](https://doc.qt.io/qt-5/qguiapplication.html#platform-specific-arguments)
like this:

```
HaloRay.exe -platform windows:dpiawareness=2
```

### HaloRay crashes or does not start, how to troubleshoot?

HaloRay writes a log file to help in troubleshooting.

On Windows you can find it in `%LOCALAPPDATA%\Temp\haloray\haloray.log` where
`%LOCALAPPDATA` is usually equal to `C:\Users\<username>\AppData\Local`

On Linux the log file is in `/tmp/haloray/haloray.log`

## Acknowledgments

- [Lauri Kangas](https://github.com/lkangas) for providing tons of reading material and debugging help
- [Panu Lahtinen](https://github.com/pnuu) for additional Linux support
- Jukka Ruoskanen for making HaloPoint 2.0 back in the day and inspiring me to start working on HaloRay
- [Jaakko Lehtinen](https://users.aalto.fi/~lehtinj7/) for super valuable lessons in computer graphics
- [Nuklear](https://github.com/vurtun/nuklear/) for enabling me get this project
off the ground
12 changes: 6 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
version: '2.4.0-{build}'
version: "3.0.0-{build}"
branches:
only:
- master
- develop
image: Visual Studio 2017
image: Visual Studio 2019
clone_depth: 1
environment:
Qt5_DIR: C:\Qt\5.12.2\msvc2017_64\
VCINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\
Qt5_DIR: C:\Qt\5.15.2\msvc2019_64
VCINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\
build_script:
- ps: scripts\build.ps1
after_build:
- ps: scripts\package.ps1
test_script:
- ps: scripts\test.ps1
artifacts:
- path: '*.zip'
- path: "*.zip"
deploy:
- provider: GitHub
release: HaloRay $(appveyor_build_version)
artifact: /.*\.zip/
draft: true
description: ''
description: ""
skip_tags: true
auth_token:
secure: pb9keaNklmNgmLaw1doReZDdP5Oh/pLZPdwjt+anpcoi34MyqAbFoJbiHJMcWkgD
Expand Down
Binary file added images/non-regular-crystal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/plate-column-random-halo-screenshot.png
Binary file not shown.
Binary file added images/pyramid-crystal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 89a159c

Please sign in to comment.