This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{titling} | |
\newcommand{\subtitle}[1]{% | |
\posttitle{% | |
\par\end{center} | |
\begin{center}\Large#1\end{center} | |
\vskip0.5em}% | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
varying vec3 u_normal; | |
void main() | |
{ | |
//Calculate face normal | |
vec3 N = normalize(cross(dFdx(u_normal), dFdy(u_normal)));//Face Normal | |
//This sets the Light source to be the camera | |
vec3 L = normalize(vec3(0,0,0)-u_normal); | |
vec3 diffuse = gl_Color.xyz * max(dot(L, N), 0.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1. Create a shader program with the below frag and vertex shaders | |
//2. Call the below method passing "_projectionMat" as the uniformName (and the shaderPrograms ID) | |
//3. glGetUniformLocation() correctly identifies the location as 2 | |
//4. glGetActiveUniform() incorrectly identifies the type as GL_SAMPLER_CUBE, instead of GL_FLOAT_MAT4 | |
//5. Removing the explicit uniform locations from the vertex shader fixes this, therefore is layout(location for a uniform undefined behaviour, or is this a bug? | |
std::pair<int, GLenum> findUniform(const char *uniformName, int shaderProgram) | |
{ | |
int result = GL_CALL(glGetUniformLocation(shaderProgram, uniformName)); | |
if (result > -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef _DEBUG //VS standard debug flag | |
inline static void HandleGLError(const char *file, int line) { | |
GLuint error = glGetError(); | |
if (error != GL_NO_ERROR) | |
{ | |
printf("%s(%i) GL Error Occurred;\n%s\n", file, line, gluErrorString(error)); | |
#if EXIT_ON_ERROR | |
getchar(); | |
exit(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Camera.h" | |
#include <glm/gtx/rotate_vector.hpp> | |
/* | |
Initialises the camera located at (1,1,1) directed at (0,0,0) | |
*/ | |
Camera::Camera() | |
: Camera(glm::vec3(1, 1, 1)) | |
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 430 | |
//gl_InstanceID //attribute in uint agent_index; | |
in vec3 _vertex; | |
out vec3 u_normal; | |
uniform mat4 _modelViewMat; | |
uniform mat4 _projectionMat; | |
uniform samplerBuffer _texBuf; //Position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rd build /s /q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __header_cuh_ | |
#define __header_cuh_ | |
#include <stdio.h> | |
#include <cuda.h> | |
#include <cuda_runtime.h> | |
#include <device_launch_parameters.h> | |
//Cuda call | |
inline void HandleCUDAError(const char *file, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cuda.h> | |
#include <cuda_runtime.h> | |
#include <device_launch_parameters.h> | |
//#include <cuda_gl_interop.h> | |
#include "FLAMEGPU.h" | |
#include <cstdio> | |
#include "header.h" | |
//#include "visualisation/GlobalsController.h" | |
#include "navigationhost.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ | |
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},sl |
OlderNewer