<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://techsolomon.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://techsolomon.com/" rel="alternate" type="text/html" /><updated>2024-09-27T06:22:13+00:00</updated><id>https://techsolomon.com/feed.xml</id><title type="html">Solomon Himelbloom</title><subtitle>CS @ UAF</subtitle><entry><title type="html">Fairbanks Weather Phenomena in Godot</title><link href="https://techsolomon.com/2022/12/13/fairbanks-weather-phenomena-in-godot.html" rel="alternate" type="text/html" title="Fairbanks Weather Phenomena in Godot" /><published>2022-12-13T18:00:00+00:00</published><updated>2022-12-13T18:00:00+00:00</updated><id>https://techsolomon.com/2022/12/13/fairbanks-weather-phenomena-in-godot</id><content type="html" xml:base="https://techsolomon.com/2022/12/13/fairbanks-weather-phenomena-in-godot.html"><![CDATA[<h4 id="uaf-cs-485-computer-graphics-rendering-fall-2022">UAF CS 485 → Computer Graphics Rendering (Fall 2022)</h4>

<h2 id="problem-statement">Problem Statement</h2>

<p>Summarized as balancing physical weather effects and their corresponding representation in <a href="https://godotengine.org/">Godot</a>, the initial starting point for this project began with light pillars and ice fog characteristics, as narrowing down the scope was critical for setting attainable goals for this semester.</p>

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Here are some nice light pillars on this cold night in Fairbanks, sent in from one of our Meteorologists. <a href="https://twitter.com/hashtag/akwx?src=hash&amp;ref_src=twsrc%5Etfw">#akwx</a> <a href="https://t.co/DMLvE9TGNT">pic.twitter.com/DMLvE9TGNT</a></p>&mdash; NWS Fairbanks (@NWSFairbanks) <a href="https://twitter.com/NWSFairbanks/status/1323516561366241280?ref_src=twsrc%5Etfw">November 3, 2020</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

<p>The attempted effect drew inspiration from a US National Weather Service Fairbanks Alaska post (see above), where they observe tiny ice crystals forming radiant columns of light as vertically stacked mirrors float within the atmosphere.</p>

<h2 id="technical-approach">Technical Approach</h2>

<p>Each pillar consisted of an apex and base (both <strong>PrisimMesh</strong>) on either end of a <strong>CylinderMesh</strong>. The <a href="https://godotshaders.com/shader/spatial-ice-shader/">Spatial Ice Shader</a> by NekotoArts &amp; Gabriel Aguiar formed the foundation of inspiring color gradients along the original light pillars.</p>

<p><img src="/assets/cs485/FBX_Weather_Slide_Video.gif" alt="First Draft: .gif of FBX Weather Transitions" /></p>

<p>Ice fog builds upon a Godot tutorial titled <a href="https://www.youtube.com/watch?v=VzLoEfTDM2c">Adding atmospheric 3D fog patches to a scene</a> by Martin Senges. Starting with a circular drawing in <a href="https://www.gimp.org/">GIMP</a> with <strong>CPUParticles</strong> and Atmospheric particles yields a realistic effect at differing intensity levels.</p>

<p><img src="/assets/cs485/atmospheric-fog.png" alt="GIMP Ice Fog Example" /></p>

<h4 id="node-configuration-warning">Node Configuration Warning</h4>

<p>Note that on macOS, particle rendering is much slower than CPUParticles due to transform feedback implementation on the CPU instead of the GPU. When targeting macOS devices, utilize the project setting (within the toolbar options) to convert to CPUParticles.</p>

<p><img src="/assets/cs485/ice-fog-example.png" alt="Godot Ice Fog Example" /></p>

<p>The ground is 2500 x 2500 <strong>QuadMesh</strong> rotated and transformed about the origin. Materials such as Fog from a Custom Color world environment – with a slight depth curve – yield a convincing skyline of Fairbanks, Alaska.</p>

<p><img src="/assets/cs485/street-lamp-example.png" alt="Second Draft: Proof of Concept Light Pillars" /></p>

