/graphicsfinal

Final for UT Graphics

Primary LanguageGLSL

Link to Google Doc Version: https://docs.google.com/document/d/1BHrYV-e4ZFXq30BkAsYlu5_PYDqiR6ZtLTZgcLE7u7w/edit?usp=sharing

Noisy Shaders Final Report

Ethan Williams, esw597
Madeline Huang, mh52978

Background
Shaders frequently use noise generation in order to create procedurally generated
textures; these can be two, three, or higher-dimensional noise functions, and
can be used to generate static terrain, or dynamic moving 2D textures by passing
time into the third dimension of the noise function.

Description
We explored the usage of noise functions in generating dynamic textures using
gradient noise in order to develop continuously random textures. We aimed for
primarily aesthetic effects, such as weather effects (eclipse, aurora, clouds)
and magma/ice, and also explored wave and terrain generation. Finally, we
implemented simple controls in order for the user to alter the color and
positional/resolution values of the shaders.

Artifacts
There are 10 shaders to look through, and each can be accessed by the numbers
1234567890.
Shaders 1, 2, & 3 are fragment shaders drawn on the floor to showcase
weather/sky effects. Shader 1 shows the aurora borealis, using only the x values
of the texture to generate noise, then altering the y position and magnitude of
the value based on additional noise. Shader 2 shows an eclipse, achieved with
exponential distance-based reduction of the noise function based on the x-y
distance of the current fragment to the center of the eclipse, as well as
pinpoint twinkling stars using strict gating of noise values such that only very
bright points are drawn.
Shader 3 shows god rays, which simply use both the x and y coordinate of the
fragment in both the x and y values of the noise function.
Shaders 4, 5, 6, & 7 are fragment shaders drawn on the menger cube to showcase
texture effects. Shader 4 shows sparkles. Shader 5 shows wispy clouds.
Shader 6 shows ice. Shader 7 shows magma. The clouds (shader 5) and the magma
(shader 7) are fairly similar, with a difference in the number of octaves used
and how the values were multiplied together. The ice (Shader 6) passes time
into cellular noise instead of gradient noise, but gradient noise is also used
for the coloring of the cells, and the twinkling reuses the stars from the
eclipse (shader 2). The pulsing brightness of ice and magma was calculated by
passing in time into a sine function.
Shaders 8, 9, & 0 are fragment and vertex shaders drawn on the floor to
showcase noise effects generated in the vertex shaders. Shader 8 shows water,
which fragment shader was almost the same as ice (Shader 6), except with faster
time and inverted color values. Shader 9 shows a generated terrain which was made
using gradient noise with octaves in the vertex shader. The fragment shader
colored based off of the terrain's y-coordinate. The fragment shader also
did secondary coloring based off of the terrain's "biomes", which was just
another noise map generated by gradient noise. Shader 0 is a combination of
shader 8 and 9.
For each shader, we've also included mouse control. Sliding the mouse
up/down and left/right will toggle the shaders' color, zoom, pan, or something
similar. If you wish to use mouse control, press SPACE to switch between the
original shader and the mouse controlled shader.
To move the camera around, it's recommended that you use keys WASD and UP/DOWN
arrows.

References
https://thebookofshaders.com/
https://www.redblobgames.com/maps/terrain-from-noise/