diff --git a/Part1/PROJ_WIN/Project3/Project3.vcxproj b/Part1/PROJ_WIN/Project3/Project3.vcxproj index 20ddcbc..941a389 100644 --- a/Part1/PROJ_WIN/Project3/Project3.vcxproj +++ b/Part1/PROJ_WIN/Project3/Project3.vcxproj @@ -26,7 +26,7 @@ false true MultiByte - v110 + v100 @@ -42,6 +42,9 @@ false + + false + Level3 @@ -71,12 +74,18 @@ MaxSpeed true true + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include;C:/ProgramData/NVIDIA Corporation/CUDA Samples/v5.5/common/inc;../shared/glew/includes;../shared/freeglut/includes true true true + ../shared/glew/lib;../shared/freeglut/lib;%(AdditionalLibraryDirectories) + cudart.lib; glew32.lib;glu32.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include;C:/ProgramData/NVIDIA Corporation/CUDA Samples/v5.5/common/inc;../shared/glew/includes;../shared/freeglut/includes + @@ -100,7 +109,8 @@ - + + diff --git a/Part1/PROJ_WIN/Project3/Project3.vcxproj.filters b/Part1/PROJ_WIN/Project3/Project3.vcxproj.filters index e6c27f6..73aa821 100644 --- a/Part1/PROJ_WIN/Project3/Project3.vcxproj.filters +++ b/Part1/PROJ_WIN/Project3/Project3.vcxproj.filters @@ -57,10 +57,13 @@ Resource Files - + Resource Files - + + Resource Files + + Resource Files diff --git a/Part1/PROJ_WIN/Project3/shaders/heightFS.glsl b/Part1/PROJ_WIN/Project3/shaders/heightFS.glsl index e36d53e..cf30f00 100644 --- a/Part1/PROJ_WIN/Project3/shaders/heightFS.glsl +++ b/Part1/PROJ_WIN/Project3/shaders/heightFS.glsl @@ -1,4 +1,14 @@ +#version 330 + +in float f_height; +in vec2 v_Texcoords; + void main(void) { - gl_FragColor = vec4(0.05,0.15,0.3,1.0); -} + float shade = (1.0-2.0*sqrt(f_height)); +float alpha = float(mod(v_Texcoords.x+0.025, 0.05) > 0.046 ||mod(v_Texcoords.y+0.025, 0.05) > 0.046); +vec4 color = mix(vec4(0.05,0.15,0.3,1.0), vec4(0.05, 0.3, 0.4, 1.0), alpha); + + + gl_FragColor = shade*color*1.5f; +} \ No newline at end of file diff --git a/Part1/PROJ_WIN/Project3/shaders/heightVS.glsl b/Part1/PROJ_WIN/Project3/shaders/heightVS.glsl index eda1b93..c7cf4cb 100644 --- a/Part1/PROJ_WIN/Project3/shaders/heightVS.glsl +++ b/Part1/PROJ_WIN/Project3/shaders/heightVS.glsl @@ -1,9 +1,21 @@ +#version 330 + uniform mat4 u_projMatrix; -attribute vec4 Position; +uniform sampler2D u_height; + +in vec4 Position; +in vec2 Texcoords; + +out vec2 v_Texcoords; +out float f_height; void main(void) { - vec4 pos = u_projMatrix * Position; - pos.z += 0.01; - gl_Position = pos; -} + v_Texcoords = Texcoords; + vec4 pos = Position; + f_height = texture2D(u_height, Texcoords).w; + pos.z = -0.01-clamp(f_height,0.0,2.0); + //pos.z=-0.5f;//-f_height/2.0f; + pos = u_projMatrix * pos; + gl_Position = pos; +} \ No newline at end of file diff --git a/Part1/PROJ_WIN/Project3/shaders/planetFS.glsl b/Part1/PROJ_WIN/Project3/shaders/planetFS.glsl index e2c1350..adfbb68 100644 --- a/Part1/PROJ_WIN/Project3/shaders/planetFS.glsl +++ b/Part1/PROJ_WIN/Project3/shaders/planetFS.glsl @@ -1,4 +1,54 @@ -void main(void) +#version 330 + +uniform vec3 u_targetposition; + +in vec3 WorldCoord; +in vec3 ToCam; +in vec3 Up; +in vec3 Right; +in vec2 TexCoord; +out vec4 FragColor; + + +in vec3 normal_f1; +in vec3 normal_f2; +in vec3 normal_f3; +in vec3 normal_f4; + +in vec3 thecolor; + +void main() { - gl_FragColor = vec4(1.0); -} + vec2 coord = 2.01 * (TexCoord - vec2(0.5)); + float r = length(coord); + // if (r >= 1.0) { discard; } + float dist = length(-u_targetposition/100.0f-WorldCoord); + if(dist <= 0.01) + { + FragColor = vec4(1.0f); + return; + } + + vec3 N = Right*-coord.x + Up*coord.y + ToCam*sqrt(1-r*r); + + float x=TexCoord.x; + float y=TexCoord.y; + if(y<0.5f){if(x+y<0.5f) N=normal_f1;else N=normal_f2;} + else{if(x+y<1.0f)N=normal_f3;else N=normal_f4;} + + vec3 L2= vec3(0,0,1); + float light2 = 0.1 + 0.9*clamp(dot(N,L2),0.0, 1.0);//*exp(-dist); + + + vec3 L1 = normalize(-u_targetposition/100.0f-WorldCoord); + float light1 = 0.1 + 0.9*clamp(dot(N,L1),0.0, 1.0)*exp(-dist/2.0f); + + + + vec3 color = vec3(77, 184, 73)*(1.0f/255.0f); + + FragColor = vec4(thecolor*(light1+light2),1.0)*1.0f; + //FragColor=vec4((N+vec3(1.0f))*0.5f,1.0f); + + +} \ No newline at end of file diff --git a/Part1/PROJ_WIN/Project3/shaders/planetGS.glsl b/Part1/PROJ_WIN/Project3/shaders/planetGS.glsl deleted file mode 100644 index 88027d3..0000000 --- a/Part1/PROJ_WIN/Project3/shaders/planetGS.glsl +++ /dev/null @@ -1,15 +0,0 @@ -#version 330 - -uniform mat4 u_projMatrix; - -layout (points) in; -layout (points) out; -layout (max_vertices = 1) out; - -void main() -{ - vec3 Position = gl_in[0].gl_Position.xyz; - gl_Position = u_projMatrix * vec4(Position, 1.0); - EmitVertex(); - EndPrimitive(); -} diff --git a/Part1/PROJ_WIN/Project3/shaders/planetGS_cloth.glsl b/Part1/PROJ_WIN/Project3/shaders/planetGS_cloth.glsl new file mode 100644 index 0000000..8f6a17c --- /dev/null +++ b/Part1/PROJ_WIN/Project3/shaders/planetGS_cloth.glsl @@ -0,0 +1,130 @@ +#version 330 + +uniform mat4 u_projMatrix; +uniform vec3 u_cameraPos; + +layout (points) in; +layout (triangle_strip , max_vertices=6) out; + +in vec3 v_Velocity[]; + +out vec3 WorldCoord; +out vec3 ToCam; +out vec3 Up; +out vec3 Right; +out vec2 TexCoord; + +out vec3 normal_f1; +out vec3 normal_f2; +out vec3 normal_f3; +out vec3 normal_f4; + +out vec3 thecolor; + +const float scale = 0.03; + + +void main() +{ + + vec3 g_Vel=v_Velocity[0]; + + vec3 Position = gl_in[0].gl_Position.xyz; + + WorldCoord = Position; + + float coloridx=gl_in[0].gl_Position.w; + if(coloridx<0.05f) + { + thecolor=vec3(227,51,49)/255.0f; + } + else if(coloridx<1.05f) + { + thecolor=vec3(252,210,9)/255.0f; + } + else if(coloridx<2.05f) + { + thecolor=vec3(76,183,73)/255.0f; + } + else if(coloridx<3.05f) + { + thecolor=vec3(78,135,192)/255.0f; + } + else if(coloridx<4.05f) + { + thecolor=vec3(163,101,247)/255.0f; + } + + //thecolor=vec3(1,1,1); + + + //vec3 orientation=normalize(g_Vel); + //vec3 up=(abs(orientation.x)>0.5f)?vec3(0,1,0):vec3(1,0,0); + //vec3 left=normalize(cross(orientation,up)); + //up=normalize(cross(orientation,left)); + + + //vec3 pos1=Position+scale*(up); + //vec3 pos2=Position+scale*(-0.5*up-0.866*left); + //vec3 pos3=Position+scale*(-0.5*up+0.866*left); + //vec3 pos4=Position+scale*(4.414*orientation); + + vec3 pos1=Position+scale*vec3(1,0,0); + vec3 pos2=Position+scale*vec3(-0.5,0.866,0); + vec3 pos3=Position+scale*vec3(-0.5,-0.866,0); + vec3 pos4=Position+scale*vec3(0,0,1.414); + + + + normal_f1=normalize(cross(pos1-pos2,pos2-pos3)); + normal_f2=normalize(cross(pos4-pos2,pos2-pos3)); + normal_f3=normalize(cross(pos3-pos1,pos1-pos4)); + normal_f4=normalize(cross(pos4-pos1,pos1-pos2)); + + + ToCam = normalize(u_cameraPos - Position); + Up = vec3(0.0, 0.0, 1.0); + Right = cross(ToCam, Up); + Up = cross(Right, ToCam); + + + vec3 Pos = Position + scale*Right - scale*Up; + Pos=pos1; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.0, 0.0); + EmitVertex(); + + //Pos = Position + scale*Right + scale*Up; + Pos=pos2; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.5, 0.0); + EmitVertex(); + + //Pos = Position - scale*Right - scale*Up; + Pos=pos3; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.0, 0.5); + EmitVertex(); + + Pos=pos4; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.5, 0.5); + EmitVertex(); + + Pos=pos1; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.0, 1.0); + EmitVertex(); + + Pos=pos2; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.5, 1.0); + EmitVertex(); + + //Pos = Position - scale*Right + scale*Up; + //gl_Position = u_projMatrix * vec4(Pos, 1.0); + //TexCoord = vec2(1.0, 1.0); + //EmitVertex(); + + EndPrimitive(); +} diff --git a/Part1/PROJ_WIN/Project3/shaders/planetGS_flock.glsl b/Part1/PROJ_WIN/Project3/shaders/planetGS_flock.glsl new file mode 100644 index 0000000..e5f66dd --- /dev/null +++ b/Part1/PROJ_WIN/Project3/shaders/planetGS_flock.glsl @@ -0,0 +1,126 @@ +#version 330 + +uniform mat4 u_projMatrix; +uniform vec3 u_cameraPos; + +layout (points) in; +layout (triangle_strip , max_vertices=6) out; + +in vec3 v_Velocity[]; + +out vec3 WorldCoord; +out vec3 ToCam; +out vec3 Up; +out vec3 Right; +out vec2 TexCoord; + +out vec3 normal_f1; +out vec3 normal_f2; +out vec3 normal_f3; +out vec3 normal_f4; + +out vec3 thecolor; + +const float scale = 0.03; + + +void main() +{ + + vec3 g_Vel=v_Velocity[0]; + + vec3 Position = gl_in[0].gl_Position.xyz; + + WorldCoord = Position; + + float coloridx=gl_in[0].gl_Position.w; + if(coloridx<0.05f) + { + thecolor=vec3(227,51,49)/255.0f; + } + else if(coloridx<1.05f) + { + thecolor=vec3(252,210,9)/255.0f; + } + else if(coloridx<2.05f) + { + thecolor=vec3(76,183,73)/255.0f; + } + else if(coloridx<3.05f) + { + thecolor=vec3(78,135,192)/255.0f; + } + else if(coloridx<4.05f) + { + thecolor=vec3(163,101,247)/255.0f; + } + + //thecolor=vec3(1,1,1); + + + vec3 orientation=normalize(g_Vel); + vec3 up=(abs(orientation.x)>0.5f)?vec3(0,1,0):vec3(1,0,0); + vec3 left=normalize(cross(orientation,up)); + up=normalize(cross(orientation,left)); + + + vec3 pos1=Position+scale*(up); + vec3 pos2=Position+scale*(-0.5*up-0.866*left); + vec3 pos3=Position+scale*(-0.5*up+0.866*left); + vec3 pos4=Position+scale*(4.414*orientation); + + + + + normal_f1=normalize(cross(pos1-pos2,pos2-pos3)); + normal_f2=normalize(cross(pos4-pos2,pos2-pos3)); + normal_f3=normalize(cross(pos3-pos1,pos1-pos4)); + normal_f4=normalize(cross(pos4-pos1,pos1-pos2)); + + + ToCam = normalize(u_cameraPos - Position); + Up = vec3(0.0, 0.0, 1.0); + Right = cross(ToCam, Up); + Up = cross(Right, ToCam); + + + vec3 Pos = Position + scale*Right - scale*Up; + Pos=pos1; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.0, 0.0); + EmitVertex(); + + //Pos = Position + scale*Right + scale*Up; + Pos=pos2; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.5, 0.0); + EmitVertex(); + + //Pos = Position - scale*Right - scale*Up; + Pos=pos3; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.0, 0.5); + EmitVertex(); + + Pos=pos4; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.5, 0.5); + EmitVertex(); + + Pos=pos1; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.0, 1.0); + EmitVertex(); + + Pos=pos2; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.5, 1.0); + EmitVertex(); + + //Pos = Position - scale*Right + scale*Up; + //gl_Position = u_projMatrix * vec4(Pos, 1.0); + //TexCoord = vec2(1.0, 1.0); + //EmitVertex(); + + EndPrimitive(); +} diff --git a/Part1/PROJ_WIN/Project3/shaders/planetVS.glsl b/Part1/PROJ_WIN/Project3/shaders/planetVS.glsl index ea3e149..91fbef3 100644 --- a/Part1/PROJ_WIN/Project3/shaders/planetVS.glsl +++ b/Part1/PROJ_WIN/Project3/shaders/planetVS.glsl @@ -1,8 +1,14 @@ #version 330 in vec4 Position; +in vec2 Texcoords; +in vec4 Velocity; + +out vec3 v_Velocity; void main(void) { gl_Position = Position; + v_Velocity=normalize(Velocity.xyz)*1.0f; + //gl_Position=vec4(v_Velocity,1.0f); } diff --git a/Part1/PROJ_WIN/src/kernel.cu.deps b/Part1/PROJ_WIN/src/kernel.cu.deps index 35aaf16..2ec14c2 100644 --- a/Part1/PROJ_WIN/src/kernel.cu.deps +++ b/Part1/PROJ_WIN/src/kernel.cu.deps @@ -1,18 +1,18 @@ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\cuda_runtime.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_config.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sal.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sal.h c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\builtin_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\device_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\driver_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stddef.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stddef.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\surface_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\driver_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\texture_types.h @@ -68,12 +68,12 @@ c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\surface_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\texture_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\vector_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\time.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wtime.inl -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\time.inl +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\time.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wtime.inl +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\time.inl c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\math_functions.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\builtin_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\device_types.h @@ -82,16 +82,16 @@ c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\surface_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\texture_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\vector_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdlib.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cmath -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\yvals.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\use_ansi.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdlib.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cmath +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\yvals.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\use_ansi.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\cuda_surface_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\builtin_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\device_types.h @@ -239,285 +239,286 @@ c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\vector_functions.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\device_launch_parameters.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\vector_types.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\swprintf.inl +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\swprintf.inl C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\cuda.h -c:\users\liam\project3-simulation\part1\src\glm/glm.hpp -c:\users\liam\project3-simulation\part1\src\glm\core/_fixes.hpp -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\climits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cfloat -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\float.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtwrn.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cwchar -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wchar.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstddef -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdio -c:\users\liam\project3-simulation\part1\src\glm\core/setup.hpp -c:\users\liam\project3-simulation\part1\src\glm\./core/_detail.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\setup.hpp -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cassert -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\assert.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -c:\users\liam\project3-simulation\part1\src\glm\./core/_vectorize.hpp -c:\users\liam\project3-simulation\part1\src\glm\./core/type.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_half.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_half.inl -c:\users\liam\project3-simulation\part1\src\glm\core\_detail.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_half.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\setup.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\setup.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_detail.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_gentype.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec1.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_gentype.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle_func.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec1.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec2.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec2.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec3.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec3.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec4.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec4.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x2.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_gentype.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x2.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x3.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x3.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x4.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x4.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x2.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x2.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x3.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x3.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x4.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x4.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x2.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x2.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x3.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x3.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x4.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x4.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_trigonometric.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_trigonometric.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_exponential.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_exponential.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_common.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_fixes.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_common.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_packing.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_packing.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_geometric.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_geometric.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_matrix.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_matrix.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_vector_relational.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_detail.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_vector_relational.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_integer.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_integer.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_noise.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_noise.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\utilities.h -c:\users\liam\project3-simulation\part1\src\glm/glm.hpp -c:\users\liam\project3-simulation\part1\src\glm\core/_fixes.hpp -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\algorithm -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\memory -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmemory -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\exception -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\eh.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\malloc.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdbg.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\type_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xtr1common -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\typeinfo -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\setjmp.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\immintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\nmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\smmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\tmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\pmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\emmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mm3dnow.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\istream -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ios -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocnum -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\streambuf -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xiosbase -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdexcept -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstring -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocinfo -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocinfo.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\locale.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xdebug -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cerrno -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\share.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iterator -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sstream -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfunctional -c:\users\liam\project3-simulation\part1\src\cudaMat4.h -c:\users\liam\project3-simulation\part1\src\glm/glm.hpp -c:\users\liam\project3-simulation\part1\src\glm\core/_fixes.hpp +e:\gitprojects\project3-simulation\part1\src\glm/glm.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core/_fixes.hpp +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\climits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cfloat +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\float.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtwrn.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cwchar +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wchar.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstddef +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdio +e:\gitprojects\project3-simulation\part1\src\glm\core/setup.hpp +e:\gitprojects\project3-simulation\part1\src\glm\./core/_detail.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\setup.hpp +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cassert +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\assert.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +e:\gitprojects\project3-simulation\part1\src\glm\./core/_vectorize.hpp +e:\gitprojects\project3-simulation\part1\src\glm\./core/type.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_half.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_half.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\_detail.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_float.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_half.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\setup.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_int.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\setup.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\_detail.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_gentype.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_size.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec1.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_gentype.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_float.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_int.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_size.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\_swizzle.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\_swizzle_func.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec1.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec2.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_float.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_int.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_size.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\_swizzle.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec2.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec3.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_float.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_int.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_size.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\_swizzle.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec3.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec4.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_float.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_int.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_size.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\_swizzle.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_vec4.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat2x2.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_gentype.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat2x2.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat2x3.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat2x3.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat2x4.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat2x4.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat3x2.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat3x2.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat3x3.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat3x3.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat3x4.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat3x4.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat4x2.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat4x2.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat4x3.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat4x3.inl +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat4x4.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\type_mat4x4.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/func_trigonometric.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\func_trigonometric.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/func_exponential.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\func_exponential.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/func_common.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\_fixes.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\func_common.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/func_packing.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\func_packing.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/func_geometric.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\func_geometric.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/func_matrix.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\func_matrix.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/func_vector_relational.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\_detail.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\func_vector_relational.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/func_integer.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\func_integer.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/func_noise.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core\func_noise.inl +e:\gitprojects\project3-simulation\part1\src\glm\./core/_swizzle.hpp +e:\gitprojects\project3-simulation\part1\src\utilities.h +e:\gitprojects\project3-simulation\part1\src\glm/glm.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core/_fixes.hpp +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\algorithm +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\memory +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmemory +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\exception +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\eh.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\malloc.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdbg.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\type_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xtr1common +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\typeinfo +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\setjmp.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\immintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\nmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\smmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\tmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\pmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\emmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ammintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mm3dnow.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\istream +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ios +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocnum +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\streambuf +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xiosbase +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdexcept +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstring +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocinfo +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocinfo.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\locale.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xdebug +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cerrno +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\share.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iterator +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sstream +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfunctional +e:\gitprojects\project3-simulation\part1\src\cudaMat4.h +e:\gitprojects\project3-simulation\part1\src\glm/glm.hpp +e:\gitprojects\project3-simulation\part1\src\glm\core/_fixes.hpp C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\cuda_runtime.h -c:\users\liam\project3-simulation\part1\src\kernel.h +e:\gitprojects\project3-simulation\part1\src\kernel.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/config.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/config/config.h @@ -534,7 +535,7 @@ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/co C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/config/hd_warning_disable.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/cstdint.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random/discard_block_engine.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iostream +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iostream C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random/detail/random_core_access.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random/detail/discard_block_engine.inl C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random/linear_congruential_engine.h diff --git a/Part1/src/kernel.cu b/Part1/src/kernel.cu index 32b3cb1..64fc317 100644 --- a/Part1/src/kernel.cu +++ b/Part1/src/kernel.cu @@ -5,24 +5,36 @@ #include "utilities.h" #include "kernel.h" -#if SHARED == 1 +#define CLOTHACC(x,y,z,w) clothAcc(x,y,z,w) + +#ifdef SHARED #define ACC(x,y,z) sharedMemAcc(x,y,z) + #define FLOCKVEL(x,y,z,w,a) sharedFlockVel(x,y,z,w,a) #else #define ACC(x,y,z) naiveAcc(x,y,z) + #define FLOCKVEL(x,y,z,w,a) naiveFlockVel(x,y,z,w,a) #endif + + + //GLOBALS dim3 threadsPerBlock(blockSize); int numObjects; +glm::vec2 clothSize; const float planetMass = 3e8; const __device__ float starMass = 5e10; +int currentFrame; + const float scene_scale = 2e2; //size of the height map in simulation space glm::vec4 * dev_pos; glm::vec3 * dev_vel; +glm::vec3* springs; + void checkCUDAError(const char *msg, int line = -1) { cudaError_t err = cudaGetLastError(); @@ -74,6 +86,136 @@ void generateRandomPosArray(int time, int N, glm::vec4 * arr, float scale, float } } +__global__ + void generateKnotPos( int N, glm::vec4 * arr, float mass, glm::vec2 clothsize) +{ + int x = (blockIdx.x * blockDim.x) + threadIdx.x; + int y = (blockIdx.y * blockDim.y) + threadIdx.y; + int index = x + (y * clothsize.x); + + if((x=0 && y>=0 && x<(int)clothsize.x && y<(int)clothsize.y); +} +__device__ int translateidx(glm::vec2 clothsize, int x, int y) +{ + return x+y*(int)clothsize.x; +} +__global__ + void generateSprings( int N, glm::vec4 * arr, glm::vec3* springs, glm::vec2 clothsize) +{ + int x = (blockIdx.x * blockDim.x) + threadIdx.x; + int y = (blockIdx.y * blockDim.y) + threadIdx.y; + int index = x + (y * clothsize.x); + + if((xVELTHRESHOLD) result=glm::normalize(result)*VELTHRESHOLD; + return result; +} + +__device__ + glm::vec3 sharedFlockVel(int N, int myidx, glm::vec4 * their_pos, glm::vec3* velocities, glm::vec3 targetPos) +{ + glm::vec3 result(0,0,0); + glm::vec3 cm(0,0,0); + glm::vec3 avgVel(0,0,0); + glm::vec3 separation(0,0,0); + glm::vec3 myPos(their_pos[myidx]); + int NofNeighbour=0; + int blocknum=(int)ceil(float(N)/float(blockSize)); + + __shared__ glm::vec4 currentPos[blockSize]; + __shared__ glm::vec3 currentVel[blockSize]; + + for(int i=0;iVELTHRESHOLD) result=glm::normalize(result)*VELTHRESHOLD; + return result; +} + +__device__ + glm::vec3 clothAcc(glm::vec2 clothsize, glm::vec2 myidx, glm::vec4 * their_pos, glm::vec3* springs) +{ + int x=myidx.x; + int y=myidx.y; + int index=translateidx(clothsize,x,y); + + glm::vec3 result(WINDX, WINDY ,SCALEDGRAVITY); + glm::vec3 force(0,0,0); + + if(x>clothsize.x-4 )return glm::vec3(0,0,0); + + int idxoffset=index*SPRINGPERKNOT; + for(int i=0;i5.0f) acc=glm::normalize(acc)*5.0f; + + vel[index]+=acc*dt; + pos[index].x += vel[index].x * dt; + pos[index].y += vel[index].y * dt; + pos[index].z += vel[index].z * dt; + if(abs(pos[index].x)>BOUNDARY|| abs(pos[index].y)>BOUNDARY || abs(pos[index].z)>BOUNDARY) + { + vel[index]=-vel[index]; + pos[index].x += 2*vel[index].x * dt; + pos[index].y += 2*vel[index].y * dt; + pos[index].z += 2*vel[index].z * dt; + } + + } +} + +__global__ +void clothupdate(glm::vec2 clothsize, float dt, glm::vec4 * pos, glm::vec3 * vel, glm::vec3* springs) +{ + int x = (blockIdx.x * blockDim.x) + threadIdx.x; + int y = (blockIdx.y * blockDim.y) + threadIdx.y; + int index = x + (y * clothsize.x); + + glm::vec3 acc(0,0,0); + if((x>>( numObjects, dev_pos, 1.0, glm::vec2(width,height)); + checkCUDAErrorWithLine("Kernel failed3!"); + generateSprings<<>>( numObjects, dev_pos, springs, glm::vec2(width,height)); + checkCUDAErrorWithLine("Kernel failed generating springs!"); + + generateClothVelArray<<>>(numObjects, dev_vel, glm::vec2(width, height)); + checkCUDAErrorWithLine("Kernel failed generating initialVels!"); + +} + +void initCudaFlock(int N) +{ + numObjects=N; + + cudaMalloc((void**)&dev_pos, N*sizeof(glm::vec4)); + checkCUDAErrorWithLine("Kernel failed1!"); + cudaMalloc((void**)&dev_vel, N*sizeof(glm::vec3)); + checkCUDAErrorWithLine("Kernel failed2!"); + + dim3 fullBlocksPerGrid((int)ceil(float(N)/float(blockSize))); + + generateFlockPos<<>>( numObjects, dev_pos); + checkCUDAErrorWithLine("Kernel failed3!"); + + generateFlockVelArray<<>>(numObjects, dev_vel); + checkCUDAErrorWithLine("Kernel failed generating initialVels!"); + +} + void initCuda(int N) { numObjects = N; + dim3 fullBlocksPerGrid((int)ceil(float(N)/float(blockSize))); cudaMalloc((void**)&dev_pos, N*sizeof(glm::vec4)); @@ -217,6 +665,7 @@ void initCuda(int N) checkCUDAErrorWithLine("Kernel failed!"); generateCircularVelArray<<>>(2, numObjects, dev_vel, dev_pos); checkCUDAErrorWithLine("Kernel failed!"); + } void cudaNBodyUpdateWrapper(float dt) @@ -225,17 +674,49 @@ void cudaNBodyUpdateWrapper(float dt) update<<>>(numObjects, dt, dev_pos, dev_vel); checkCUDAErrorWithLine("Kernel failed!"); } +void cudaFlockUpdateWrapper(float dt, glm::vec3 targetPos) +{ + + dim3 fullBlocksPerGrid((int)ceil(float(numObjects)/float(blockSize))); + flockupdate<<>>(numObjects, dt, dev_pos, dev_vel, targetPos); + checkCUDAErrorWithLine("Kernel failed!"); +} -void cudaUpdateVBO(float * vbodptr, int width, int height) +void cudaClothUpdateWrapper(float dt) { - dim3 fullBlocksPerGrid((int)ceil(float(numObjects)/float(blockSize))); - sendToVBO<<>>(numObjects, dev_pos, vbodptr, width, height, scene_scale); - checkCUDAErrorWithLine("Kernel failed!"); + dim3 threadsPerBlock(tilesize,tilesize); + dim3 fullBlocksPerGrid((int)ceil(float(clothSize.x)/float(tilesize)),(int)ceil(float(clothSize.y)/float(tilesize))); + + clothupdate<<>>(clothSize, dt, dev_pos, dev_vel,springs); + checkCUDAErrorWithLine("Kernel failed!"); +} + + +void cudaUpdateVBO(float * vbodptr, int width, int height,glm::vec3 targetPos) +{ + + +#if SIMMODE==FLOCKSIM + dim3 fullBlocksPerGrid((int)ceil(float(numObjects+1)/float(blockSize))); + flockSendToVBO<<>>(numObjects, dev_pos, vbodptr, width, height, scene_scale,targetPos); +#else + dim3 fullBlocksPerGrid((int)ceil(float(numObjects)/float(blockSize))); + sendToVBO<<>>(numObjects, dev_pos, vbodptr, width, height, scene_scale); +#endif + checkCUDAErrorWithLine("Kernel failed Update VBO!"); +} + +void cudaUpdateVelBO(float* velbodptr) +{ + + dim3 fullBlocksPerGrid((int)ceil(float(numObjects)/float(blockSize))); + flockSendToVelBO<<>>(numObjects, dev_vel, velbodptr, scene_scale); + } void cudaUpdatePBO(float4 * pbodptr, int width, int height) { dim3 fullBlocksPerGrid((int)ceil(float(width*height)/float(blockSize))); sendToPBO<<>>(numObjects, dev_pos, pbodptr, width, height, scene_scale); - checkCUDAErrorWithLine("Kernel failed!"); + checkCUDAErrorWithLine("Kernel failed Update PBO!"); } diff --git a/Part1/src/kernel.h b/Part1/src/kernel.h index 1f8b37a..e8d0c5c 100644 --- a/Part1/src/kernel.h +++ b/Part1/src/kernel.h @@ -12,13 +12,46 @@ #include #endif -#define blockSize 128 +#define blockSize 256 +#define tilesize 16 #define checkCUDAErrorWithLine(msg) checkCUDAError(msg, __LINE__) -#define SHARED 0 +//#define SHARED + + +///BELOW ARE COEEFs AND PARAMs FOR CLOTH SIM +#define KStructure 200.55f +#define KShear 1.115f +#define KBend 8.515f +#define SCALEDGRAVITY 9.8f/2.0f +#define WINDX -3.0f +#define WINDY 0.0f + +#define SUBSTEPS 12 +#define STRUCTSPRINGS 4 +#define SHEARSPRINGS 4 +#define BENDSPRINGS 4 +#define SPRINGPERKNOT 12 + + +///BELOW ARE COEFFs AND PARAMs FOR FLOCK SIM +#define RNeighbour 30.0f +#define VELTHRESHOLD 15.0f +#define BOUNDARY 150.0f + +#define KWander 1500.0f +#define KSeparation 950.0f +#define KCohesion 750.0f +#define KAlignment 550.0f +#define KArrival 00.0f void checkCUDAError(const char *msg, int line); void cudaNBodyUpdateWrapper(float dt); +void cudaFlockUpdateWrapper(float dt,glm::vec3 targetPos); +void cudaClothUpdateWrapper(float dt); +void initCudaCloth(int width, int height); void initCuda(int N); +void initCudaFlock(int N); void cudaUpdatePBO(float4 * pbodptr, int width, int height); -void cudaUpdateVBO(float * vbodptr, int width, int height); +void cudaUpdateVBO(float * vbodptr, int width, int height,glm::vec3 targetPos); +void cudaUpdateVelBO(float* velbodptr); #endif diff --git a/Part1/src/main.cpp b/Part1/src/main.cpp index d4c9c5b..3c77da7 100644 --- a/Part1/src/main.cpp +++ b/Part1/src/main.cpp @@ -4,9 +4,25 @@ #include "main.h" -#define N_FOR_VIS 25 -#define DT 0.2 +#if SIMMODE==CLOTHSIM + #define N_FOR_VIS cloth_width*cloth_height +#elif SIMMODE==BASICSIM + #define N_FOR_VIS 12 +#elif SIMMODE==FLOCKSIM + #define N_FOR_VIS 10000 +#endif +#define DT 0.16 #define VISUALIZE 1 + +#define RESETFRAME 200 + +int mousex,mousey; + +int mouseStatus; //0: left hold, 1: mid hold, 2: right hold, -1 nothing + +int totalframes; + +bool paused; //------------------------------- //-------------MAIN-------------- //------------------------------- @@ -20,17 +36,28 @@ int main(int argc, char** argv) cudaGLSetGLDevice( compat_getMaxGflopsDeviceId() ); initPBO(&pbo); cudaGLRegisterBufferObject( planetVBO ); + cudaGLRegisterBufferObject( planetVelBO ); -#if VISUALIZE == 1 - initCuda(N_FOR_VIS); -#else - initCuda(2*128); -#endif - projection = glm::perspective(fovy, float(width)/float(height), zNear, zFar); - view = glm::lookAt(cameraPosition, glm::vec3(0), glm::vec3(0,0,1)); - - projection = projection * view; +#if SIMMODE==CLOTHSIM + initCudaCloth(cloth_width,cloth_height); +#elif SIMMODE==BASICSIM + initCuda(N_FOR_VIS); +#elif SIMMODE==FLOCKSIM + initCudaFlock(N_FOR_VIS); + targetPosition=glm::vec3(0,0,0); +#endif + + paused=false; + srand(time(NULL)); + totalframes=0; + cameraDir=-glm::normalize(cameraPosition); + c_perspective = glm::perspective(fovy, float(width)/float(height), zNear, zFar); + view = glm::lookAt(cameraPosition, cameraDir+cameraPosition, glm::vec3(0,0,1)); + projection = c_perspective * view; + + glm::vec3 right=glm::normalize(glm::cross(cameraDir,glm::vec3(0,0,1))); + realup=glm::normalize(glm::cross(right,cameraDir)); GLuint passthroughProgram; initShaders(program); @@ -39,16 +66,65 @@ int main(int argc, char** argv) glActiveTexture(GL_TEXTURE0); glEnable(GL_DEPTH_TEST); - + glutDisplayFunc(display); glutKeyboardFunc(keyboard); + glutMotionFunc(getmousePos); + glutMouseFunc(mouseAction); + glutMainLoop(); return 0; } +//////////////////////////MOUSE ACTIONS///////////////////// +void getmousePos(int x, int y) +{ + + if(mouseStatus==0) + { + if(y-mousey<-5) cameraPosition+=cameraDir*0.1f; + else if(y-mousey>5)cameraPosition-=cameraDir*0.1f; + } + if(mouseStatus==1) + { + glm::vec3 right=glm::normalize(glm::cross(cameraDir,realup)); + if(x-mousex<-5) cameraPosition-=right*0.1f; + else if(x-mousex>5) cameraPosition+=right*0.1f; + } + + if(mouseStatus==2) + { + glm::vec3 centerpt=cameraPosition+cameraDir*5.0f; + glm::vec3 right=glm::normalize(glm::cross(cameraDir,realup)); + if(x-mousex<-5) cameraPosition-=right*0.15f; + else if(x-mousex>5) cameraPosition+=right*0.15f; + cameraDir=glm::normalize(centerpt-cameraPosition); + cameraPosition=centerpt-5.0f*cameraDir; + } + + mousex=x; + mousey=y; + printf("%d %d\n",x,y); +} +void mouseAction(int button, int dir, int x, int y) +{ + //string statusname[4]={"nothing","left","middle","right"}; +// printf("%d %d\n", button, dir); + if(dir==1) mouseStatus=-1; + else + { + mouseStatus=button; + mousex=x; + mousey=y; + } + //printf("%d\n",mouseStatus); + //printf("%s\n",statusname[mouseStatus+1]); +} + + //------------------------------- //---------RUNTIME STUFF--------- //------------------------------- @@ -60,17 +136,28 @@ void runCuda() float4 *dptr=NULL; float *dptrvert=NULL; + float *dptrvel = NULL; cudaGLMapBufferObject((void**)&dptr, pbo); cudaGLMapBufferObject((void**)&dptrvert, planetVBO); + cudaGLMapBufferObject((void**)&dptrvel, planetVelBO); // execute the kernel - cudaNBodyUpdateWrapper(DT); +#if SIMMODE==CLOTHSIM + cudaClothUpdateWrapper(DT); +#elif SIMMODE==BASICSIM + cudaNBodyUpdateWrapper(DT); +#elif SIMMODE==FLOCKSIM + cudaFlockUpdateWrapper(DT,targetPosition); +#endif #if VISUALIZE == 1 cudaUpdatePBO(dptr, field_width, field_height); - cudaUpdateVBO(dptrvert, field_width, field_height); + cudaUpdateVBO(dptrvert, field_width, field_height,targetPosition); + cudaUpdateVelBO(dptrvel); + //targetPosition=glm::vec3(dptrvert[4*N_FOR_VIS],dptrvert[4*N_FOR_VIS+1],0); #endif // unmap buffer object cudaGLUnmapBufferObject(planetVBO); + cudaGLUnmapBufferObject(planetVelBO); cudaGLUnmapBufferObject(pbo); } @@ -79,8 +166,13 @@ int frame = 0; void display() { + view = glm::lookAt(cameraPosition, cameraPosition+cameraDir, glm::vec3(0,0,1)); + projection = c_perspective * view; + + static float fps = 0; frame++; + totalframes++; int time=glutGet(GLUT_ELAPSED_TIME); if (time - timebase > 1000) { @@ -88,7 +180,18 @@ void display() timebase = time; frame = 0; } - runCuda(); + + GLuint location; + + if(SIMMODE==FLOCKSIM && totalframes%RESETFRAME==0) + { + targetPosition=glm::vec3(rand()%200,rand()%200,0); +// targetPosition*=200.0f*(1/200.0f); + targetPosition-=glm::vec3(100.0f,100.0f,0.0f); + targetPosition*=2.0f; + printf("regenerate target position as (%f,%f,%f)\n",targetPosition.x,targetPosition.y,targetPosition.z); + } +if(!paused) runCuda(); char title[100]; sprintf( title, "565 NBody sim [%0.2f fps]", fps ); @@ -101,43 +204,76 @@ void display() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); #if VISUALIZE == 1 - // VAO, shader program, and texture already bound - //glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - //glDrawElements(GL_TRIANGLES, 6*field_width*field_height, GL_UNSIGNED_INT, 0); + //VAO, shader program, and texture already bound + // glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + //glDrawElements(GL_TRIANGLES, 6*field_width*field_height, GL_UNSIGNED_INT, 0); - glUseProgram(program[HEIGHT_FIELD]); +#if SIMMODE==BASICSIM + glUseProgram(program[HEIGHT_FIELD]); - glEnableVertexAttribArray(positionLocation); - glEnableVertexAttribArray(texcoordsLocation); - - glBindBuffer(GL_ARRAY_BUFFER, planeVBO); - glVertexAttribPointer((GLuint)positionLocation, 2, GL_FLOAT, GL_FALSE, 0, 0); + glEnableVertexAttribArray(positionLocation); + glEnableVertexAttribArray(texcoordsLocation); - glBindBuffer(GL_ARRAY_BUFFER, planeTBO); - glVertexAttribPointer((GLuint)texcoordsLocation, 2, GL_FLOAT, GL_FALSE, 0, 0); + glBindBuffer(GL_ARRAY_BUFFER, planeVBO); + glVertexAttribPointer((GLuint)positionLocation, 2, GL_FLOAT, GL_FALSE, 0, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, planeIBO); + glBindBuffer(GL_ARRAY_BUFFER, planeTBO); + glVertexAttribPointer((GLuint)texcoordsLocation, 2, GL_FLOAT, GL_FALSE, 0, 0); - glDrawElements(GL_TRIANGLES, 6*field_width*field_height, GL_UNSIGNED_INT, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, planeIBO); + if ((location = glGetUniformLocation(program[0], "u_projMatrix")) != -1) + { + glUniformMatrix4fv(location, 1, GL_FALSE, &projection[0][0]); + } - glDisableVertexAttribArray(positionLocation); - glDisableVertexAttribArray(texcoordsLocation); - glUseProgram(program[PASS_THROUGH]); + glDrawElements(GL_TRIANGLES, 6*field_width*field_height, GL_UNSIGNED_INT, 0); - glEnableVertexAttribArray(positionLocation); + glDisableVertexAttribArray(positionLocation); + glDisableVertexAttribArray(texcoordsLocation); +#endif + glUseProgram(program[PASS_THROUGH]); - glBindBuffer(GL_ARRAY_BUFFER, planetVBO); - glVertexAttribPointer((GLuint)positionLocation, 4, GL_FLOAT, GL_FALSE, 0, 0); + glEnableVertexAttribArray(positionLocation); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, planetIBO); - - glPointSize(4.0f); - glDrawElements(GL_POINTS, N_FOR_VIS+1, GL_UNSIGNED_INT, 0); - glPointSize(1.0f); + glBindBuffer(GL_ARRAY_BUFFER, planetVBO); + glVertexAttribPointer((GLuint)positionLocation, 4, GL_FLOAT, GL_FALSE, 0, 0); - glDisableVertexAttribArray(positionLocation); +#if SIMMODE==FLOCKSIM + glEnableVertexAttribArray(velocityLocation); + glBindBuffer(GL_ARRAY_BUFFER, planetVelBO); + glVertexAttribPointer((GLuint)velocityLocation, 4, GL_FLOAT, GL_FALSE, 0, 0); +#endif + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, planetIBO); + + glPointSize(4.0f); + + //GLuint location; + //if ((location = glGetUniformLocation(program[1], "u_targetposition")) != -1) + //{ + // glUniform3fv(location, 1, &targetPosition[0]); + //} + if ((location = glGetUniformLocation(program[1], "u_cameraPos")) != -1) + { + glUniform3fv(location, 1, &cameraPosition[0]); + } + if ((location = glGetUniformLocation(program[1], "u_projMatrix")) != -1) + { + glUniformMatrix4fv(location, 1, GL_FALSE, &projection[0][0]); + } +#if SIMMODE==BASICSIM + glDrawElements(GL_POINTS, N_FOR_VIS+1, GL_UNSIGNED_INT, 0); +#else + glDrawElements(GL_POINTS, N_FOR_VIS, GL_UNSIGNED_INT, 0); +#endif + glPointSize(1.0f); + + glDisableVertexAttribArray(positionLocation); +#if SIMMODE==FLOCKSIM + glDisableVertexAttribArray(velocityLocation); +#endif #endif glutPostRedisplay(); @@ -152,6 +288,9 @@ void keyboard(unsigned char key, int x, int y) case(27): exit(1); break; + case(' '): + paused=!paused; + break; } } @@ -165,6 +304,7 @@ void init(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA); + glutInitWindowSize(width, height); glutCreateWindow("565 NBody sim"); @@ -209,7 +349,7 @@ void initTextures() glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, field_width, field_height, 0, GL_RGBA, GL_FLOAT, NULL); + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA32F, field_width, field_height, 0, GL_RGBA, GL_FLOAT, NULL); } void initVAO(void) @@ -235,8 +375,8 @@ void initVAO(void) { float alpha = float(i) / float(fw_1); float beta = float(j) / float(fh_1); - vertices[(j*field_width + i)*2 ] = alpha*lr.x + (1-alpha)*ul.x; - vertices[(j*field_width + i)*2+1] = beta*lr.y + (1-beta)*ul.y; + vertices[(j*field_width + i)*2 ] = (alpha*lr.x + (1-alpha)*ul.x)*2; + vertices[(j*field_width + i)*2+1] = (beta*lr.y + (1-beta)*ul.y)*2; texcoords[(j*field_width + i)*2 ] = alpha*lr.z + (1-alpha)*ul.z; texcoords[(j*field_width + i)*2+1] = beta*lr.w + (1-beta)*ul.w; } @@ -268,6 +408,7 @@ void initVAO(void) glGenBuffers(1, &planeTBO); glGenBuffers(1, &planeIBO); glGenBuffers(1, &planetVBO); + glGenBuffers(1, &planetVelBO); glGenBuffers(1, &planetIBO); glBindBuffer(GL_ARRAY_BUFFER, planeVBO); @@ -281,6 +422,9 @@ void initVAO(void) glBindBuffer(GL_ARRAY_BUFFER, planetVBO); glBufferData(GL_ARRAY_BUFFER, 4*(N_FOR_VIS+1)*sizeof(GLfloat), bodies, GL_DYNAMIC_DRAW); + + glBindBuffer(GL_ARRAY_BUFFER, planetVelBO); + glBufferData(GL_ARRAY_BUFFER, 4*(N_FOR_VIS+1)*sizeof(GLfloat), bodies, GL_DYNAMIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, planetIBO); glBufferData(GL_ELEMENT_ARRAY_BUFFER, (N_FOR_VIS+1)*sizeof(GLuint), bindices, GL_STATIC_DRAW); @@ -313,8 +457,13 @@ void initShaders(GLuint * program) { glUniform1i(location, 0); } - - program[1] = glslUtility::createProgram("shaders/planetVS.glsl", "shaders/planetGS.glsl", "shaders/planetFS.glsl", attributeLocations, 1); +#if SIMMODE==CLOTHSIM + program[1] = glslUtility::createProgram("shaders/planetVS.glsl", "shaders/planetGS_cloth.glsl", "shaders/planetFS.glsl", attributeLocations, 3); +#elif SIMMODE==BASICSIM + program[1] = glslUtility::createProgram("shaders/planetVS.glsl", "shaders/planetGS_cloth.glsl", "shaders/planetFS.glsl", attributeLocations, 3); +#elif SIMMODE==FLOCKSIM + program[1] = glslUtility::createProgram("shaders/planetVS.glsl", "shaders/planetGS_flock.glsl", "shaders/planetFS.glsl", attributeLocations, 3); +#endif glUseProgram(program[1]); if ((location = glGetUniformLocation(program[1], "u_projMatrix")) != -1) @@ -325,6 +474,10 @@ void initShaders(GLuint * program) { glUniform3fv(location, 1, &cameraPosition[0]); } + if ((location = glGetUniformLocation(program[1], "u_targetposition")) != -1) + { + glUniform3fv(location, 1, &targetPosition[0]); + } } //------------------------------- diff --git a/Part1/src/main.h b/Part1/src/main.h index 2b818bf..638de69 100644 --- a/Part1/src/main.h +++ b/Part1/src/main.h @@ -4,6 +4,7 @@ #include #include + #include #include #include @@ -11,6 +12,7 @@ #include #include #include +#include #include "glslUtility.h" #include "glm/glm.hpp" #include "glm/gtc/matrix_transform.hpp" @@ -35,29 +37,43 @@ using namespace std; GLuint positionLocation = 0; GLuint texcoordsLocation = 1; -const char *attributeLocations[] = { "Position", "Texcoords" }; +GLuint velocityLocation = 2; +const char *attributeLocations[] = { "Position", "Texcoords", "Velocity" }; GLuint pbo = (GLuint)NULL; GLuint planeVBO = (GLuint)NULL; GLuint planeTBO = (GLuint)NULL; GLuint planeIBO = (GLuint)NULL; GLuint planetVBO = (GLuint)NULL; GLuint planetIBO = (GLuint)NULL; + +GLuint planetVelBO = (GLuint)NULL; + GLuint displayImage; GLuint program[2]; const unsigned int HEIGHT_FIELD = 0; const unsigned int PASS_THROUGH = 1; -const int field_width = 800; -const int field_height = 800; +const int field_width = 200; +const int field_height = 200; + +const int cloth_width=200; +const int cloth_height=200; + float fovy = 60.0f; float zNear = 0.10; -float zFar = 5.0; +float zFar = 25.0; +glm::mat4 c_perspective; glm::mat4 projection; glm::mat4 view; +glm::vec3 cameraDir; +glm::vec3 realup; + + glm::vec3 cameraPosition(1.75,1.75,1.35); +glm::vec3 targetPosition(0,0,0); //------------------------------- //----------CUDA STUFF----------- //------------------------------- @@ -87,6 +103,8 @@ void init(int argc, char* argv[]); void initPBO(GLuint* pbo); +void initCudaCloth(); +void initCudaFlock(); void initCuda(); void initTextures(); void initVAO(); @@ -101,4 +119,10 @@ void deletePBO(GLuint* pbo); void deleteTexture(GLuint* tex); void shut_down(int return_code); +//------------------------------ +//-----------MOUSE OPERATION---- +//----------------------------- + +void mouseAction(int button, int dir, int x, int y); +void getmousePos(int x, int y); #endif diff --git a/Part1/src/utilities.h b/Part1/src/utilities.h index 5afa3d9..298d5a2 100644 --- a/Part1/src/utilities.h +++ b/Part1/src/utilities.h @@ -25,6 +25,12 @@ #define EPSILON .000000001 #define ZERO_ABSORPTION_EPSILON 0.00001 +#define BASICSIM 0 +#define CLOTHSIM 1 +#define FLOCKSIM 2 +#define SIMMODE FLOCKSIM + + namespace utilityCore { extern float clamp(float f, float min, float max); extern bool replaceString(std::string& str, const std::string& from, const std::string& to); diff --git a/README.md b/README.md index cbd76c6..941963d 100644 --- a/README.md +++ b/README.md @@ -5,369 +5,143 @@ Fall 2013 Due Sunday, 10/20/2013 by 11:59:59 pm --- ---- -NOTE: ---- -This project requires an NVIDIA graphics card with CUDA capability! Any card -after the Geforce 8xxx series will work. If you do not have an NVIDIA graphics -card in the machine you are working on, feel free to use any machine in the SIG -Lab or in Moore100 labs. All machines in the SIG Lab and Moore100 are equipped -with CUDA capable NVIDIA graphics cards. If this too proves to be a problem, -please contact Patrick or Liam as soon as possible. - ---- -INTRODUCTION: ---- -In this project you will be creating a 3D visualization of an N-Body system -simulated using CUDA and OpenGL shaders. You will also be creating your own -simulation of choice. - -This project is divided into two parts. Part one will consist mostly of a -tutorial style walkthrough of creating the N-Body sim. Part two is an open -ended assignment to create your own simulation. This simulation can be virtually -anything you choose, but will require approval for ideas not listed in this -readme. - -You are also free to do as many extra simulations as you like! - ---- -CONTENTS: ---- -The Project3 root directory contains the following subdirectories: - - * Part1/ - * resources/ the screenshots used in this readme. - * src/ contains the provided code. __NOTE:__ Shader code will be located in the PROJ3_XYZ folders - * PROJ_WIN/ contains a Visual Studio 2010 project file with different configurations - * Debug (v4.0) - * Release (v4.0) - * Debug (v5.5) - * Release (v5.5) - * PROJ_NIX/ contains a Linux makefile for building and running on Ubuntu - 12.04 LTS. Note that you will need to set the following environment - variables (you may set these any way that you like. I added them to my .bashrc): - * PATH=$PATH:/usr/local/cuda-5.5/bin - * LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:/lib - * Part2/ you will fill this with your own simulation code. - -__NOTE:__ Since I do not use Apple products regularly enough to know what I'm doing I did not create a Mac friendly version of the project. I will award a +5 point bounty to the first person to open a pull request containing an OSX compatible version of the starter code. All runners up will receive +100 awesome points. - PART 1: CUDA NBody Simulation === +This is the basic tutorial part. I'd done with this part, as well as the shared memory force calculation. As far as much of the code was modified after finishing this part, the N-Body currently is a pyramid that keeps changing the color. +Anyway, it's there! ---- -REQUIREMENTS: ---- -In this project, you are given code for: - * Initialization - * Rendering to the screen - * Some helpful math functions - * CUDA/OpenGL inter-op - -You will need to implement the following features: - * Calculating forces between all interacting bodies - * The same, but with shared memory - * Vertex shader code to render a height field - * Fragment shader code to light that height field - * Geometry shader code to create screen facing billboards from rendered points - * Fragment shader code to render those billboards like spheres with simple diffuse shading - -You are NOT required to implement any of the following features: - * Prefetching (__NOTE:__ to receive +5 for this feature it must be discussed in your performance section) - * Tessellation shader code to refine the heightfield mesh in regions of interest - * Render the height map as a quad and use parallax occlusion mapping in the fragment shader to simulate the height field - * More interesting rendering of the scene (making some planets light sources would be cool, or perhaps adding orbit trails) - * Textures for the planets and/or unique looking planets - * Replace geometry shader billboarding with adding in simple models (e.g. a pyramid pointing in the direction of velocity) - * Collisions - * Runge Kutta integration (or anything better than the Euler integration provided) - -Since we had some problems going live on time with this project you can give yourself a +5 point boost for including up to two of the above extra features. For example, adding collisions and textured planets along with completing all other required components can get you a 110% score. + +PART 2: Your CUDA Simulation +=== --- -WALKTHROUGH +VIDEO LINK --- -You can choose to complete all of the TODO: tags in the kernel.cu file either before or after sprucing up the graphics, but it will be easier to see some of our improvements if you finish them before. - -For the graphics, you'll see something that looks like this: - -![boring](resources/000.png) - -Pretty underwhelming if I do say so. Lets add some height and coloring in the height field so we can see what the potential field looks like. - -Since the starter code saves a very high resolution force field to texture memory we will use that to perturb the Z components of the height field. In addition we also multiply by the camera matrix to get everything in the right place. Add the following code to your heightVS.glsl file: - -```glsl -uniform mat4 u_projMatrix; -uniform sampler2D u_height; - -attribute vec4 Position; -attribute vec2 Texcoords; - -varying vec2 v_Texcoords; -varying float f_height; - -void main(void) -{ - v_Texcoords = Texcoords; - vec4 pos = Position; - f_height = texture2D(u_height, Texcoords).w; - pos.z = -0.01-clamp(f_height,0.0,2.0); - pos = u_projMatrix * pos; - gl_Position = pos; -} -``` - -You can run the code as is right now, but you'll likely see very little difference in most cases. In order to really get the feel we want, without the added complexity of doing real lighting we'll just darken the fragment color based on the height map. Add the following to your heightFS.glsl file: - -```glsl -varying float f_height; - -void main(void) -{ - float shade = (1.0-2.0*sqrt(f_height)); - vec4 color = vec4(0.05,0.15,0.3,1.0); - gl_FragColor = shade*color; -} -``` - -Now your height field should look closer to this: - -![less boring](resources/001.png) - -Okay, that's a lot better, but now our planets need some attention. For this step we'll be using the geometry shader to create screen facing quads from the points that are currently being rendered. Essentially, what we want is to create a geometry shader that takes in points and emits triangle strips, so replace the version of planetGS.glsl with this: - -```glsl -#version 330 - -uniform mat4 u_projMatrix; -uniform vec3 u_cameraPos; - -layout (points) in; -layout (triangle_strip) out; -layout (max_vertices = 4) out; -out vec3 WorldCoord; -out vec3 ToCam; -out vec3 Up; -out vec3 Right; -out vec2 TexCoord; +basic pyramid version +http://youtu.be/ffbJMcmOPHc -const float scale = 0.03; -``` +enhanced version +http://www.youtube.com/watch?v=EDuQCPeSilE&feature=youtu.be -Before we can produce the vertices for our quad we need to figure out where they go. This code takes the vector from the point to the camera and crosses it with the up vector (usually I conform to convention and use +Y, but here I used +Z and never got around to fixing it) to produce the right vector. Next we cross the right vector and the camera vector to produce a corrected up vector. +Do feel free to watch my demo on the above link. -```glsl -void main() -{ - vec3 Position = gl_in[0].gl_Position.xyz; - WorldCoord = Position; - - ToCam = normalize(u_cameraPos - Position); - Up = vec3(0.0, 0.0, 1.0); - Right = cross(ToCam, Up); - Up = cross(Right, ToCam); -``` - -Now that we have the correct up and right vectors, we can emit our vertices and produce our screen facing quads: - -```glsl - vec3 Pos = Position + scale*Right - scale*Up; - gl_Position = u_projMatrix * vec4(Pos, 1.0); - TexCoord = vec2(0.0, 0.0); - EmitVertex(); - - Pos = Position + scale*Right + scale*Up; - gl_Position = u_projMatrix * vec4(Pos, 1.0); - TexCoord = vec2(0.0, 1.0); - EmitVertex(); - - Pos = Position - scale*Right - scale*Up; - gl_Position = u_projMatrix * vec4(Pos, 1.0); - TexCoord = vec2(1.0, 0.0); - EmitVertex(); - - Pos = Position - scale*Right + scale*Up; - gl_Position = u_projMatrix * vec4(Pos, 1.0); - TexCoord = vec2(1.0, 1.0); - EmitVertex(); - - EndPrimitive(); -} -``` - -![cool](resources/002.png) - -__NOTE:__ You'll notice here that the quads are not aligned to the screen, they merely face it. This is okay for our purposes because we are using them to render spheres. - -With our quads we can do some very fancy things in the fragment shader. Use the following snippets to replace the existing planetFS.glsl file: - -```glsl -#version 330 - -in vec3 WorldCoord; -in vec3 ToCam; -in vec3 Up; -in vec3 Right; -in vec2 TexCoord; -out vec4 FragColor; - -void main() -{ -``` +--- +INTRODUCTION +--- +I had implemented 2 simulations for this project: cloth simulation and flocking behavior simulation. -This section takes the "texture" coordinates produces in the GS and uses them to decide where in the quad this fragment is. We discard any fragments outside of our desired radius in order to simulate the edge of the sphere. +In the cloth simulation, I simulate a cloth which is modeled as a 200*200 mass-spring system. Each knot of the cloth +have 12 springs: 4 structure springs, 4 shear springs and 4 bend springs. Each spring is calculated upon its original length as the value when it is set up. Coeff values for all three kinds of springs can be modified +easily in the kernel.h. I do not implement the collision detection part because of the the time is limited. Instead, I add a wind-force-field in this simulation so that it can wave as the wind blows. -```glsl - vec2 coord = 2.01 * (TexCoord - vec2(0.5)); - float r = length(coord); - if (r >= 1.0) { discard; } -``` +In the flocking behaviors simulation, I used 12,000 agents in the demo video. The flocking behavior have 4 component behaviours: cohesion, which is used to group them together; separation, which guarantee the minimum +distance between the agents; alignment, make sure that the neighbour agents shall go to the same direction; and wander, which add some noise to the individuals. Coeff values are also listed in the kernel.h. -Since I designed this project with the center object being a star I execute an early out here to simply color it white. +On the interaction side, I add the mouse interaction which enable the user to manipulate the camera with zoom in/out, move left/right, rotate left/ right. On the glsl side, I change the code so that it will render as pyramids + for each point, with different colors. + + So all above are generally the work I'd done with. And I'll explain them in detail below. + +--- +HOW TO USE +--- +In the file "utilities.h", I defined SIMMODE, which is FLOCKSIM at submission. Changing it to CLOTHSIM will chage to the cloth simulation. The BASICSIM cannot be used currently, it is for N-Body stuff. But as far as it is just a +tutorial part, I do not even care about it. -```glsl - float dist = length(WorldCoord); - if(dist <= 0.01) - { - FragColor = vec4(1.0); - return; - } -``` +In the file "kernel.h", there are many parameters that can be chanaged. Most of the variables can be understood according to its variable name. By tweaking their value, the result of the simulation could be changed apparently. -This last segment takes care of calculating the fake intersection point and its lighting. I am using a simple diffuse + constant ambient with exponential attenuation. +In the file "main.cpp", the number of the agents in flocking simulation can be changed easily, at the very beginning. Make sure that you change the value in the FLOCKSIM section. -```glsl - vec3 N = Right*-coord.x + Up*coord.y + ToCam*sqrt(1-r*r); - vec3 L = normalize(-WorldCoord); - float light = 0.1 + 0.9*clamp(dot(N,L),0.0, 1.0)*exp(-dist); - vec3 color = vec3(0.4, 0.1, 0.6); - FragColor = vec4(color*light,1.0); -} -``` +In the file "main.h", the cloth_weight and cloth_height will work for the size of the cloth. -![almost there](resources/003.png) +Mouse Operation: +LMB drag: up-> zoom in, down-> zoom out; +MMB drag: left->camera move left, right-> camera move right +RMB drag: left-> camera rotate left, right-> camera rotate right -The last thing we add is a little bit of procedural coloring to give a nice grid effect. Replace the boring color code in heightFS.glsl with this: +The mouse operation is coarse designed, which just fulfilled the use of obeservation, screenshots and making demos. -```glsl -float alpha = float(mod(v_Texcoords.x+0.025, 0.05) > 0.046 || - mod(v_Texcoords.y+0.025, 0.05) > 0.046); -vec4 color = mix(vec4(0.05,0.15,0.3,1.0), vec4(0.05, 0.3, 0.4, 1.0), alpha); -``` +Keyboard: -![awesome](resources/004.png) +Using space button to Pause and Continue. -Now we have a beautiful looking (if simple) gravity sim! +--- +CLOTH SIMULATION +--- +In this simulation, I do not implement the collision detection part. Instead, I add a wind-force-field so that it can wave against the wind. The wind force is pretty much similar to the gravity field, and is much easier to implement. +I would like to try to accomplish the obstacle collision detection after I have some free moments lol. +So in the cloth simulation, I set up the cloth as a 200*200 knots matrix(this number is flexible in the main.h). For each knot, I set up about 12 springs(the knots near to the boundary will have less springs) to +simulate the cloth, which includes 4 structural springs, 4 shear springs and 4 bend springs. Each knot has its mass as 1.0f, so that the cloth is modeled into a large-scale mass-spring system. For each spring, its original length +is the lenght when it is set up. -PART 2: Your CUDA Simulation -=== +The calculation of mass-spring system is pretty straight forward, which just follows the Hook's rule. However, I came across a serious problem that the spring would mistakenly overshoot. -To complete this part of the assignment you must implement your own simulation. This can be anything within reason, but two examples that would be well suited are: +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/spring_exploded_explain.jpg?raw=true) -* Flocking -* Mass spring cloth/jello +So when the spring has a large enough mass to bounce it back ,it may bounce to the other side, and thus messed up the later calculation. -Feel free to code your own unique simulation here, just ask on the Google group if your topic is acceptable and we'll probably say yes. +There is not a good way to solve this problem, which is the disadvantage of the mass-spring system, even with the RK4 integration method. Therefore, I invent my own method to alleviate this problem in some extends. +The idea is simple: shrink the DT to increase the precision of the simulation. However, directly modify the DT will cause the problem that the result video of the simulation is slower than the normal version. To handle this +problem, I just divide one calculation step into several substeps, which where the DT for each step is the original DT/substeps num. In this case, the precision can be enhanced. As far as I'd tested, in the case of 200*200 knots, + supporting as much as 16 substeps can still keep the fps in the real-time animation range(>24 fps). With this method, I can use more stiff springs, and make the calculation more accurate. + + + I'd also attemped to change the PBO so that it can render the cloth as a cloth. However I just failed it, and cannot figure out where is going wrong. Therefore, I just transfer the position of knots into VBO and then rendering it + as separate knots. When the knots are crowded enough, it stlil looks like a cloth, just the normal is a little bit weird. + + Below are the runtime screenshots. +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/cloth.bmp?raw=true) +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/cloth2.bmp?raw=true) ---- -NOTES ON GLM: ---- -This project uses GLM, the GL Math library, for linear algebra. You need to -know two important points on how GLM is used in this project: - -* In this project, indices in GLM vectors (such as vec3, vec4), are accessed - via swizzling. So, instead of v[0], v.x is used, and instead of v[1], v.y is - used, and so on and so forth. -* GLM Matrix operations work fine on NVIDIA Fermi cards and later, but - pre-Fermi cards do not play nice with GLM matrices. As such, in this project, - GLM matrices are replaced with a custom matrix struct, called a cudaMat4, found - in cudaMat4.h. A custom function for multiplying glm::vec4s and cudaMat4s is - provided as multiplyMV() in intersections.h. --- -README +FLOCKING SIMULATION --- -All students must replace the contents of this Readme.md in a clear manner with -the following: +Flocking is a million times easier than the cloth simulation, where the formula is much more obvious, no need to model it, and it really take slight jobs in implementing the code. +So, my flocking behavior consists of 4 sub-behaviors. The cohesion, separation, alignment and wander. The weights for all 4 behaviors are flexible, and which can lead to different animation result. Also, the radius of the neighbourhood, + which is another crucial parameter of the calculation, is also flexible, and it is interesting to see that when the radius is small, it is like everyone is moving randomly in the space. + + I transfer the velocity data into the geometry shader so that it will generate a sharp pyramid that points to the direction where it is moving towards. So if comparing the both video demos, you will find that the second one looks much + better than the first one. -* A brief description of the project and the specific features you implemented. -* At least one screenshot of your project running. -* A 30 second or longer video of your project running. To create the video you - can use http://www.microsoft.com/expression/products/Encoder4_Overview.aspx -* A performance evaluation (described in detail below). +Below are the runtime screenshots +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/flocking1.bmp?raw=true) +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/flocking2.bmp?raw=true) --- -PERFORMANCE EVALUATION +SHARED MEMORY WALKTHROUGH --- -The performance evaluation is where you will investigate how to make your CUDA -programs more efficient using the skills you've learned in class. You must -perform at least one experiment on your code to investigate the positive or -negative effects on performance. +Shared memory is easy to implement. So for each thread x in the block, it will copy the data from the block i and offset x into the shared memory, where i loop on the number of the blocks. After all the thread +finish copying, it fetch all the value from the shared memory and calculate the related force/acceleration/velocity. And after all the threads finish calculation, it will move on to the next loop i. -For this Project, one of these experiments should be a comparison between the -global and shared memory versions of the acceleration calculation function at -varying block sizes. -A good metric to track would be number of frames per second, -or number of objects displayable at 60fps. - -We encourage you to get creative with your tweaks. Consider places in your code -that could be considered bottlenecks and try to improve them. - -Each student should provide no more than a one page summary of their -optimizations along with tables and or graphs to visually explain any -performance differences. --- -THIRD PARTY CODE POLICY +PERFORMANCE EVALUATION --- -* Use of any third-party code must be approved by asking on our Google group. - If it is approved, all students are welcome to use it. Generally, we approve - use of third-party code that is not a core part of the project. For example, - for the ray tracer, we would approve using a third-party library for loading - models, but would not approve copying and pasting a CUDA function for doing - refraction. -* Third-party code must be credited in README.md. -* Using third-party code without its approval, including using another - student's code, is an academic integrity violation, and will result in you - receiving an F for the semester. +As there is nothing good to evaluate for this assignment, I just evaluate the shared memory part for the flocking simulation. ---- -SELF-GRADING ---- -* On the submission date, email your grade, on a scale of 0 to 100, to Liam, - liamboone+cis565@gmail.com, with a one paragraph explanation. Be concise and - realistic. Recall that we reserve 30 points as a sanity check to adjust your - grade. Your actual grade will be (0.7 * your grade) + (0.3 * our grade). We - hope to only use this in extreme cases when your grade does not realistically - reflect your work - it is either too high or too low. In most cases, we plan - to give you the exact grade you suggest. -* For late assignments there will be a 50% penaly per week. -* Projects are not weighted evenly, e.g., Project 0 doesn't count as much as - the path tracer. We will determine the weighting at the end of the semester - based on the size of each project. +Ironically, this shared memory method do not fit the flocking simulation. In flocking simulation, sharedMemory method is even slower than the naive calculation. The reason is that when calculate the value between two agents in the flock, +if their distance is larger than the radius of the neighbourhood, it will not go into the calculation part and then go to the next agent. So some threads may finish calculation earlier and then help calculating the later data. ---- -SUBMISSION ---- -As with the previous project, you should fork this project and work inside of -your fork. Upon completion, commit your finished project back to your fork, and -make a pull request to the master repository. You should include a README.md -file in the root directory detailing the following - -* A brief description of the project and specific features you implemented -* At least one screenshot of your project running. -* A link to a video of your raytracer running. -* Instructions for building and running your project if they differ from the - base code. -* A performance writeup as detailed above. -* A list of all third-party code used. -* This Readme file edited as described above in the README section. +In the shared memory method, we have to align all the threads, which means that even one thread has finished its calculation, generally because its agenets have less neighbours than the others, it would have to wait for the other threads + to finish their work(by __syncthreads()). So the shared memory is slower. + + However, in the N-Body case, it is faster than the naive calculation, where N body method do not check if a planet is too far away or not. Therefore, the threadds are always aligned, and shared memory method is thus faster.\ + + The chart below shows how much faster the naive method is upon the shared method. + +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/performance_eval/flocking_comp_512.bmp?raw=true) + The chart below shows that the blocksize has very slight influence on the fps. + + ![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/performance_eval/flocking_comp_blocknum.bmp?raw=true) + + --- -ACKNOWLEDGEMENTS +THIRD PARTY CODE --- -I adapted the geometry shader code from [this excellent tutorial on the subject](http://ogldev.atspace.co.uk/www/tutorial27/tutorial27.html) +None except for the basecode. Everything else are scratched up, including the mouse interaction + diff --git a/README.md.bak b/README.md.bak new file mode 100644 index 0000000..efd65aa --- /dev/null +++ b/README.md.bak @@ -0,0 +1,147 @@ +CIS565: Project 3: CUDA Simulation and GLSL Visualization +=== +Fall 2013 +--- +Due Sunday, 10/20/2013 by 11:59:59 pm +--- + +PART 1: CUDA NBody Simulation +=== +This is the basic tutorial part. I'd done with this part, as well as the shared memory force calculation. As far as much of the code was modified after finishing this part, the N-Body currently is a pyramid that keeps changing the color. +Anyway, it's there! + + +PART 2: Your CUDA Simulation +=== + +--- +VIDEO LINK +--- + +basic pyramid version +http://youtu.be/ffbJMcmOPHc + +enhanced version +http://www.youtube.com/watch?v=EDuQCPeSilE&feature=youtu.be + +Do feel free to watch my demo on the above link. + +--- +INTRODUCTION +--- +I had implemented 2 simulations for this project: cloth simulation and flocking behavior simulation. + +In the cloth simulation, I simulate a cloth which is modeled as a 200*200 mass-spring system. Each knot of the cloth +have 12 springs: 4 structure springs, 4 shear springs and 4 bend springs. Each spring is calculated upon its original length as the value when it is set up. Coeff values for all three kinds of springs can be modified +easily in the kernel.h. I do not implement the collision detection part because of the the time is limited. Instead, I add a wind-force-field in this simulation so that it can wave as the wind blows. + +In the flocking behaviors simulation, I used 12,000 agents in the demo video. The flocking behavior have 4 component behaviours: cohesion, which is used to group them together; separation, which guarantee the minimum +distance between the agents; alignment, make sure that the neighbour agents shall go to the same direction; and wander, which add some noise to the individuals. Coeff values are also listed in the kernel.h. + +On the interaction side, I add the mouse interaction which enable the user to manipulate the camera with zoom in/out, move left/right, rotate left/ right. On the glsl side, I change the code so that it will render as pyramids + for each point, with different colors. + + So all above are generally the work I'd done with. And I'll explain them in detail below. + +--- +HOW TO USE +--- +In the file "utilities.h", I defined SIMMODE, which is FLOCKSIM at submission. Changing it to CLOTHSIM will chage to the cloth simulation. The BASICSIM cannot be used currently, it is for N-Body stuff. But as far as it is just a +tutorial part, I do not even care about it. + +In the file "kernel.h", there are many parameters that can be chanaged. Most of the variables can be understood according to its variable name. By tweaking their value, the result of the simulation could be changed apparently. + +In the file "main.cpp", the number of the agents in flocking simulation can be changed easily, at the very beginning. Make sure that you change the value in the FLOCKSIM section. + +In the file "main.h", the cloth_weight and cloth_height will work for the size of the cloth. + +Mouse Operation: +LMB drag: up-> zoom in, down-> zoom out; +MMB drag: left->camera move left, right-> camera move right +RMB drag: left-> camera rotate left, right-> camera rotate right + +The mouse operation is coarse designed, which just fulfilled the use of obeservation, screenshots and making demos. + +Keyboard: + +Using space to Pause and Continue. + +--- +CLOTH SIMULATION +--- +In this simulation, I do not implement the collision detection part. Instead, I add a wind-force-field so that it can wave against the wind. The wind force is pretty much similar to the gravity field, and is much easier to implement. +I would like to try to accomplish the obstacle collision detection after I have some free moments lol. + +So in the cloth simulation, I set up the cloth as a 200*200 knots matrix(this number is flexible in the main.h). For each knot, I set up about 12 springs(the knots near to the boundary will have less springs) to +simulate the cloth, which includes 4 structural springs, 4 shear springs and 4 bend springs. Each knot has its mass as 1.0f, so that the cloth is modeled into a large-scale mass-spring system. For each spring, its original length +is the lenght when it is set up. + +The calculation of mass-spring system is pretty straight forward, which just follows the Hook's rule. However, I came across a serious problem that the spring would mistakenly overshoot. + +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/spring_exploded_explain.jpg?raw=true) + +So when the spring has a large enough mass to bounce it back ,it may bounce to the other side, and thus messed up the later calculation. + +There is not a good way to solve this problem, which is the disadvantage of the mass-spring system, even with the RK4 integration method. Therefore, I invent my own method to alleviate this problem in some extends. +The idea is simple: shrink the DT to increase the precision of the simulation. However, directly modify the DT will cause the problem that the result video of the simulation is slower than the normal version. To handle this +problem, I just divide one calculation step into several substeps, which where the DT for each step is the original DT/substeps num. In this case, the precision can be enhanced. As far as I'd tested, in the case of 200*200 knots, + supporting as much as 16 substeps can still keep the fps in the real-time animation range(>24 fps). With this method, I can use more stiff springs, and make the calculation more accurate. + + + I'd also attemped to change the PBO so that it can render the cloth as a cloth. However I just failed it, and cannot figure out where is going wrong. Therefore, I just transfer the position of knots into VBO and then rendering it + as separate knots. When the knots are crowded enough, it stlil looks like a cloth, just the normal is a little bit weird. + + Below are the runtime screenshots. +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/cloth.bmp?raw=true) +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/cloth2.bmp?raw=true) + + +--- +FLOCKING SIMULATION +--- +Flocking is a million times easier than the cloth simulation, where the formula is much more obvious, no need to model it, and it really take slight jobs in implementing the code. +So, my flocking behavior consists of 4 sub-behaviors. The cohesion, separation, alignment and wander. The weights for all 4 behaviors are flexible, and which can lead to different animation result. Also, the radius of the neighbourhood, + which is another crucial parameter of the calculation, is also flexible, and it is interesting to see that when the radius is small, it is like everyone is moving randomly in the space. + + I transfer the velocity data into the geometry shader so that it will generate a sharp pyramid that points to the direction where it is moving towards. So if comparing the both video demos, you will find that the second one looks much + better than the first one. + +Below are the runtime screenshots +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/flocking1.bmp?raw=true) +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/screenshots/flocking2.bmp?raw=true) + +--- +SHARED MEMORY WALKTHROUGH +--- +Shared memory is easy to implement. So for each thread x in the block, it will copy the data from the block i and offset x into the shared memory, where i loop on the number of the blocks. After all the thread +finish copying, it fetch all the value from the shared memory and calculate the related force/acceleration/velocity. And after all the threads finish calculation, it will move on to the next loop i. + + + +--- +PERFORMANCE EVALUATION +--- +As there is nothing good to evaluate for this assignment, I just evaluate the shared memory part for the flocking simulation. + +Ironically, this shared memory method do not fit the flocking simulation. In flocking simulation, sharedMemory method is even slower than the naive calculation. The reason is that when calculate the value between two agents in the flock, +if their distance is larger than the radius of the neighbourhood, it will not go into the calculation part and then go to the next agent. So some threads may finish calculation earlier and then help calculating the later data. + +In the shared memory method, we have to align all the threads, which means that even one thread has finished its calculation, generally because its agenets have less neighbours than the others, it would have to wait for the other threads + to finish their work(by __syncthreads()). So the shared memory is slower. + + However, in the N-Body case, it is faster than the naive calculation, where N body method do not check if a planet is too far away or not. Therefore, the threadds are always aligned, and shared memory method is thus faster.\ + + The chart below shows how much faster the naive method is upon the shared method. + +![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/performance_eval/flocking_comp_512.bmp?raw=true) + + The chart below shows that the blocksize has very slight influence on the fps. + + ![screeshot](https://github.com/heguanyu/Project3-Simulation/blob/master/performance_eval/flocking_comp_blocknum.bmp?raw=true) + + +--- +THIRD PARTY CODE +--- +None except for the basecode. Everything else are scratched up, including the mouse interaction + diff --git a/performance_eval/flocking_comp_512.bmp b/performance_eval/flocking_comp_512.bmp new file mode 100644 index 0000000..a1544db Binary files /dev/null and b/performance_eval/flocking_comp_512.bmp differ diff --git a/performance_eval/flocking_comp_blocknum.bmp b/performance_eval/flocking_comp_blocknum.bmp new file mode 100644 index 0000000..a27f6e5 Binary files /dev/null and b/performance_eval/flocking_comp_blocknum.bmp differ diff --git a/performance_eval/sheet.xlsx b/performance_eval/sheet.xlsx new file mode 100644 index 0000000..0509050 Binary files /dev/null and b/performance_eval/sheet.xlsx differ diff --git a/screenshots/cloth.bmp b/screenshots/cloth.bmp new file mode 100644 index 0000000..f7d979b Binary files /dev/null and b/screenshots/cloth.bmp differ diff --git a/screenshots/cloth2.bmp b/screenshots/cloth2.bmp new file mode 100644 index 0000000..9bdfa79 Binary files /dev/null and b/screenshots/cloth2.bmp differ diff --git a/screenshots/flocking1.bmp b/screenshots/flocking1.bmp new file mode 100644 index 0000000..0b4ee20 Binary files /dev/null and b/screenshots/flocking1.bmp differ diff --git a/screenshots/flocking2.bmp b/screenshots/flocking2.bmp new file mode 100644 index 0000000..9d62ad1 Binary files /dev/null and b/screenshots/flocking2.bmp differ diff --git a/screenshots/spring_exploded_explain.jpg b/screenshots/spring_exploded_explain.jpg new file mode 100644 index 0000000..b4859fd Binary files /dev/null and b/screenshots/spring_exploded_explain.jpg differ