mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
update bullet so it actually works
Moved the addSourceDirectory for physics/Bullet into the Engine/Source/CMakeLists.txt file that way it can actually appear where we expect it to in the solution explorer.
This commit is contained in:
parent
c7be48130a
commit
13fa178cf6
5986 changed files with 1811270 additions and 453803 deletions
|
|
@ -13,9 +13,15 @@ in Vert
|
|||
|
||||
uniform sampler2D Diffuse;
|
||||
uniform sampler2DShadow shadowMap;
|
||||
uniform mat4 ViewMatrixInverse;
|
||||
|
||||
in vec3 lightDir,normal,ambient;
|
||||
in vec3 lightPos,cameraPosition, normal,ambient;
|
||||
in vec4 ShadowCoord;
|
||||
in vec4 vertexPos;
|
||||
in float materialShininess;
|
||||
in float shadowmapIntensity;
|
||||
in vec3 lightSpecularIntensity;
|
||||
in vec3 materialSpecularColor;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
|
|
@ -23,11 +29,16 @@ out vec4 color;
|
|||
|
||||
void main(void)
|
||||
{
|
||||
vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);
|
||||
vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);
|
||||
vec3 ct,cf;
|
||||
float intensity,at,af;
|
||||
if (fragment.color.w==0)
|
||||
discard;
|
||||
vec3 lightDir = normalize(lightPos);
|
||||
|
||||
intensity = 0.5+0.5*clamp( dot( normalize(normal),lightDir ), -1,1 );
|
||||
vec3 normalDir = normalize(normal);
|
||||
|
||||
intensity = 0.5+0.5*clamp( dot( normalDir,lightDir ), -1,1 );
|
||||
|
||||
af = 1.0;
|
||||
|
||||
|
|
@ -36,13 +47,31 @@ void main(void)
|
|||
|
||||
//float bias = 0.005f;
|
||||
|
||||
vec3 specularReflection;
|
||||
|
||||
if (dot(normalDir, lightDir) < 0.0)
|
||||
{
|
||||
specularReflection = vec3(0.0, 0.0, 0.0);
|
||||
}
|
||||
else // light source on the right side
|
||||
{
|
||||
vec3 surfaceToLight = normalize(lightPos - vertexPos.xyz);
|
||||
vec3 surfaceToCamera = normalize(cameraPosition - vertexPos.xyz);
|
||||
|
||||
|
||||
float specularCoefficient = 0.0;
|
||||
specularCoefficient = pow(max(0.0, dot(surfaceToCamera, reflect(-surfaceToLight, normalDir))), materialShininess);
|
||||
specularReflection = specularCoefficient * materialSpecularColor * lightSpecularIntensity;
|
||||
|
||||
}
|
||||
|
||||
|
||||
float visibility = texture(shadowMap, vec3(ShadowCoord.xy,(ShadowCoord.z)/ShadowCoord.w));
|
||||
if (intensity<0.5)
|
||||
visibility = 0;
|
||||
|
||||
intensity = (1.0-shadowmapIntensity)*intensity + shadowmapIntensity*intensity*visibility;
|
||||
|
||||
intensity = 0.7*intensity + 0.3*intensity*visibility;
|
||||
|
||||
cf = intensity*(vec3(1.0,1.0,1.0)-ambient)+ambient;
|
||||
|
||||
cf = intensity*(vec3(1.0,1.0,1.0)-ambient)+ambient+specularReflection*visibility;
|
||||
color = vec4(ct * cf, fragment.color.w);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue