one planet is always the sun and rendering the sun dynamically now.

This commit is contained in:
Andreas Ortmann 2016-09-30 22:47:28 +02:00
parent e1102e3231
commit f2bdadd49f
6 changed files with 75 additions and 42 deletions

View file

@ -1,20 +1,26 @@
#version 120
varying vec3 vertex;
varying vec3 normal;
varying vec3 vertex;
varying vec3 normal;
varying vec3 lightDirection;
uniform vec3 materialColor;
uniform vec3 lightColor;
uniform vec3 lightPosition;
varying vec3 lightDirection;
uniform vec3 lightColor;
uniform vec3 lightPosition;
uniform float materialKind;
uniform vec3 materialColor;
void main()
{
vec3 Eye = normalize(-vertex);
vec3 Reflected = normalize(reflect( -lightPosition, normal));
vec3 IAmbient = vec3(0.2f);
vec3 IAmbient = vec3(0.05f);
if (materialKind == 6) {
// sun: shines by itself
gl_FragColor = vec4(materialColor, 1.0);
return;
}
// TODO: add noise texture
vec3 IDiffuse = vec3(materialColor) * lightColor * max(dot(normal, lightDirection), 0.0);