-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85b86c8
commit 06f6193
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Water Demo | ||
========== | ||
|
||
This is a port of Evan Wallace's [Water Demo](http://madebyevan.com/webgl-water/) from WebGL to Unity. | ||
|
||
Motivation | ||
---------- | ||
|
||
I ported this as an exercise to investigate different caustics implementations. Having surveyed research papers on real-time caustics, I believe Evan's work supercedes many published algorithms in terms of simplicity and performance and is suitable for publication. | ||
|
||
Requirements | ||
------------ | ||
|
||
* Unity 2018.2.17f1 | ||
|
||
Implementation Notes | ||
-------------------- | ||
|
||
This is a pretty faithful reproduction of Evan's demo. As such there are a number of cases where it deviates from Unity's conventions. | ||
|
||
For instance, the shader that renders the sphere has variable `sphereCenter`, so the sphere rendering object is expected to located at the origin and if you change that, it probably will not look right. | ||
|
||
The light direction is provided to shaders as a vector. It doesn't use Unity's lighting at all. | ||
|
||
The models' vertices do not have UV coordinates. For instance the cube's minimum and maximum model position are (-1, -1, -1) and (1, 1, 1), so any point on its surface is often just mapped directly to a UV coordinate [0, 1]^2 by transforming the point p by `p * 0.5 + 0.5`. This works fine for the purposes of the demo, but one would probably want to switch to UV coordinates in the future. | ||
|
||
A lot of this is smoke and mirrors. The cube knows where the sphere is, so it renders its shadow. Great for a tech demo, but if you want to allow for multiple spheres or other objects, this will need to be reformulated significantly. | ||
|
||
Bugs | ||
---- | ||
|
||
See the `todo.org` file. | ||
|
||
License | ||
------- | ||
|
||
This project is released under the MIT license. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.