Commit 60f03fa1 authored by Dario Seyb's avatar Dario Seyb

changes to sun material

parent 88178002
......@@ -90,5 +90,5 @@ void main()
vec3 specularColor = pow(specularFactor, 210) * uLightColor.rgb;
oColor = vec4((diffuseColor + specularColor) * color.rgb * uLightColor.a * shadowFactor(worldPosition) + emissive.rgb, 1);
oColor = vec4((diffuseColor + specularColor) * color.rgb * uLightColor.a/(lightDistance * lightDistance) * shadowFactor(worldPosition) + emissive.rgb, 1);
}
......@@ -85,7 +85,7 @@ int main(int argc, char *argv[]) {
Geometry geom2 = { vaoTeapot };
// Create a material that uses the loaded shader program
Material checkerboardMat = { glm::vec4{1, 1, 1, 1}, glm::vec4{ 1, 1, 1, 1 }, checkboardTexture, pbrShader };
Material sunMaterial = { glm::vec4{1, 1, 1, 1}, glm::vec4{ 1, 1, 1, 1 }, checkboardTexture, pbrShader };
Material transparentMat = { glm::vec4{ 1, 1, 1, 1 }, glm::vec4{ 0, 0, 0, 1 }, testTransparencyTexture, pbrShader };
// Let's create a placeholder sun
......@@ -93,9 +93,9 @@ int main(int argc, char *argv[]) {
// Add a transform component to it so we are able to position it in space
auto sunTransform = sun.assign<Transform>();
// Add a Drawable component to it so the renderer has something to draw
sun.assign<Drawable>(geom1, checkerboardMat);
sun.assign<Drawable>(geom1, sunMaterial);
sunTransform->scale = glm::vec3(2, 2, 2);
sun.assign<Light>(glm::vec4(1, 1, 1, 1), glm::vec3(1, 0, 0), false);
sun.assign<Light>(glm::vec4(1, 1, 1, 400), glm::vec3(1, 0, 0), false);
// create a planet!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment