aboutsummaryrefslogtreecommitdiff
path: root/src/rendering/scene_renderer.cpp
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-24 18:28:39 +0200
committerhachem <im@hachem.wtf>2026-08-24 18:28:39 +0200
commita34c49f103c8950a57687ea3d866c244d95b4414 (patch)
treeff268f4a7f52769a252443d6f2822c9814e3bb1c /src/rendering/scene_renderer.cpp
parent06398a7a176e123506de6e8851866a8bec0b3427 (diff)
[docs]: added a few comments cause i wont be able to read this in a week's time
Diffstat (limited to 'src/rendering/scene_renderer.cpp')
-rw-r--r--src/rendering/scene_renderer.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rendering/scene_renderer.cpp b/src/rendering/scene_renderer.cpp
index bec609c..e290445 100644
--- a/src/rendering/scene_renderer.cpp
+++ b/src/rendering/scene_renderer.cpp
@@ -43,7 +43,7 @@ namespace Donut
struct SkyboxUBO { glm::mat4 projection; glm::mat4 view; };
static_assert(sizeof(SkyboxUBO) == 128, "SkyboxUBO std140 layout mismatch");
- // The hole's event horizon (1 r_s) as a marker at the origin.
+ // the hole's event horizon (1 r_s) as a marker at the origin.
constexpr float BH_SCENE_RADIUS = SCENE_UNITS_PER_RS;
}
@@ -51,7 +51,7 @@ namespace Donut
{
m_device = &device;
- // Reference grid: line list on the XZ plane (+/-50, 1-unit cells). Grid.slang
+ // reference grid: line list on the XZ plane (+/-50, 1-unit cells). grid.slang
// scales by u_GridSize/50, so u_GridSize = 50 keeps it 1:1.
{
std::vector<glm::vec3> lines;
@@ -78,7 +78,7 @@ namespace Donut
m_grid_pipeline = device.create_pipeline(d);
}
- // Lit sphere: unit UV-sphere (pos + normal), placed/scaled per object.
+ // lit sphere: unit UV-sphere (pos + normal), placed/scaled per object.
{
std::vector<float> sv; std::vector<uint32_t> si;
const int RINGS = 24, SECTORS = 48;
@@ -115,7 +115,7 @@ namespace Donut
m_sphere_pipeline = device.create_pipeline(d);
}
- // Skybox: a unit cube (36 verts) sampling the HDRI cubemap; the vertex
+ // skybox: a unit cube (36 verts) sampling the HDRI cubemap; the vertex
// shader forces depth 1 (pos.xyww) so it sits behind all scene geometry.
{
const float cube[] = {
@@ -151,13 +151,13 @@ namespace Donut
const std::vector<SceneObject>& objects, int selected,
RHI::Texture* cubemap) -> void
{
- // Full-window viewport; flip_y lets the backend match the shared top-left
+ // full-window viewport; flip_y lets the backend match the shared top-left
// orientation (Vulkan flips via a negative-height viewport, GL is a no-op).
cmd.set_viewport(0, 0, cam.fb_width, cam.fb_height, true);
glm::mat4 vp = cam.projection * cam.view;
- // Skybox background first (depth 1, no depth test/write).
+ // skybox background first (depth 1, no depth test/write).
{
SkyboxUBO sky{};
sky.projection = cam.projection;
@@ -170,7 +170,7 @@ namespace Donut
cmd.draw(36);
}
- // Opaque spheres (write depth). One UBO per object slot avoids aliasing the
+ // opaque spheres (write depth). one UBO per object slot avoids aliasing the
// per-draw uniforms across the deferred command stream.
{
int count = std::min((int)objects.size(), MAX_OBJECTS);
@@ -202,7 +202,7 @@ namespace Donut
cmd.draw_indexed(m_sphere_index_count);
}
- // Black-hole marker: a near-black sphere at the origin (radius = r_s in
+ // black-hole marker: a near-black sphere at the origin (radius = r_s in
// scene units), so the Scene shows where the hole the Simulation renders
// sits. 1 grid unit == 1 Schwarzschild radius.
SphereUBO bh{};
@@ -223,7 +223,7 @@ namespace Donut
cmd.draw_indexed(m_sphere_index_count);
}
- // Transparent grid on top (tests depth, doesn't write).
+ // transparent grid on top (tests depth, doesn't write).
{
GridUBO g{};
g.view_projection = vp;