Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nathan's awesome pull request #20

Open
wants to merge 108 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
ff5294b
Now we have a nice, pleasant wave! But it doesn't animate yet.
Nov 3, 2013
214a186
Got some motion going! Now I just have to color it to be able to make
Nov 3, 2013
d666939
We haz color!
Nov 3, 2013
b613f9f
Got simplex noise to work!
Nov 3, 2013
bbb1739
Got the night color working
Nov 3, 2013
3e5c3b3
Added some day/night blending. Doesn't work well though
Nov 3, 2013
77d69fd
Got a nice, smooth, day/night transition going
Nov 3, 2013
b7c0f39
Got a NIGHT_EPSILON that actually looks good...
Nov 3, 2013
40440a9
Now we added specular map to the globe.
Nov 4, 2013
f9a1b7e
Static clouds working. They don't scroll yet, and we also haven't
Nov 4, 2013
a86a516
Black clouds working.
Nov 4, 2013
66b4f66
Added diffuse shading on the clouds
Nov 4, 2013
8c811cd
Merge remote-tracking branch 'upstream/master'
Nov 4, 2013
9de8d9e
Normal map almost works. I don't think we should be applying the normal
Nov 5, 2013
1b44465
Now the clouds aren't affected by the bump-mapping.
Nov 5, 2013
65eac0d
Added rim lighting.
Nov 5, 2013
73a3e66
Added heightmap. Last commit before I try to do terrain rendering.
Nov 7, 2013
d0a88fc
Added terrain renderer.
Nov 7, 2013
eb7e375
Code for texture... I think works?
Nov 7, 2013
bf616b0
Now we've put in the basic parts to get the texture and bind the
Nov 7, 2013
329c76b
Well... we have a flat plane. No cool results yet.
Nov 7, 2013
cdc3eb4
I don't think we are reading the texture in properly...
Nov 7, 2013
c26fdb2
Changed texture size to a power of 2
Nov 7, 2013
b5a4a00
Back at square one. Now using Mozilla's tutorial to inject textures
Nov 7, 2013
dc8b2c0
Proof that positions are between 0 and 1.
Nov 7, 2013
c4d1960
TEH HEIGHT FIELD IS WORKING ZOMG
Nov 7, 2013
9ac000d
Got height field to rotate!
Nov 7, 2013
8537a7f
Got Mt. Fuji Working!
Nov 7, 2013
9d9f700
Reinier working... and now it looks like real terrain!
Nov 7, 2013
0d4de70
Got a properly-scaled Mt. Fuji working
Nov 7, 2013
d093af5
Now we can toggle the rotation direction...
Nov 7, 2013
18b4eeb
All the parts are in place for loading two height fields. Now I just
Nov 7, 2013
694a80b
Toggling between the two textures as height maps works!
Nov 7, 2013
d65412d
Halfway blend between the two height fields is working....
Nov 7, 2013
8279942
Renamed "rotateDir" to "blendDir". Also, added clamping to heightBlend.
Nov 7, 2013
8899b93
Added and centered the "Mt. Fuji" and "Mt. Rainier" buttons.
Nov 7, 2013
3411900
Code is down but there iz no blending
Nov 7, 2013
59e17b6
Blending between fragments works! WOO HOO!!!
Nov 7, 2013
55bcb11
Dark background a-go-go!
Nov 7, 2013
5e9495d
Got rid of unnecessary uniform.
Nov 7, 2013
76f73dd
I think my GET request actualy worked!
Nov 8, 2013
507dd8c
I think that the GET request succeeded?
Nov 8, 2013
9afd82f
We get a response back but there's nothing in it...
Nov 8, 2013
00d2d26
ZOMG WE HAZ THE LATITUDE IN THE CONSOLE
Nov 8, 2013
55acc64
JSON working in my javascript file!!! YAY
Nov 8, 2013
3816038
Added a part3 to add the orbiting ISS visualization.
Nov 8, 2013
8e65eeb
We haz a new initializeSphere() function that makes the globe smaller...
Nov 8, 2013
a574f15
Allright, now we put the vertex attributes for sphere2 in a different
Nov 8, 2013
c26cc3b
Allright! We were able to initialize a separate shader for the other
Nov 8, 2013
fea6e92
Named programs as globe_program and iss_program
Nov 8, 2013
ce3da3e
We wre able to recenter the small globe which represents the ISS. Now we
Nov 8, 2013
6015b84
Moved initializeSphere into the animation loop... not the best idea,
Nov 8, 2013
e33512b
We haz two models! YAY!
Nov 8, 2013
7bf90f1
Got the "ISS" to orbit at a reasonable "altitude"
Nov 8, 2013
73cd8ae
Now we finally got the ISS coordinates out of the JSON function
Nov 8, 2013
ce18eaa
Now I got spherical coordinates working properly.
Nov 9, 2013
2019839
We are at (0,0) latitude and longitude! YAY!
Nov 9, 2013
73313d7
I think I got the coordinates to work correctly in Degrees North and
Nov 9, 2013
31db09a
Iss location is now plugged in!
Nov 9, 2013
8df372d
Now we update once every five seconds! YAYNESS!
Nov 9, 2013
e4ab952
Got mah square working!
Nov 9, 2013
9e71d20
Scaled the square to a more reasonable size.
Nov 9, 2013
9db20ab
Got the patch to face the camera...
Nov 9, 2013
802b25a
Recentered the square so the rotation bug is slightly more palatable
Nov 9, 2013
31fddeb
Ready to plug in the ISS shader (which just draws a transparent texture)
Nov 9, 2013
342472a
ISS working with a separate fragment shader. YAY!!!
Nov 9, 2013
bcb7249
ISS LOGO IS WORKING!!! WOO HOO!!!
Nov 9, 2013
0bab738
ISS transparency, WORKING!
Nov 9, 2013
b52257d
Got the day/night on the globe to reflect the Earth's real day/night
Nov 9, 2013
27ef446
Incorporated minutes and seconds into the day/night calculation.
Nov 9, 2013
0330330
We have drawn our single line!
Nov 9, 2013
83e572c
ISS is just over south america
Nov 9, 2013
c66dcf4
Got num verts working correctly again!
Nov 9, 2013
ce33a9f
Added law for number of vertices for trail
Nov 9, 2013
e91933a
Allright, I think that the array for trail drawing is ready
Nov 9, 2013
41d7899
Trail draws! YAY!
Nov 9, 2013
a1f8513
Fixed the depth-ordering problem by drawing the ISS logo AFTER drawing
Nov 9, 2013
6b0380b
Last commit before performance testing.
Nov 9, 2013
1e48903
Fixed globe in part 2
Nov 9, 2013
542a1f8
Now we got rid of unnecessary shader initialization
Nov 9, 2013
27d117c
Well, now we initialize the shader 3 more intelligently
Nov 9, 2013
6e955b3
NOW it's much faster because we don't initialize the stupid shaders each
Nov 9, 2013
6f543e5
Last commit before gh-pages.
Nov 9, 2013
66a60a4
Updated README for the first time
Nov 9, 2013
a994e4e
Updated heading
Nov 9, 2013
839f2ce
Updated title again
Nov 9, 2013
09466ac
Added links and bullets to README
Nov 9, 2013
21fd836
Fixed bullets and links
Nov 9, 2013
7e336f1
Added our first screenshot
Nov 9, 2013
9403c0c
Added more links, plus some glsl
Nov 9, 2013
a39c528
Edited GLSL part
Nov 9, 2013
57fff09
Added glsl
Nov 9, 2013
a461c04
Got rid of the color adding thing
Nov 9, 2013
ae72821
Added links to the other wave demos
Nov 9, 2013
89ffe6e
Updated frag globe to be centered, plus back bg
Nov 9, 2013
1014264
Added the day/night calculation to readme
Nov 9, 2013
9ef927e
Added performance analysis.
Nov 9, 2013
efc5d75
Adjusted spacing around performance analysis
Nov 9, 2013
360fd14
Added link to video of the ISS tracker
Nov 9, 2013
fe142c4
Got rid of those pesky periods
Nov 9, 2013
6796c74
Fixed links to demos (hopefully)
Nov 9, 2013
6f03c35
Added better disclaimer
Nov 9, 2013
6b468dc
fixed more broken URLs
Nov 9, 2013
16f19a0
Update README.md
Nov 9, 2013
e47efe1
Update README.md
Nov 9, 2013
dc7bbde
Update README.md
Nov 9, 2013
beb1bad
Update README.md
Nov 9, 2013
1578222
Update README.md
Nov 9, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Normal map almost works. I don't think we should be applying the normal
to the clouds though.
Nathan Marshak committed Nov 5, 2013
commit 9de8d9e405afb2b3cd9f841d230a8b7fa6e95ac3
20 changes: 18 additions & 2 deletions part2/frag_globe.html
Original file line number Diff line number Diff line change
@@ -72,13 +72,29 @@
mat3 eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC);

