It is fully raytraced. For now only software-based raytracing.
- VulkanSDK
- CMake
- C/C++ Compiler (Visual studio on windows, clang on MacOS/Linux)
- Clone the repository with
git clone --recursive https://github.com/AppleItsme/VulkanRun.git - Go to the repo directory and run
cmake CMakeLists.txt - On linux/macOS, find
Makefileand runmake; On Windows, use Visual Studio to build the application.
MacOS compatibility has not been tested. Currently it's only being developed on Windows, but it should also work on Linux systems.
There are 2 spaces. Listing them in the order of transformations:
- World/View space represents the position of meshes in the world.
- Screen space represents the pixels that each mesh occupies
- Rotation function along the plane
$e_{ij}$ :
View to Screen space:
slightly outdated
For transformations of meshes, we have TransformationBuffer:
struct TransformationBuffer {
vec3 translation;
vec3 scale;
vec3 rotation;
}You may recall that in the General transformations section we sent a matrix instead. Well these two are different ways of describing the exact same piece of data so it doesn't matter.
Vertex buffer will store all the vertices that are used by the application. Transformations will be stored separately because many primitives are likely to share the same model to world space transformations, and every primitive will have the exact same World to View to Screen space transformations.
Any other data will be stored in the TriangleBuffer:
struct TriangleBuffer {
uvec3 vertexIndices;
vec2 UVcoords[3]; //one UV coordinate per vertex
uint materialIndex;
uint transformationIndex;
};Or the ElipsoidBuffer:
struct ElipsoidBuffer {
vec3 position;
uint materialIndex;
uint transformationIndex;
}materialIndex field will be an index to a buffer of the following struct:
struct MaterialBuffer {
float roughness;
float refraction;
float luminosity;
vec3 color;
bool isTexturePresent;
uint textureIndex;
bool isNormalPresent;
uint normalIndex;
}If isTexturePresent or isNormalPresent are false, then textureIndex and normalIndex are ignored respectively.
| buffer | Binding Index |
|---|---|
renderScreen |
0 |
SphereBuffer |
1 |
TransformationBuffer |
2 |
MaterialBuffer |
3 |
SunlightBuffer |
4 |
Misc |
5 <-- TEMPORARY |
Camera |
6 |
SecondaryRayBuffer |
7 |