change lcpp Lua preprocessor, to keep #defines and comments, remove empty lines
remove duplicate data in b3Contact4 (now in btContact4Data shared between CPU/C++ and OpenCL) OpenCL kernels use #include "Bullet3Collision/NarrowPhaseCollision/shared/b3Contact4Data.h" Increase number of batches back to 250 (from 50), need to fix this hard coded number (see https://github.com/erwincoumans/bullet3/issues/12) Work towards GJK/EPA, in addition to SAT/clipping (early on)
This commit is contained in:
@@ -2,10 +2,7 @@
|
||||
static const char* createShadowMapInstancingFragmentShader= \
|
||||
"#version 330\n"
|
||||
"precision highp float;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"layout(location = 0) out float fragmentdepth;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" fragmentdepth = gl_FragCoord.z;\n"
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
static const char* createShadowMapInstancingVertexShader= \
|
||||
"#version 330\n"
|
||||
"precision highp float;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"layout (location = 0) in vec4 position;\n"
|
||||
"layout (location = 1) in vec4 instance_position;\n"
|
||||
"layout (location = 2) in vec4 instance_quaternion;\n"
|
||||
@@ -11,11 +9,7 @@ static const char* createShadowMapInstancingVertexShader= \
|
||||
"layout (location = 4) in vec3 vertexnormal;\n"
|
||||
"layout (location = 5) in vec4 instance_color;\n"
|
||||
"layout (location = 6) in vec3 instance_scale;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"uniform mat4 depthMVP;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"vec4 quatMul ( in vec4 q1, in vec4 q2 )\n"
|
||||
"{\n"
|
||||
" vec3 im = q1.w * q2.xyz + q1.xyz * q2.w + cross ( q1.xyz, q2.xyz );\n"
|
||||
@@ -23,7 +17,6 @@ static const char* createShadowMapInstancingVertexShader= \
|
||||
" float re = dot ( dt, vec4 ( -1.0, -1.0, -1.0, 1.0 ) );\n"
|
||||
" return vec4 ( im, re );\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"vec4 quatFromAxisAngle(vec4 axis, in float angle)\n"
|
||||
"{\n"
|
||||
" float cah = cos(angle*0.5);\n"
|
||||
@@ -45,8 +38,6 @@ static const char* createShadowMapInstancingVertexShader= \
|
||||
" vec4 temp = quatMul ( q, p );\n"
|
||||
" return quatMul ( temp, vec4 ( -q.x, -q.y, -q.z, q.w ) );\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" vec4 q = instance_quaternion;\n"
|
||||
@@ -54,5 +45,4 @@ static const char* createShadowMapInstancingVertexShader= \
|
||||
" vec4 vertexPos = depthMVP * vec4( (instance_position+localcoord).xyz,1);\n"
|
||||
" gl_Position = vertexPos;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
;
|
||||
|
||||
@@ -2,26 +2,21 @@
|
||||
static const char* instancingFragmentShader= \
|
||||
"#version 330\n"
|
||||
"precision highp float;\n"
|
||||
"\n"
|
||||
"in Fragment\n"
|
||||
"{\n"
|
||||
" vec4 color;\n"
|
||||
"} fragment;\n"
|
||||
"\n"
|
||||
"in Vert\n"
|
||||
"{\n"
|
||||
" vec2 texcoord;\n"
|
||||
"} vert;\n"
|
||||
"\n"
|
||||
"uniform sampler2D Diffuse;\n"
|
||||
"in vec3 lightDir,normal,ambient;\n"
|
||||
"out vec4 color;\n"
|
||||
"\n"
|
||||
"void main_textured(void)\n"
|
||||
"{\n"
|
||||
" color = vec4(0.1,0.2,0.3,0.3);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);//fragment.color;\n"
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
static const char* instancingVertexShader= \
|
||||
"#version 330\n"
|
||||
"precision highp float;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"layout (location = 0) in vec4 position;\n"
|
||||
"layout (location = 1) in vec4 instance_position;\n"
|
||||
"layout (location = 2) in vec4 instance_quaternion;\n"
|
||||
@@ -11,22 +9,16 @@ static const char* instancingVertexShader= \
|
||||
"layout (location = 4) in vec3 vertexnormal;\n"
|
||||
"layout (location = 5) in vec4 instance_color;\n"
|
||||
"layout (location = 6) in vec3 instance_scale;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"uniform mat4 ModelViewMatrix;\n"
|
||||
"uniform mat4 ProjectionMatrix;\n"
|
||||
"\n"
|
||||
"out Fragment\n"
|
||||
"{\n"
|
||||
" vec4 color;\n"
|
||||
"} fragment;\n"
|
||||
"\n"
|
||||
"out Vert\n"
|
||||
"{\n"
|
||||
" vec2 texcoord;\n"
|
||||
"} vert;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"vec4 quatMul ( in vec4 q1, in vec4 q2 )\n"
|
||||
"{\n"
|
||||
" vec3 im = q1.w * q2.xyz + q1.xyz * q2.w + cross ( q1.xyz, q2.xyz );\n"
|
||||
@@ -34,7 +26,6 @@ static const char* instancingVertexShader= \
|
||||
" float re = dot ( dt, vec4 ( -1.0, -1.0, -1.0, 1.0 ) );\n"
|
||||
" return vec4 ( im, re );\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"vec4 quatFromAxisAngle(vec4 axis, in float angle)\n"
|
||||
"{\n"
|
||||
" float cah = cos(angle*0.5);\n"
|
||||
@@ -56,9 +47,7 @@ static const char* instancingVertexShader= \
|
||||
" vec4 temp = quatMul ( q, p );\n"
|
||||
" return quatMul ( temp, vec4 ( -q.x, -q.y, -q.z, q.w ) );\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"out vec3 lightDir,normal,ambient;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" vec4 q = instance_quaternion;\n"
|
||||
@@ -68,18 +57,15 @@ static const char* instancingVertexShader= \
|
||||
" vec4 local_normal = (quatRotate3( vertexnormal,q));\n"
|
||||
" vec3 light_pos = vec3(-0.3,0.1,0.1);\n"
|
||||
" normal = local_normal.xyz;//normalize(ModelViewMatrix * local_normal).xyz;\n"
|
||||
"\n"
|
||||
" lightDir = normalize(light_pos);//gl_LightSource[0].position.xyz));\n"
|
||||
"// lightDir = normalize(vec3(gl_LightSource[0].position));\n"
|
||||
" \n"
|
||||
" vec4 axis = vec4(1,1,1,0);\n"
|
||||
" vec4 localcoord = quatRotate3( position.xyz*instance_scale,q);\n"
|
||||
" vec4 vertexPos = ProjectionMatrix * ModelViewMatrix *(instance_position+localcoord);\n"
|
||||
"\n"
|
||||
" gl_Position = vertexPos;\n"
|
||||
" \n"
|
||||
" fragment.color = instance_color;\n"
|
||||
" vert.texcoord = uvcoords;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
;
|
||||
|
||||
@@ -2,22 +2,16 @@
|
||||
static const char* pointSpriteFragmentShader= \
|
||||
"#version 330\n"
|
||||
"precision highp float;\n"
|
||||
"\n"
|
||||
"in Fragment\n"
|
||||
"{\n"
|
||||
" vec4 color;\n"
|
||||
"} fragment;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"in vec3 ambient;\n"
|
||||
"\n"
|
||||
"out vec4 color;\n"
|
||||
"\n"
|
||||
"void main_textured(void)\n"
|
||||
"{\n"
|
||||
" color = fragment.color;//texture2D(Diffuse,vert.texcoord);//fragment.color;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" vec3 N;\n"
|
||||
|
||||
@@ -2,34 +2,23 @@
|
||||
static const char* pointSpriteVertexShader= \
|
||||
"#version 330\n"
|
||||
"precision highp float;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"layout (location = 0) in vec4 position;\n"
|
||||
"layout (location = 1) in vec4 instance_position;\n"
|
||||
"layout (location = 3) in vec2 uvcoords;\n"
|
||||
"layout (location = 4) in vec3 vertexnormal;\n"
|
||||
"layout (location = 5) in vec4 instance_color;\n"
|
||||
"layout (location = 6) in vec3 instance_scale;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"uniform float screenWidth = 700.f;\n"
|
||||
"uniform mat4 ModelViewMatrix;\n"
|
||||
"uniform mat4 ProjectionMatrix;\n"
|
||||
"\n"
|
||||
"out Fragment\n"
|
||||
"{\n"
|
||||
" vec4 color;\n"
|
||||
"} fragment;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"//\n"
|
||||
"// vector rotation via quaternion\n"
|
||||
"//\n"
|
||||
"\n"
|
||||
"out vec3 ambient;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" ambient = vec3(0.3,.3,0.3);\n"
|
||||
@@ -41,7 +30,6 @@ static const char* pointSpriteVertexShader= \
|
||||
" float dist = length(posEye);\n"
|
||||
" float pointRadius = 1.f;\n"
|
||||
" gl_PointSize = instance_scale.x * pointRadius * (screenWidth / dist);\n"
|
||||
"\n"
|
||||
" gl_Position = vertexPos;\n"
|
||||
" \n"
|
||||
" fragment.color = instance_color;\n"
|
||||
|
||||
@@ -2,27 +2,19 @@
|
||||
static const char* useShadowMapInstancingFragmentShader= \
|
||||
"#version 330 core\n"
|
||||
"//precision highp float;\n"
|
||||
"\n"
|
||||
"in Fragment\n"
|
||||
"{\n"
|
||||
" vec4 color;\n"
|
||||
"} fragment;\n"
|
||||
"\n"
|
||||
"in Vert\n"
|
||||
"{\n"
|
||||
" vec2 texcoord;\n"
|
||||
"} vert;\n"
|
||||
"\n"
|
||||
"uniform sampler2D Diffuse;\n"
|
||||
"uniform sampler2DShadow shadowMap;\n"
|
||||
"\n"
|
||||
"in vec3 lightDir,normal,ambient;\n"
|
||||
"in vec4 ShadowCoord;\n"
|
||||
"\n"
|
||||
"out vec4 color;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);//fragment.color;\n"
|
||||
@@ -41,8 +33,6 @@ static const char* useShadowMapInstancingFragmentShader= \
|
||||
" \n"
|
||||
" float bias = 0.005*tan(acos(intensity));\n"
|
||||
" bias = clamp(bias, 0,0.01);\n"
|
||||
"\n"
|
||||
"\n"
|
||||
" float visibility = texture(shadowMap, vec3(ShadowCoord.xy,(ShadowCoord.z-bias)/ShadowCoord.w));\n"
|
||||
" \n"
|
||||
" intensity*=2;\n"
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
static const char* useShadowMapInstancingVertexShader= \
|
||||
"#version 330 \n"
|
||||
"precision highp float;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"layout (location = 0) in vec4 position;\n"
|
||||
"layout (location = 1) in vec4 instance_position;\n"
|
||||
"layout (location = 2) in vec4 instance_quaternion;\n"
|
||||
@@ -11,26 +9,19 @@ static const char* useShadowMapInstancingVertexShader= \
|
||||
"layout (location = 4) in vec3 vertexnormal;\n"
|
||||
"layout (location = 5) in vec4 instance_color;\n"
|
||||
"layout (location = 6) in vec3 instance_scale;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"uniform mat4 ModelViewMatrix;\n"
|
||||
"uniform mat4 ProjectionMatrix;\n"
|
||||
"uniform mat4 DepthBiasModelViewProjectionMatrix;\n"
|
||||
"uniform mat4 MVP;\n"
|
||||
"\n"
|
||||
"out vec4 ShadowCoord;\n"
|
||||
"\n"
|
||||
"out Fragment\n"
|
||||
"{\n"
|
||||
" vec4 color;\n"
|
||||
"} fragment;\n"
|
||||
"\n"
|
||||
"out Vert\n"
|
||||
"{\n"
|
||||
" vec2 texcoord;\n"
|
||||
"} vert;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"vec4 quatMul ( in vec4 q1, in vec4 q2 )\n"
|
||||
"{\n"
|
||||
" vec3 im = q1.w * q2.xyz + q1.xyz * q2.w + cross ( q1.xyz, q2.xyz );\n"
|
||||
@@ -38,7 +29,6 @@ static const char* useShadowMapInstancingVertexShader= \
|
||||
" float re = dot ( dt, vec4 ( -1.0, -1.0, -1.0, 1.0 ) );\n"
|
||||
" return vec4 ( im, re );\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"vec4 quatFromAxisAngle(vec4 axis, in float angle)\n"
|
||||
"{\n"
|
||||
" float cah = cos(angle*0.5);\n"
|
||||
@@ -60,9 +50,7 @@ static const char* useShadowMapInstancingVertexShader= \
|
||||
" vec4 temp = quatMul ( q, p );\n"
|
||||
" return quatMul ( temp, vec4 ( -q.x, -q.y, -q.z, q.w ) );\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"out vec3 lightDir,normal,ambient;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" vec4 q = instance_quaternion;\n"
|
||||
@@ -72,18 +60,14 @@ static const char* useShadowMapInstancingVertexShader= \
|
||||
" vec4 worldNormal = (quatRotate3( vertexnormal,q));\n"
|
||||
" vec3 light_pos = vec3(-5.f,100,-40);\n"
|
||||
" normal = normalize(worldNormal).xyz;\n"
|
||||
"\n"
|
||||
" lightDir = normalize(light_pos);//gl_LightSource[0].position.xyz));\n"
|
||||
" \n"
|
||||
" vec4 axis = vec4(1,1,1,0);\n"
|
||||
" vec4 localcoord = quatRotate3( position.xyz*instance_scale,q);\n"
|
||||
" vec4 vertexPos = MVP* vec4((instance_position+localcoord).xyz,1);\n"
|
||||
"\n"
|
||||
" gl_Position = vertexPos;\n"
|
||||
" ShadowCoord = DepthBiasModelViewProjectionMatrix * vec4((instance_position+localcoord).xyz,1);\n"
|
||||
"\n"
|
||||
" fragment.color = instance_color;\n"
|
||||
" vert.texcoord = uvcoords;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user