float NIGHT_EPSILON = 0.1;
float bumpMapWidth = 1024.0;
float bumpMapHeight = 512.0;

void main(void)
{
// surface normal - normalized after rasterization
vec3 normal = normalize(v_Normal);
//vec3 normal = normalize(v_Normal);
// normalized eye-to-position vector in camera coordinates
vec3 eyeToPosition = normalize(v_Position);

//compute normal from bump map
float texelWidth = 1.0/bumpMapWidth;
float texelHeight = 1.0/bumpMapHeight;
float centerTexel = texture2D(u_Bump, v_Texcoord).r;
float rightTexel = texture2D(u_Bump, vec2(v_Texcoord.x + texelWidth, v_Texcoord.y)).r;
float topTexel = texture2D(u_Bump, vec2(v_Texcoord.x, v_Texcoord.y + texelHeight)).r;
vec3 tgtSpaceNormal = normalize(vec3(centerTexel - rightTexel, centerTexel - topTexel, 0.2));

//this matrix brings us from tangent space to eye space
mat3 tgtToEye = eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_Normal));

//normal in eye/camera coordinates
vec3 normal = normalize(tgtToEye * tgtSpaceNormal);

float diffuse = clamp(dot(u_CameraSpaceDirLight, normal), 0.0, 1.0);

@@ -89,7 +105,7 @@
float gammaCorrect = 1.0/1.2; //gamma correct by 1/1.2

vec2 offsetTexcoord = v_Texcoord;
offsetTexcoord.s += 0.1*u_time;
offsetTexcoord.s += 0.1*u_time;

vec3 dayColor = texture2D(u_DayDiffuse, v_Texcoord).rgb;
vec3 cloudColor = texture2D(u_Cloud, offsetTexcoord).rgb;