From db6010185c55c65704bd47c665b4ba61e1d9eb48 Mon Sep 17 00:00:00 2001 From: utensil Date: Sun, 22 Sep 2024 19:06:28 +0800 Subject: [PATCH] Add: common abbreviations --- trees/ag-000N.tree | 1 + trees/ag-0019.tree | 8 ++++---- trees/ag-001G.tree | 28 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 trees/ag-001G.tree diff --git a/trees/ag-000N.tree b/trees/ag-000N.tree index 69e6ba7..23cdbee 100644 --- a/trees/ag-000N.tree +++ b/trees/ag-000N.tree @@ -24,4 +24,5 @@ \transclude{ag-000O} \transclude{ag-0018} \transclude{ag-0019} +\transclude{ag-001G} } diff --git a/trees/ag-0019.tree b/trees/ag-0019.tree index 2653bfe..c3e076e 100644 --- a/trees/ag-0019.tree +++ b/trees/ag-0019.tree @@ -14,7 +14,7 @@ \card{example}{ray marching (naïve)}{ -\p{The following renders a scene with a unit sphere at the origin, the camera at #{(0,0,-8)} and looking at the origin, through a screen of height 1.0, centered at 5.0 from the camera. +\p{The following renders a scene with a unit sphere at the origin, the camera at #{(0,0,8)} and looking at the origin, through a screen of height 1.0, centered at 5.0 from the camera. } \p{The color of pixels are adjusted so that they are brighter the closer they are to the camera, as if there is a light source at the camera. As it takes a fixed step size of 0.1 (not small enough), the sphere is not rendered smoothly, and clearly shows the stepping artifacts. @@ -65,9 +65,9 @@ void mainImage(out vec4 pixelColor, in vec2 pixelCoordinate) { // set up camera and view ray float observerDistance = 8.0; - vec3 ro = vec3(0.0, 0.0, -observerDistance); - vec3 cameraBox = ro + vec3(uv, 5.0); - vec3 rd = normalize(cameraBox - ro); + vec3 ro = vec3(0.0, 0.0, observerDistance); + vec3 ta = ro - vec3(uv, 5.0); + vec3 rd = normalize(ta - ro); // ray march float t = rayMarch(ro, rd); diff --git a/trees/ag-001G.tree b/trees/ag-001G.tree new file mode 100644 index 0000000..fe2575a --- /dev/null +++ b/trees/ag-001G.tree @@ -0,0 +1,28 @@ +\import{cg-macros} +% clifford hopf spin tt ag math draft cg +\tag{cg} + +% definition theorem lemma construction observation +% convention corollary axiom example exercise proof +% discussion remark notation +% \taxon{} +% \refcardt{lemma}{}{}{}{ + +% kostecki2011introduction leinster2016basic nakahira2023diagrammatic rosiak2022sheaf + +% cox1997ideals gathmann2013commutative hart1996sphere gillespie2024ray winchenbach2024lipschitz + +\card{remark}{ }{ +\p{By convention, the GLSL community uses two-to-three letter variable names. Here are some common abbreviations:} + +\ul{ +\li{\code{ro} = ray origin} +\li{\code{rd} = ray direction} +\li{\code{ca} = camera} +\li{\code{ta} = target (where the camera is pointing)} +\li{\code{uv} = texture coordinates} +} + +\p{Source: \link{https://raymarchingfundamentals.org/a-quick-background#the-raymarching-part} +} +} \ No newline at end of file