.
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
newmtl cubemtl
|
||||
Ns 10
|
||||
Ni 1.0
|
||||
d 1.0
|
||||
Tf 1 1 1
|
||||
illum 2
|
||||
Ka 0.5 0.5 0.
|
||||
Kd 0.9 0.9 0.9
|
||||
Ks 0.0 0.0 0.0
|
||||
map_Kd cube.png
|
@ -0,0 +1,34 @@
|
||||
mtllib cube.mtl
|
||||
|
||||
usemtl cubemtl
|
||||
|
||||
v -0.5 -0.5 -0.5
|
||||
v -0.5 -0.5 0.5
|
||||
v -0.5 0.5 -0.5
|
||||
v -0.5 0.5 0.5
|
||||
v 0.5 -0.5 -0.5
|
||||
v 0.5 -0.5 0.5
|
||||
v 0.5 0.5 -0.5
|
||||
v 0.5 0.5 0.5
|
||||
|
||||
vt 0.0 0.0
|
||||
vt 0.0 1.0
|
||||
vt 1.0 0.0
|
||||
vt 1.0 1.0
|
||||
|
||||
vn 1.0 0.0 0.0
|
||||
vn 0.0 1.0 0.0
|
||||
vn 0.0 0.0 1.0
|
||||
vn -1.0 0.0 0.0
|
||||
vn 0.0 -1.0 0.0
|
||||
vn 0.0 0.0 -1.0
|
||||
|
||||
f 1/1/4 2/3/4 4/4/4 3/2/4
|
||||
f 2/1/3 6/3/3 8/4/3 4/2/3
|
||||
f 6/1/1 5/3/1 7/4/1 8/2/1
|
||||
f 5/1/6 1/3/6 3/4/6 7/2/6
|
||||
f 4/1/2 8/3/2 7/4/2 3/2/2
|
||||
f 2/1/5 1/3/5 5/4/5 6/2/5
|
||||
|
||||
usemtl fuckyou
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 149 KiB |
@ -0,0 +1,22 @@
|
||||
varying vec3 fNormal;
|
||||
varying vec4 fFrontColor;
|
||||
|
||||
vec3 ambientLight = vec3(0.2,0.2,0.2);
|
||||
vec3 directionnalLight = normalize(vec3(10,5,7));
|
||||
vec3 directionnalLightFactor = vec3(0.5,0.5,0.5);
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
|
||||
vec3 ambientFactor = ambientLight;
|
||||
vec3 lambertFactor = max(vec3(0.0,0.0,0.0), dot(directionnalLight, fNormal) * directionnalLightFactor);
|
||||
vec4 noTexColor = vec4(ambientFactor + lambertFactor, 1.0);
|
||||
|
||||
vec4 color = texture2D(tex, gl_TexCoord[0].st);
|
||||
|
||||
vec4 fragColor = noTexColor * color;
|
||||
gl_FragColor = fragColor * fFrontColor;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
varying vec3 fNormal;
|
||||
varying vec4 fTexCoord;
|
||||
varying vec4 fFrontColor;
|
||||
|
||||
void main() {
|
||||
|
||||
fNormal = gl_Normal;
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
fFrontColor = gl_Color;
|
||||
|
||||
}
|
Reference in New Issue
Block a user