Skip to content

Latest commit

 

History

History
61 lines (33 loc) · 3.88 KB

Milestone2.md

File metadata and controls

61 lines (33 loc) · 3.88 KB

Cesium Snow Rendering Milestone2

Prepared by Anton Khabbaz, Yaoyi Bai, Yuxin Hu

Overview

In this milestone we added noise to terrain surface normal to get a more realistice snow look. We also tried to implement the snow falling effect in Cesium as a post-processing shader layer.

Features Implemented

Perlin Noise Generation

  • We needed perlin noise in both slope and surface normal. To better understand how perlin noise works, we wrote a function to generate and plot 1D perlin noise. This is 3 tiles of Perlin noise that uses a cos smoothing function and includes 6 octaves.

In our application, we will use a 2D noise texture, and take fragment position x, y components to generate Perline Noise by sampling the texture. We will generate float number noise value from 2D texture with method described in this post(http://flafla2.github.io/2014/08/09/perlinnoise.html). For a vec3 noise value, we will interpolate the texture rgb color with the closest 4 samples around the point in each octave and add them up.

Adding Noise to Surface normal

  • We added noise to terrain surface normal to get a more realistic accumulated snow look, as described by Ohlsson, P. and Seipel, S](http://www.ep.liu.se/ecp/013/007/ecp01307.pdf) In their paper, they have proposed a method to generate Perlin noise to normal vector by sampling 3 octaves. We simplified the noise generation process by reading a pixel color from a colored perlin noise texture. This is not a good way to generate noise, we will change it to the method we described above in feature 1.

Colored Perlin Noise From Online(http://aave.phatcode.net/infiniverse/?p=articles-creating_nebulae.php)

The original terrain surface normal in eye space is:

Normal without noise in eye space

After we added noise to surface normal

Normal with noise in eye space

Here is a comparison of snow with and without noise added to surface normal: |

Snow Falling Particles As Post Processing Layer

  • We tried to integrate the snow falling particles we implemented in shader toy in our last milestone(https://github.com/HuYuxin/CIS565FinalProjectCesiumSnow/blob/YuxinBranch/Mileston1.md) as a post processing layer to our snow accumulated rendering. As a simple test we implemented the ray marching and snow rendering inside snow material. To test we temporarily turned snow flake color from white to red. It may look weird that you only see red color mountain instead of red color snow flake for now. The reason we had red mountain is that: first, I coded inside the wrong shader. I should add snow falling effect in the fragment shader, but I added it in the "snow material shader". Therefore, the snow falling effect is only rendered on the material texture of the terrain rather than on the screen. Currently I am working on a new fragment shader for post-process. Ideally we will have a whole new html file to show the final snowing result, and hopefully we can present it next Monday.

Plans for future milestones

  • Milestone 3: Integrate the snow particle rendering in Cesium. Make the snow particle render modifiable through the website.

  • Milestone 4: Add the option to toggle noise in normal and slope to show the difference. Add the option to change how heavy the snow looks like, and add any wind forces to snow.

References

  1. Ohlsson, P. and Seipel, S., 2004, November. Real-time rendering of accumulated snow. In The Annual SIGRAD Conference. Special Theme-Environmental Visualization (No. 013, pp. 25-31). Linköping University Electronic Press.

  2. Perlin Noise Texture http://aave.phatcode.net/infiniverse/?p=articles-creating_nebulae.php