Fix uninitialized variable jointDamping/jointFriction in SDF importer Add SDF <pose> parsing in visual, inertial, collision elements. Slight improvement in TinyRender loading performance of largish meshes (30k vertices) Reduce #define MAX_SDF_BODIES to 500, due to some issue in client code, todo: figure out what the issue is. b3RobotSimAPI support SDF file loading Tiny improvement in OpenGL hardware renderer lighting, to distinguish faces without textures
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
//this file is autogenerated using stringify.bat (premake --stringify) in the build folder of this project
|
|
static const char* useShadowMapInstancingFragmentShader= \
|
|
"#version 330 core\n"
|
|
"//precision highp float;\n"
|
|
"in Fragment\n"
|
|
"{\n"
|
|
" vec4 color;\n"
|
|
"} fragment;\n"
|
|
"in Vert\n"
|
|
"{\n"
|
|
" vec2 texcoord;\n"
|
|
"} vert;\n"
|
|
"uniform sampler2D Diffuse;\n"
|
|
"uniform sampler2DShadow shadowMap;\n"
|
|
"in vec3 lightDir,normal,ambient;\n"
|
|
"in vec4 ShadowCoord;\n"
|
|
"out vec4 color;\n"
|
|
"void main(void)\n"
|
|
"{\n"
|
|
" vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);\n"
|
|
" vec3 ct,cf;\n"
|
|
" float intensity,at,af;\n"
|
|
" \n"
|
|
" intensity = 0.5+0.5*clamp( dot( normalize(normal),lightDir ), -1,1 );\n"
|
|
" \n"
|
|
" af = 1.0;\n"
|
|
" \n"
|
|
" ct = texel.rgb;\n"
|
|
" at = texel.a;\n"
|
|
" \n"
|
|
" //float bias = 0.005f;\n"
|
|
" \n"
|
|
" float bias = 0.0001*tan(acos(intensity));\n"
|
|
" bias = clamp(bias, 0,0.01);\n"
|
|
" float visibility = texture(shadowMap, vec3(ShadowCoord.xy,(ShadowCoord.z-bias)/ShadowCoord.w));\n"
|
|
" \n"
|
|
" intensity = 0.7*intensity + 0.3*intensity*visibility;\n"
|
|
" \n"
|
|
" cf = intensity*(vec3(1.0,1.0,1.0)-ambient)+ambient;\n"
|
|
" \n"
|
|
" color = vec4(ct * cf, fragment.color.w);\n"
|
|
"}\n"
|
|
;
|