qvolray

changeset 33:437e1ba9cf39

fixed on osx
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 14 Apr 2012 23:31:17 +0300
parents 7e5a2dd9bca6
children e7c006b774ed
files sdr/volray.p.glsl src/volray.cc
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/sdr/volray.p.glsl	Sat Apr 14 22:51:41 2012 +0300
     1.2 +++ b/sdr/volray.p.glsl	Sat Apr 14 23:31:17 2012 +0300
     1.3 @@ -78,7 +78,7 @@
     1.4  	float energy = 1.0;
     1.5  	float t = t0;
     1.6  	vec3 col = vec3(0.0, 0.0, 0.0);
     1.7 -	const vec3 ldir = normalize(vec3(-1, 1, -4));
     1.8 +	vec3 ldir = normalize(vec3(-1, 1, -4));
     1.9  
    1.10  
    1.11  	while(t < t1) {
     2.1 --- a/src/volray.cc	Sat Apr 14 22:51:41 2012 +0300
     2.2 +++ b/src/volray.cc	Sat Apr 14 23:31:17 2012 +0300
     2.3 @@ -50,6 +50,8 @@
     2.4  
     2.5  static Volume *volume;
     2.6  
     2.7 +static bool dbg_noray;
     2.8 +
     2.9  
    2.10  bool volray_init()
    2.11  {
    2.12 @@ -134,10 +136,13 @@
    2.13  		create_transfer_map(xfer_mean, xfer_sdev);
    2.14  	}
    2.15  
    2.16 +	glClear(GL_COLOR_BUFFER_BIT);
    2.17 +
    2.18 +	if(dbg_noray)
    2.19 +		return;
    2.20 +
    2.21  	draw_demo();
    2.22  
    2.23 -	glClear(GL_COLOR_BUFFER_BIT);
    2.24 -
    2.25  	if(volume) {
    2.26  		render_volume();
    2.27  	}
    2.28 @@ -203,6 +208,8 @@
    2.29  
    2.30  void volray_draw_slice(void)
    2.31  {
    2.32 +	glClear(GL_COLOR_BUFFER_BIT);
    2.33 +
    2.34  	glActiveTexture(GL_TEXTURE0);
    2.35  	glBindTexture(GL_TEXTURE_3D, volume->get_texture());
    2.36  	glEnable(GL_TEXTURE_3D);
    2.37 @@ -231,6 +238,8 @@
    2.38  
    2.39  void volray_draw_xfer(void)
    2.40  {
    2.41 +	glClear(GL_COLOR_BUFFER_BIT);
    2.42 +
    2.43  	glMatrixMode(GL_MODELVIEW);
    2.44  	glPushMatrix();
    2.45  	glTranslatef(-1, -1, 0);
    2.46 @@ -424,6 +433,9 @@
    2.47  		}
    2.48  	}
    2.49  
    2.50 +	if(getenv("DBG_NORAY")) {
    2.51 +		dbg_noray = true;
    2.52 +	}
    2.53  	return 0;
    2.54  }
    2.55