Commit 6039dba4 authored by amandaghassaei's avatar amandaghassaei
Browse files

small changes

parent 7991dddb
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
vec3 nominalDist = neighborOriginalPosition-originalPosition; vec3 nominalDist = neighborOriginalPosition-originalPosition;
vec3 deltaP = neighborLastPosition-lastPosition+nominalDist; vec3 deltaP = neighborLastPosition-lastPosition+nominalDist;
deltaP -= normalize(deltaP)*length(nominalDist); deltaP -= normalize(deltaP)*beamMeta[2];
vec3 deltaV = neighborLastVelocity-lastVelocity; vec3 deltaV = neighborLastVelocity-lastVelocity;
vec3 _force = deltaP*beamMeta[0] + deltaV*beamMeta[1]; vec3 _force = deltaP*beamMeta[0] + deltaV*beamMeta[1];
......
...@@ -9,7 +9,10 @@ function initGPUMath(){ ...@@ -9,7 +9,10 @@ function initGPUMath(){
var canvas = document.getElementById("gpuMathCanvas"); var canvas = document.getElementById("gpuMathCanvas");
var gl = canvas.getContext("webgl", {antialias:false}) || canvas.getContext("experimental-webgl", {antialias:false}); var gl = canvas.getContext("webgl", {antialias:false}) || canvas.getContext("experimental-webgl", {antialias:false});
gl.getExtension('OES_texture_float'); var floatTextures = gl.getExtension('OES_texture_float');
if (!floatTextures) {
console.warn('no floating point texture support');
}
gl.disable(gl.DEPTH_TEST); gl.disable(gl.DEPTH_TEST);
var maxTexturesInFragmentShader = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); var maxTexturesInFragmentShader = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
......
...@@ -285,7 +285,7 @@ function initDynamicModel(globals){ ...@@ -285,7 +285,7 @@ function initDynamicModel(globals){
lastVelocity = new Float32Array(textureDim*textureDim*4); lastVelocity = new Float32Array(textureDim*textureDim*4);
externalForces = new Float32Array(textureDim*textureDim*4); externalForces = new Float32Array(textureDim*textureDim*4);
mass = new Float32Array(textureDim*textureDim*4); mass = new Float32Array(textureDim*textureDim*4);
meta = new Float32Array(textureDim*textureDim*4);//todo uint16 meta = new Float32Array(textureDim*textureDim*4);
beamMeta = new Float32Array(textureDimEdges*textureDimEdges*4); beamMeta = new Float32Array(textureDimEdges*textureDimEdges*4);
for (var i=0;i<textureDim*textureDim;i++){ for (var i=0;i<textureDim*textureDim;i++){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment