dbf-udg

changeset 2:c45c7a1f7d9d

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 09 Jan 2013 02:37:05 +0200
parents 1d5dc834d403
children 403ec1be3a1a
files sdr/dither.p.glsl src/udg.cc
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/sdr/dither.p.glsl	Tue Jan 08 14:19:06 2013 +0200
     1.2 +++ b/sdr/dither.p.glsl	Wed Jan 09 02:37:05 2013 +0200
     1.3 @@ -7,6 +7,8 @@
     1.4  
     1.5  	vec4 pixel = texture2D(framebuf, gl_TexCoord[0].xy);
     1.6  	float lum = dot(pixel.xyz, vec3(0.2126, 0.7152, 0.0722));
     1.7 +	// gamma correct luminance?
     1.8 +	//lum = pow(lum, 1.0 / 2.2);
     1.9  	float coord_shift = floor(lum * levels) / levels;
    1.10  
    1.11  	vec2 dsz2 = vec2(float(dither_size), float(dither_size));
     2.1 --- a/src/udg.cc	Tue Jan 08 14:19:06 2013 +0200
     2.2 +++ b/src/udg.cc	Wed Jan 09 02:37:05 2013 +0200
     2.3 @@ -13,7 +13,7 @@
     2.4  #include "sdr.h"
     2.5  #include "dither_matrix.h"
     2.6  
     2.7 -#define DITHER_SZ		4
     2.8 +#define DITHER_SZ		8
     2.9  #define DITHER_LEVELS	16
    2.10  
    2.11  #if DITHER_SZ == 4
    2.12 @@ -165,6 +165,12 @@
    2.13  	glRotatef(cam_phi, 1, 0, 0);
    2.14  	glRotatef(cam_theta, 0, 1, 0);
    2.15  
    2.16 +	const float blue[] = {0.4, 0.45, 1.0, 1};
    2.17 +	const float white[] = {1, 1, 1, 1};
    2.18 +	glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue);
    2.19 +	glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white);
    2.20 +	glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 80.0);
    2.21 +
    2.22  	glFrontFace(GL_CW);
    2.23  	glutSolidTeapot(1.0);
    2.24  	glFrontFace(GL_CCW);