<p>After the minimum viable tech demo, the focus shifted towards adding light source objects for pillars within a ray-traced object. <a href="https://github.com/olawlor/SpaceAssetsGodot/blob/main/Examples/Raytrace/Raytrace2_sphere_plane.gdshader">Raytracing demo 2: sphere and plane</a> by Dr. Orion Lawlor adapted nicely into a raytraced cylinder intersection.</p>

<p><img src="/assets/cs485/carbon-hq-godot-code.png" alt="Project Code of Ray Cylinder Intersection" /></p>

<p>Each lamp post consists of a light cap (<strong>CylinderMesh</strong>) and color temperature calibrated with <strong>OmniLight</strong>. The street lamp originates from a <a href="https://free3d.com/3d-model/street-light-lamp-61903.html">free 3D model</a> by tyrosmith, broken into six different surfaces.</p>

<p><img src="/assets/cs485/light-cap-example.png" alt="Light Cap Example" /></p>

<p>Additional colors are added via the Albedo color to improve contrast with the background. The ground texture formulates from a zoomed-in image of <a href="https://polyhaven.com/a/aerial_asphalt_01">Aerial Asphalt 01</a> texture by Rob Tuytel (CC0). Alterations to the 4K graphic show similarity to snowfall on a highway road.</p>

<p><img src="/assets/cs485/light-pillars-project.png" alt="Final Screenshot of Light Pillars Project" /></p>

<h2 id="conclusion">Conclusion</h2>

<p>Some key takeaways and lessons learned include taking the subsection of shape when given an inverted normal (like a light pillar). Knowing how to adapt the camera perspective and the ability to cull a 2D object also prove valuable.</p>

<p>Possible next steps for this project include improving scalability via different light sources (such as street lamp color temperature) and feathering edges of cylindrical objects as smooth surfaces.</p>

<p>My code and graphical assets are within the <a href="https://github.com/TechSolomon/cs485">GitHub repository</a>. This project runs on <a href="https://github.com/godotengine/godot">Godot Engine</a> v3.5.1 Stable Edition.</p>

<h2 id="further-reading">Further Reading</h2>

<ul>
  <li><em><a href="https://scholarworks.alaska.edu/handle/11122/6400">Atmospheric Halos and the Search for Angle x</a></em> (Walter Tape &amp; Jarmo Moilanen)</li>
  <li><em><a href="https://dspace.library.uvic.ca/bitstream/handle/1828/10602/Firmino_Arthur_MSc_2018.pdf">Physically Based Rendering of Ice Crystal Halos</a></em> (Arthur Pereira Vala Firmino)</li>
  <li><a href="https://www.pbr-book.org/3ed-2018/Shapes/Cylinders">3.3 Cylinders</a> – <em>Physically Based Rendering</em> (Matt Pharr, Wenzel Jakob, &amp; Greg Humphreys)</li>
  <li><a href="https://www.weather.gov/arx/why_halos_sundogs_pillars">What Causes Halos, Sundogs and Sun Pillars?</a> (National Weather Service)</li>
  <li><a href="https://www.its.caltech.edu/~atomic/publist/engsci2.pdf">The Physics of Snow Crystals - Morphogenesis on Ice</a> (Caltech)</li>
  <li><a href="https://www.gamedeveloper.com/programming/atmospheric-scattering-and-volumetric-fog-algorithm-part-1">Atmospheric scattering and “volumetric fog” algorithm – part 1</a> (Game Developer)</li>
  <li><a href="https://phys.org/news/2008-04-science-fog-machine-graphics.html">Computer Science Fog Machine Improves Computer Graphics</a> (UCSD)</li>
  <li><a href="https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering">Chapter 16. Accurate Atmospheric Scattering</a> (NVIDIA Developer)</li>
  <li><a href="https://people.computing.clemson.edu/~jtessen/reports/papers_files/Atmos_EGSR_Elec.pdf">Efficient Rendering of Atmospheric Phenomena</a> (Eurographics Symposium on Rendering, 2004)</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[UAF CS 485 → Computer Graphics Rendering (Fall 2022)]]></summary></entry></feed>