bullet3/examples/OpenGLWindow/Shaders/instancingPS.glsl
erwin coumans 4a705d1e03 Add kiva_shelf to prepare for picking/grasping task
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
2016-07-14 00:05:57 -07:00

38 lines
606 B
GLSL

#version 330
precision highp float;
in Fragment
{
vec4 color;
} fragment;
in Vert
{
vec2 texcoord;
} vert;
uniform sampler2D Diffuse;
in vec3 lightDir,normal,ambient;
out vec4 color;
void main_textured(void)
{
color = vec4(0.1,0.2,0.3,0.3);
}
void main(void)
{
vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);//fragment.color;
vec3 ct,cf;
float intensity,at,af;
intensity = 0.5+0.5*clamp( dot( normalize(normal),lightDir ), -1,1 );
cf = intensity*(vec3(1.0,1.0,1.0)-ambient)+ambient;
af = 1.0;
ct = texel.rgb;
at = texel.a;
color = vec4(ct * cf, at * af);
}