tavli

diff src/scenery.cc @ 18:986c0b76513f

shadows, not completed
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 29 Jun 2015 01:29:36 +0300
parents b1a195c3ee16
children 37dead56f01e
line diff
     1.1 --- a/src/scenery.cc	Sun Jun 28 23:04:37 2015 +0300
     1.2 +++ b/src/scenery.cc	Mon Jun 29 01:29:36 2015 +0300
     1.3 @@ -8,6 +8,7 @@
     1.4  #include "revol.h"
     1.5  #include "image.h"
     1.6  #include "sdr.h"
     1.7 +#include "opt.h"
     1.8  
     1.9  static bool gen_textures();
    1.10  
    1.11 @@ -33,6 +34,7 @@
    1.12  
    1.13  bool init_scenery()
    1.14  {
    1.15 +	unsigned int sdr = opt.shadows && sdr_shadow ? sdr_shadow : sdr_phong;
    1.16  	if(!gen_textures()) {
    1.17  		return false;
    1.18  	}
    1.19 @@ -56,7 +58,7 @@
    1.20  	otable->mtl.specular = Vector3(0.7, 0.7, 0.7);
    1.21  	otable->xform().set_translation(Vector3(0, -0.025, 0));
    1.22  	otable->set_texture(img_marble.texture());
    1.23 -	otable->set_shader(sdr_phong);
    1.24 +	otable->set_shader(sdr);
    1.25  	obj.push_back(otable);
    1.26  
    1.27