Skip to content

Commit 87ee3ee

Browse files
committed
Added Game dev Topics and Learning Paths. Which Covers advance Fandamentals.
1 parent adc2a0f commit 87ee3ee

43 files changed

Lines changed: 3747 additions & 7 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pages/Introduction.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
-
44
-
55
- ## Programming Languages
6-
collapsed:: true
76
-
87
- [[Python]] :- A beginner-friendly language known for its readability and extensive libraries.
98
-
@@ -84,7 +83,6 @@
8483
- [[Zig]]: A systems programming language that aims to replace C with a focus on simplicity, performance, and safety.
8584
-
8685
- ## Databases
87-
collapsed:: true
8886
- [[MySQL]] : One of the most widely used open-source relational database management systems (RDBMS), especially in web applications.
8987
-
9088
- [[PostgreSQL]] : An advanced, open-source relational database that emphasizes extensibility, SQL compliance, and performance.
@@ -101,7 +99,6 @@
10199
- [[GraphQL]] - **GraphQL** is a query language for APIs and a runtime for executing those queries with your existing data. It was developed by **Facebook** and offers a more flexible and efficient alternative to REST APIs.
102100
-
103101
- ## CMS (Content Management Systems)
104-
collapsed:: true
105102
- [[WordPress]] :- A widely used, open-source CMS known for its ease of use, vast theme/plugin ecosystem, and flexibility for building various websites from blogs to e-commerce stores.
106103
-
107104
- [[Joomla]] :- A flexible and powerful CMS that allows for the creation of complex websites with various extensions and templates.
@@ -126,7 +123,6 @@
126123
- [[Shopify]] - it is a **hosted e-commerce platform** that includes **some CMS-like features**.
127124
-
128125
- ## Operating Systems & Kernels
129-
collapsed:: true
130126
- ## Linux
131127
- [[Kali Linux]] :- A Debian-based distribution designed for penetration testing and cybersecurity professionals, featuring numerous security tools.
132128
-
@@ -147,16 +143,13 @@
147143
- ## Windows
148144
-
149145
- ## Frameworks, Libraries Common Elements
150-
collapsed:: true
151146
- You Can find particular lib & Frameworks in that programing page
152147
- [[Api]] - You can find specific APIs and related documentation on the respective programming language or framework page.
153148
-
154149
- ## Data Structures , Algorithms & OOP
155-
collapsed:: true
156150
- [[DSA , Algo & System Design]]: The study of organizing and manipulating data efficiently, focusing on fundamental structures like arrays, linked lists, stacks, queues, trees, and graphs, as well as algorithms for searching, sorting, and optimization.
157151
-
158152
- ## DevOps & CI/CD
159-
collapsed:: true
160153
- ## DevOps Concepts
161154
- [[Collaboration & Communication]]: Emphasizes enhanced communication between development and operations teams to improve the software development lifecycle (SDLC).
162155
-
@@ -259,6 +252,13 @@
259252
- ## Cybersecurity
260253
- [[Cybersecurity]] - This page contains DevOps Concepts
261254
-
255+
- ## Game Development & Graphics
256+
- For game engines, 3D tools, design software, and all related applications, see [[Software]].
257+
-
258+
- ### Graphics Programming & Rendering
259+
- [[PathTracer Learning]] :- Deep-dive learning series for building a GPU path tracer from scratch — covers math foundations, CPU ray tracing, Vulkan ray tracing, and Godot rendering internals.
260+
-
261+
-
262262
- ## Software Information
263263
id:: 6722a764-cba3-430a-805a-3a2746eb9e3f
264264
- [[Software]] - This page showcases all types of software, categorized by their functionality and purpose.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
tags:: vulkan, acceleration-structure, bvh, blas, tlas
2+
title:: PathTracer Learning - BLAS and TLAS
3+
4+
- # BLAS and TLAS — Acceleration Structures
5+
- Hardware-accelerated BVH for Vulkan ray tracing.
6+
- Parent: [[PathTracer Learning]]
7+
- ---
8+
- ## Conceptual Overview
9+
- Two-level hierarchy
10+
- BLAS (Bottom-Level AS): geometry BVH — triangles or AABBs
11+
- TLAS (Top-Level AS): instance BVH — references to BLASes with transforms
12+
- Why two levels?
13+
- Allows instancing: one BLAS, many TLAS instances (e.g., 1000 trees from 1 mesh)
14+
- TLAS can be rebuilt cheaply (just transforms) while BLASes stay static
15+
- Hardware traversal handles both levels transparently
16+
- Analogy to software BVH
17+
- BLAS ≈ per-mesh BVH (built offline or at load time)
18+
- TLAS ≈ scene BVH (rebuilt every frame)
19+
- ---
20+
- ## BLAS Construction
21+
- Input: vertex buffer + index buffer (triangle list)
22+
- `VkAccelerationStructureGeometryKHR`
23+
- ```
24+
geometry.geometryType = VK_GEOMETRY_TYPE_TRIANGLES_KHR;
25+
geometry.geometry.triangles.vertexFormat = VK_FORMAT_R32G32B32_SFLOAT;
26+
geometry.geometry.triangles.vertexData.deviceAddress = vertexBufferAddress;
27+
geometry.geometry.triangles.vertexStride = sizeof(Vertex);
28+
geometry.geometry.triangles.maxVertex = vertexCount - 1;
29+
geometry.geometry.triangles.indexType = VK_INDEX_TYPE_UINT32;
30+
geometry.geometry.triangles.indexData.deviceAddress = indexBufferAddress;
31+
```
32+
- Build flags
33+
- `VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR` — optimize for traversal (static geometry)
34+
- `VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR` — optimize for build speed (dynamic geometry)
35+
- `VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR` — allow incremental updates (skinned meshes)
36+
- `VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR` — compact after build (saves memory)
37+
- Memory requirements
38+
- Query with `vkGetAccelerationStructureBuildSizesKHR`
39+
- Returns: `accelerationStructureSize`, `buildScratchSize`, `updateScratchSize`
40+
- Scratch buffer is temporary — can be reused after build completes
41+
- Compaction (important for memory)
42+
- Build with `ALLOW_COMPACTION` flag
43+
- Query compacted size with `VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR`
44+
- Copy to smaller buffer with `vkCmdCopyAccelerationStructureKHR`
45+
- Typical compaction ratio: 50-70% size reduction
46+
- ---
47+
- ## TLAS Construction
48+
- Input: array of `VkAccelerationStructureInstanceKHR`
49+
- Instance struct fields
50+
- `transform` — 3×4 row-major affine transform matrix
51+
- `instanceCustomIndex` — 24-bit value accessible as `gl_InstanceCustomIndexEXT` in shaders
52+
- `mask` — 8-bit visibility mask (AND with ray mask in `traceRayEXT`)
53+
- `instanceShaderBindingTableRecordOffset` — SBT hit group offset for this instance
54+
- `flags` — `VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR` etc.
55+
- `accelerationStructureReference` — device address of the BLAS
56+
- TLAS is rebuilt every frame
57+
- Upload new instance buffer with updated transforms
58+
- `vkCmdBuildAccelerationStructuresKHR` with `VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR`
59+
- Or use `MODE_UPDATE_KHR` for incremental update (faster but lower quality BVH)
60+
- ---
61+
- ## Memory Layout and Device Addresses
62+
- [[PathTracer Learning - Concept - Device Address Bit]]
63+
- All AS input buffers need `VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT`
64+
- AS buffer needs `VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR`
65+
- Scratch buffer needs `VK_BUFFER_USAGE_STORAGE_BIT | VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT`
66+
- ---
67+
- ## Traversal in Shaders
68+
- `traceRayEXT(tlas, rayFlags, cullMask, sbtOffset, sbtStride, missIndex, origin, tMin, dir, tMax, payloadLocation)`
69+
- Ray flags
70+
- `gl_RayFlagsOpaqueEXT` — skip any-hit shaders (faster)
71+
- `gl_RayFlagsTerminateOnFirstHitEXT` — stop at first hit (shadow rays)
72+
- `gl_RayFlagsSkipClosestHitShaderEXT` — don't call closest-hit (occlusion only)
73+
- Built-in variables in hit shaders
74+
- `gl_HitTEXT` — distance to hit
75+
- `gl_PrimitiveID` — triangle index within the BLAS geometry
76+
- `gl_InstanceID` — instance index in the TLAS
77+
- `gl_InstanceCustomIndexEXT` — custom index from instance struct
78+
- `gl_WorldRayOriginEXT`, `gl_WorldRayDirectionEXT` — ray in world space
79+
- `gl_ObjectRayOriginEXT`, `gl_ObjectRayDirectionEXT` — ray in object space
80+
- `gl_ObjectToWorldEXT`, `gl_WorldToObjectEXT` — transform matrices
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
tags:: reference, books, tutorials, resources
2+
title:: PathTracer Learning - Books and Tutorials
3+
4+
- # Books and Tutorials
5+
- Parent: [[PathTracer Learning]]
6+
- ---
7+
- ## Essential Books
8+
- "Ray Tracing in One Weekend" series — Peter Shirley (free online)
9+
- Book 1: Ray Tracing in One Weekend — basic ray tracer
10+
- Book 2: Ray Tracing: The Next Week — BVH, textures, motion blur
11+
- Book 3: Ray Tracing: The Rest of Your Life — Monte Carlo, importance sampling
12+
- URL: https://raytracing.github.io/
13+
- Best starting point — builds intuition before GPU
14+
- "Physically Based Rendering: From Theory to Implementation" (PBRT)
15+
- Pharr, Jakob, Humphreys — the definitive reference
16+
- 4th edition free online: https://pbr-book.org/
17+
- Covers everything: BVH, BRDFs, Monte Carlo, spectral rendering, volumes
18+
- Very dense — use as reference, not cover-to-cover
19+
- Chapter 9 (Reflection Models) and Chapter 13 (Monte Carlo) are essential
20+
- "Real-Time Rendering" — Akenine-Möller et al.
21+
- Chapter 26: Real-Time Ray Tracing
22+
- Good overview of hardware RT and denoising
23+
- "Fundamentals of Computer Graphics" — Shirley & Marschner
24+
- Good intro to the math before diving into PBRT
25+
- ---
26+
- ## Vulkan Ray Tracing
27+
- Vulkan Ray Tracing Tutorial — NVIDIA (nvpro-samples)
28+
- https://github.com/nvpro-samples/vk_raytracing_tutorial_KHR
29+
- Step-by-step from basic triangle to full path tracer
30+
- Uses C++ + GLSL, very practical
31+
- Vulkan Specification — Ray Tracing chapters
32+
- https://registry.khronos.org/vulkan/specs/1.3-extensions/html/
33+
- Chapters on VK_KHR_ray_tracing_pipeline, VK_KHR_acceleration_structure
34+
- "Ray Tracing Gems" (free PDF)
35+
- https://www.realtimerendering.com/raytracinggems/
36+
- Collection of practical techniques from industry experts
37+
- Chapter 3: Introduction to DirectX Raytracing (concepts apply to Vulkan)
38+
- Chapter 20: Texture Level of Detail Strategies for Real-Time Ray Tracing
39+
- "Ray Tracing Gems II" (free PDF)
40+
- https://www.realtimerendering.com/raytracinggems/rtg2/
41+
- More advanced topics: ReSTIR, denoising, production techniques
42+
- Chapter 23: ReSTIR GI
43+
- ---
44+
- ## Key Papers
45+
- Kajiya 1986 — "The Rendering Equation"
46+
- Foundation of physically-based rendering
47+
- Möller & Trumbore 1997 — "Fast, Minimum Storage Ray/Triangle Intersection"
48+
- The standard ray-triangle intersection algorithm
49+
- Walter et al. 2007 — "Microfacet Models for Refraction through Rough Surfaces"
50+
- GGX BRDF derivation
51+
- Heitz 2014 — "Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs"
52+
- Definitive reference for Smith G term
53+
- Heitz 2018 — "Sampling the GGX Distribution of Visible Normals"
54+
- VNDF sampling — better importance sampling for GGX
55+
- Burley 2012 — "Physically-Based Shading at Disney"
56+
- Disney Principled BRDF — the basis for most PBR workflows
57+
- Veach & Guibas 1995 — "Optimally Combining Sampling Techniques for Monte Carlo Rendering"
58+
- MIS (Multiple Importance Sampling) — essential for path tracing
59+
- Bitterli et al. 2020 — "Spatiotemporal reservoir resampling for real-time ray tracing with dynamic direct lighting"
60+
- ReSTIR DI paper
61+
- Ouyang et al. 2021 — "ReSTIR GI: Path Resampling for Real-Time Path Tracing"
62+
- ReSTIR GI paper
63+
- Schied et al. 2017 — "Spatiotemporal Variance-Guided Filtering"
64+
- SVGF denoiser
65+
- Müller et al. 2017 — "Practical Path Guiding for Efficient Light-Transport Simulation"
66+
- SD-Tree path guiding
67+
- Woop et al. 2013 — "Watertight Ray/Triangle Intersection"
68+
- Prevents light leaking through mesh cracks
69+
- ---
70+
- ## Video Courses
71+
- "Computer Graphics" — TU Wien (YouTube, free)
72+
- Excellent lectures on rendering theory
73+
- Covers path tracing, BRDFs, Monte Carlo in depth
74+
- https://www.youtube.com/playlist?list=PLujxSBD-JXgnGmsn7gEyN28P1DnRZG7qi
75+
- "Advances in Real-Time Rendering" — SIGGRAPH courses
76+
- Annual course with cutting-edge techniques
77+
- https://advances.realtimerendering.com/
78+
- "Introduction to Computer Graphics" — Cem Yuksel (YouTube)
79+
- Clear explanations of rendering fundamentals
80+
- "GAMES101" — Lingqi Yan (YouTube, Chinese with subtitles)
81+
- Comprehensive graphics course, excellent path tracing coverage
82+
- ---
83+
- ## Online Resources
84+
- Shadertoy — https://www.shadertoy.com/
85+
- Many path tracer implementations to study
86+
- Search "path tracer" for examples
87+
- Inigo Quilez's articles — https://iquilezles.org/articles/
88+
- Excellent math and rendering articles
89+
- Physically Based Rendering blog — https://www.pbr-book.org/blog
90+
- JCGT (Journal of Computer Graphics Techniques) — https://jcgt.org/
91+
- Free peer-reviewed graphics papers
92+
- ---
93+
- ## Godot Specific
94+
- Godot source code — `servers/rendering/renderer_rd/`
95+
- Best documentation is the code itself
96+
- NVPathtracer PR/fork — study the actual implementation
97+
- Godot rendering documentation
98+
- https://docs.godotengine.org/en/stable/contributing/development/core_and_modules/custom_rendering_server.html
99+
- Godot RenderingDevice API docs
100+
- https://docs.godotengine.org/en/stable/classes/class_renderingdevice.html
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
tags:: reference, godot, nvpathtracer, chat-notes
2+
title:: PathTracer Learning - Chat Analysis
3+
4+
- # Chat Analysis — Godot NVPathtracer Discussion
5+
- Notes extracted from the actual Godot Contributors NVPathtracer chat discussion.
6+
- Parent: [[PathTracer Learning]]
7+
- ---
8+
- ## Key Contributors and Context
9+
- This was a technical discussion among Godot engine contributors
10+
- Topic: integrating NVIDIA's path tracer (NVPathtracer) into Godot 4
11+
- Challenges discussed: engine integration, performance, API design
12+
- ---
13+
- ## Technical Insights from the Chat
14+
- TLAS rebuild strategy
15+
- Contributors debated full rebuild vs incremental update every frame
16+
- Full rebuild: simpler, always correct BVH quality
17+
- Incremental update: faster but BVH quality degrades over time
18+
- Decision: full rebuild for correctness, optimize later
19+
- Material system design
20+
- How to pass PBR material data (albedo, roughness, metallic, textures) to RT shaders
21+
- Solution: per-instance data buffer indexed by `gl_InstanceCustomIndexEXT`
22+
- Each instance stores: vertex buffer address, index buffer address, material index
23+
- Material buffer stores: albedo, roughness, metallic, texture indices
24+
- Denoising approach
25+
- Initial: simple temporal accumulation (free, no extra cost)
26+
- Target: DLSS 3.5 Ray Reconstruction for final quality
27+
- Intermediate: OIDN for platforms without DLSS
28+
- Skinned mesh handling
29+
- Skinned meshes need BLAS rebuild every frame
30+
- Use `ALLOW_UPDATE` flag for incremental BLAS update
31+
- Separate "dynamic" and "static" BLAS pools
32+
- Async compute for BLAS builds
33+
- [[PathTracer Learning - Concept - Async Compute]]
34+
- BLAS builds can run on compute queue while previous frame renders
35+
- Reduces per-frame RT budget impact of BLAS builds
36+
- ---
37+
- ## Architecture Decisions
38+
- Engine fork vs GDExtension
39+
- NVPathtracer is an engine fork — modifies core rendering code
40+
- GDExtension cannot access `RenderingDevice` internals
41+
- Future goal: expose RT hooks via GDExtension API
42+
- Integration point
43+
- Override `_render_scene()` in `RendererSceneRenderRD`
44+
- Skip rasterization entirely for path-traced frames
45+
- Keep shadow maps for hybrid rendering (raster + RT)
46+
- Buffer management
47+
- Reuse Godot's existing depth/normal/motion buffers
48+
- Add new accumulation buffer and albedo buffer for denoiser
49+
- Use `RenderSceneBuffersRD` to manage lifetime
50+
- ---
51+
- ## Open Questions from the Chat
52+
- How to handle transparent objects (glass, water)?
53+
- RT handles refraction naturally — just trace through
54+
- Need to disable alpha blending for RT objects
55+
- LOD (Level of Detail) with RT?
56+
- RT doesn't use rasterization LOD system
57+
- Need separate LOD selection for BLAS geometry
58+
- Emissive materials as light sources?
59+
- NEE needs to know which instances are emissive
60+
- Build a light list from emissive instances for NEE sampling
61+
- ---
62+
- ## Lessons Learned
63+
- Start simple: temporal accumulation before DLSS
64+
- Get correctness first: full TLAS rebuild before optimization
65+
- Test with Cornell box: known ground truth for validation
66+
- Profile early: GPU timing for each pass (BLAS, TLAS, RT, denoise)
67+
- ---
68+
- ## Related
69+
- [[PathTracer Learning - Phase 4 - Godot Internals]]
70+
- [[PathTracer Learning - BLAS and TLAS]]
71+
- [[PathTracer Learning - Vulkan RT Pipeline]]
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
tags:: concept, bvh, acceleration-structure, geometry
2+
title:: PathTracer Learning - Concept - AABB
3+
4+
- # Concept: AABB (Axis-Aligned Bounding Box)
5+
- Parent: [[PathTracer Learning - Phase 2 - CPU Ray Tracing]]
6+
- ---
7+
- ## Definition
8+
- A box whose faces are aligned with the coordinate axes
9+
- Defined by two points: `min = (x_min, y_min, z_min)` and `max = (x_max, y_max, z_max)`
10+
- Every point `P` inside satisfies: `min.x ≤ P.x ≤ max.x` (and same for y, z)
11+
- "Axis-aligned" means no rotation — simplifies intersection math enormously
12+
- ---
13+
- ## Ray-AABB Intersection (Slab Method)
14+
- Treat the AABB as the intersection of 3 pairs of parallel planes (slabs)
15+
- For each axis, compute entry and exit `t` values
16+
- `t_x_min = (min.x - ray.origin.x) / ray.direction.x`
17+
- `t_x_max = (max.x - ray.origin.x) / ray.direction.x`
18+
- If `ray.direction.x < 0`, swap min and max
19+
- Combine all 3 axes
20+
- `t_enter = max(t_x_min, t_y_min, t_z_min)` — ray enters the box
21+
- `t_exit = min(t_x_max, t_y_max, t_z_max)` — ray exits the box
22+
- Hit condition: `t_enter <= t_exit && t_exit > t_min`
23+
- Implementation
24+
- ```glsl
25+
bool intersectAABB(Ray ray, vec3 boxMin, vec3 boxMax, out float tNear) {
26+
vec3 invDir = 1.0 / ray.direction;
27+
vec3 t0 = (boxMin - ray.origin) * invDir;
28+
vec3 t1 = (boxMax - ray.origin) * invDir;
29+
vec3 tMin = min(t0, t1);
30+
vec3 tMax = max(t0, t1);
31+
float tEnter = max(max(tMin.x, tMin.y), tMin.z);
32+
float tExit = min(min(tMax.x, tMax.y), tMax.z);
33+
tNear = tEnter;
34+
return tEnter <= tExit && tExit > 0.0;
35+
}
36+
```
37+
- Note: `invDir = 1.0 / ray.direction` precomputed for efficiency
38+
- Handle `direction = 0` case: `invDir = ±infinity`, which works correctly with IEEE 754
39+
- ---
40+
- ## AABB Construction
41+
- From a set of points: `min = componentwise_min(all_points)`, `max = componentwise_max(all_points)`
42+
- From a triangle: `min = min(v0, v1, v2)`, `max = max(v0, v1, v2)`
43+
- Merging two AABBs: `merged.min = min(a.min, b.min)`, `merged.max = max(a.max, b.max)`
44+
- ---
45+
- ## Surface Area
46+
- `SA = 2 * (dx*dy + dy*dz + dz*dx)` where `dx = max.x - min.x` etc.
47+
- Used in SAH (Surface Area Heuristic) for BVH construction
48+
- Intuition: larger surface area → more likely to be hit by a random ray
49+
- ---
50+
- ## Why AABB and Not OBB?
51+
- OBB (Oriented Bounding Box) fits tighter but intersection is much more expensive
52+
- AABB intersection: ~6 divisions, ~6 comparisons
53+
- OBB intersection: requires transforming ray to box space (matrix multiply)
54+
- BVH with AABBs is fast enough in practice — hardware RT uses AABBs
55+
- ---
56+
- ## Related
57+
- [[PathTracer Learning - Concept - BVH Construction]]
58+
- [[PathTracer Learning - Concept - BVH Traversal]]

0 commit comments

Comments
 (0)