The simulation and visualization of relativistic effects in this project do not claim to be quantitatively accurate, but hopefully will give a correct qualitative idea of some relativistic phenomena.
Materials (shaders) for rendering effects associated with black holes (or more precisely, with Schwarzschild black holes) are the main part of this project. All black hole shaders consist of three main shaders, namely the gravitational lensing shader, the volumetric accretion disk shader and the polyline tracer shader.
Gravitational lensing is modeled by equations not related to general relativity, so it is not physically accurate. Gravitational lensing only distorts a background and the accretion disk, so to be realistic the objects in the scene should be relatively small compared to the sphere bounding the gravitational lensing distortions.
There are several types of volumetric accretion disk shader, which differ from each other in what effects they simulate and what equations they use for a particular effect. The main volumetric shaders are implemented as Post Process Materials that blend well with opaque objects in the scene, but objects with translucent materials require special care, since the correctness of the final image depends on relative positions of volumetric shapes and translucent objects. In this project, the main post process materials are rendered before translucency and thus should be farther from the camera than translucent objects (see Blendable Location if you want to change this rendering order).
The two types of polyline tracer shader differ from each other in that ray tracing is performed either for a solid cylinder or a cylindrical shell.
Material Functions are integral to this project as they are building blocks of most materials thereby providing modularity and great possibilities for customization. The purpose of some of them is specific to this project, while others are of a general purpose and can be useful in any work.
Another essential part is the special blueprints intended to facilitate the setting of certain parameters of the volumetric materials and adding these materials to the scene. There are also blueprint actors that make the calculations necessary for some materials to render relativistic effects. How it all works together is shown in several scenes in the demo.
Black hole materials are quite demanding on performance. Performance impact and visual quality can vary greatly depending on the material complexity and the number of samples. Moreover, the image quality depends on the distance that the camera rays travel within the volume, and therefore the quality can change noticeably depending on the position of the camera and the angle of view. Please, try the demo first to assess the balance between performance impact and visual quality and decide if this suits your needs (in the demo level press Ctrl + Num 1 to toggle the FPS counter and then try different visual settings which can be accessed by pressing the M key).
Credits:
"Space Shuttle" by Microsoft is licensed under Creative Commons Attribution.
Forum threads: