Skip to content

Commit

Permalink
Regenerated sample models from COLLADA2GLTF updates (KhronosGroup#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Taglang authored and lexaknyazev committed Jun 22, 2017
1 parent feaba73 commit 3a23e28
Show file tree
Hide file tree
Showing 176 changed files with 24,016 additions and 16,432 deletions.
Binary file modified 2.0/2CylinderEngine/glTF-Binary/2CylinderEngine.glb
Binary file not shown.
454 changes: 239 additions & 215 deletions 2.0/2CylinderEngine/glTF-Embedded/2CylinderEngine.gltf

Large diffs are not rendered by default.

227 changes: 104 additions & 123 deletions 2.0/2CylinderEngine/glTF-MaterialsCommon/2CylinderEngine.gltf

Large diffs are not rendered by default.

Binary file modified 2.0/2CylinderEngine/glTF-MaterialsCommon/2CylinderEngine0.bin
Binary file not shown.
1,001 changes: 783 additions & 218 deletions 2.0/2CylinderEngine/glTF-pbrSpecularGlossiness/2CylinderEngine.gltf

Large diffs are not rendered by default.

Binary file not shown.
233 changes: 111 additions & 122 deletions 2.0/2CylinderEngine/glTF-techniqueWebGL/2CylinderEngine.gltf

Large diffs are not rendered by default.

Binary file modified 2.0/2CylinderEngine/glTF-techniqueWebGL/2CylinderEngine0.bin
Binary file not shown.
6 changes: 3 additions & 3 deletions 2.0/2CylinderEngine/glTF-techniqueWebGL/2CylinderEngine0.vert
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ precision highp float;
uniform mat4 u_modelViewMatrix;
uniform mat4 u_projectionMatrix;
uniform mat3 u_normalMatrix;
uniform mat4 u_light0Transform;
uniform mat4 u_light1Transform;
uniform mat4 u_light2Transform;
attribute vec3 a_position;
varying vec3 v_position;
attribute vec3 a_normal;
varying vec3 v_normal;
varying vec3 v_light0Direction;
varying vec3 v_light1Direction;
varying vec3 v_light2Direction;
void main(void) {
vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);
v_position = pos.xyz;
gl_Position = u_projectionMatrix * pos;
v_normal = u_normalMatrix * a_normal;
v_light0Direction = mat3(u_light0Transform) * vec3(0., 0., 1.);
v_light1Direction = mat3(u_light1Transform) * vec3(0., 0., 1.);
v_light2Direction = mat3(u_light2Transform) * vec3(0., 0., 1.);
}
19 changes: 8 additions & 11 deletions 2.0/2CylinderEngine/glTF-techniqueWebGL/2CylinderEngine1.frag
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ uniform float u_shininess;
uniform float u_transparency;
uniform vec3 u_light0Color;
uniform vec3 u_light1Color;
uniform vec3 u_light2Color;
varying vec3 v_position;
varying vec3 v_normal;
varying vec3 v_light0Direction;
varying vec3 v_light1Direction;
varying vec3 v_light2Direction;
void main(void) {
vec3 normal = normalize(v_normal);
vec4 diffuse = u_diffuse;
Expand All @@ -23,24 +22,22 @@ void main(void) {
vec3 viewDir = -normalize(v_position);
vec3 ambientLight = vec3(0.0, 0.0, 0.0);
{
ambientLight += u_light0Color;
}
{
vec3 l = normalize(v_light1Direction);
vec3 l = normalize(v_light0Direction);
float attenuation = 1.0;
diffuseLight += u_light1Color * max(dot(normal, l), 0.) * attenuation;
diffuseLight += u_light0Color * max(dot(normal, l), 0.) * attenuation;
vec3 reflectDir = reflect(-l, normal);
float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;
specularLight += u_light1Color * specularIntensity;
specularLight += u_light0Color * specularIntensity;
}
{
vec3 l = normalize(v_light2Direction);
vec3 l = normalize(v_light1Direction);
float attenuation = 1.0;
diffuseLight += u_light2Color * max(dot(normal, l), 0.) * attenuation;
diffuseLight += u_light1Color * max(dot(normal, l), 0.) * attenuation;
vec3 reflectDir = reflect(-l, normal);
float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;
specularLight += u_light2Color * specularIntensity;
specularLight += u_light1Color * specularIntensity;
}
ambientLight += vec3(0.2, 0.2, 0.2);
vec3 color = vec3(0.0, 0.0, 0.0);
color += diffuse.rgb * diffuseLight;
color += specular * specularLight;
Expand Down
Loading

0 comments on commit 3a23e28

Please sign in to comment.