started working on Abgabe 4
This commit is contained in:
parent
d006555bfa
commit
352cab6abb
@ -10,7 +10,6 @@
|
||||
// TODO: Nimm Normalen als Attribut entgegen
|
||||
in vec3 vNormal;
|
||||
|
||||
|
||||
uniform mat4 modelMatrix;
|
||||
uniform mat4 viewMatrix;
|
||||
|
||||
@ -20,8 +19,13 @@
|
||||
// TODO: Nimm alle Koeffizienten und Intensitäten, sowie den Exponenten als Uniform-Variablen entgegen
|
||||
uniform vec3 Ia;
|
||||
uniform vec3 ka;
|
||||
uniform float specExp;
|
||||
|
||||
// TODO: Definiere alle Konstanten c_1, c_2, c_3
|
||||
const float c_1 = 1.0;
|
||||
const float c_2 = 0.001;
|
||||
const float c_3 = 0.0001;
|
||||
|
||||
|
||||
out vec3 vfColor;
|
||||
|
||||
@ -36,7 +40,9 @@
|
||||
mat4 modelViewMatrix = viewMatrix * modelMatrix;
|
||||
|
||||
// TODO: Berechne die Normalenmatrix
|
||||
|
||||
// ? is modelViewMatrix our T or viewMatrix
|
||||
mat4 normalMatrix = inverse(transpose(modelViewMatrix));
|
||||
vec4 vec4Normal = vec4(vNormal, 0.0);
|
||||
|
||||
// TODO: Rechne alle übergebenen Koordinaten (Lichtposition, Normalen) in das Kamerakoordinatensystem um
|
||||
vec4 position = modelViewMatrix * vPosition;
|
||||
@ -48,7 +54,6 @@
|
||||
|
||||
// TODO: Berechne die Distanz d, sowie f_{att}
|
||||
|
||||
// TODAY
|
||||
// TODO: Berechne die Farbe vfColor anhand der Phong-Beleuchtungsgleichung
|
||||
//vfColor = TODO;
|
||||
vfColor = Ia * ka;
|
||||
|
Loading…
Reference in New Issue
Block a user