shithub: tinygl

Download patch

ref: 5718ea5ea5ac6645e454d279b619550a0054ea51
parent: 5848b7033edb889a521b27fb6dfbfdd0371d18d4
author: David <gek@katherine>
date: Fri Feb 19 09:43:39 EST 2021

A

--- a/src/light.c
+++ b/src/light.c
@@ -50,7 +50,7 @@
 		break;
 	case GL_SHININESS:
 		m->shininess = v[0];
-		m->shininess_i = (v[0] / 128.0f) * SPECULAR_BUFFER_RESOLUTION;
+		m->shininess_i = (v[0] / 128.0f) * SPECULAR_BUFFER_SIZE;
 		break;
 	case GL_AMBIENT_AND_DIFFUSE:
 		// printf("\nRECEIVED AMBIENT AND DIFFUSE COLOR %f, %f, %f, %f", v[0], v[1], v[2], v[3]);
--- a/src/specbuf.h
+++ /dev/null
@@ -1,21 +1,0 @@
-#ifndef _tgl_specbuf_h_
-#define _tgl_specbuf_h_
-
-/* Max # of specular light pow buffers */
-#define MAX_SPECULAR_BUFFERS 8
-/* # of entries in specular buffer */
-#define SPECULAR_BUFFER_SIZE 1024
-/* specular buffer granularity */
-#define SPECULAR_BUFFER_RESOLUTION 1024
-
-typedef struct GLSpecBuf {
-	GLint shininess_i;
-	GLint last_used;
-	GLfloat buf[SPECULAR_BUFFER_SIZE + 1];
-	struct GLSpecBuf* next;
-} GLSpecBuf;
-
-GLSpecBuf* specbuf_get_buffer(GLContext* c, const GLint shininess_i, const GLfloat shininess);
-void specbuf_cleanup(GLContext* c); /* free all memory used */
-
-#endif /* _tgl_specbuf_h_ */
\ No newline at end of file
--- a/src/zgl.h
+++ b/src/zgl.h
@@ -28,9 +28,9 @@
 #define MAX_SPECULAR_BUFFERS 32
 //#define MAX_SPECULAR_BUFFERS 16
 /* # of entries in specular buffer */
-#define SPECULAR_BUFFER_SIZE 1024
+#define SPECULAR_BUFFER_SIZE 512
 /* specular buffer granularity */
-#define SPECULAR_BUFFER_RESOLUTION 1024
+//#define SPECULAR_BUFFER_RESOLUTION 1024
 
 #define MAX_MODELVIEW_STACK_DEPTH 32
 #define MAX_PROJECTION_STACK_DEPTH 8