Skip to content

Commit

Permalink
Merge remote branch 'origin/gl2'
Browse files Browse the repository at this point in the history
  • Loading branch information
acaudwell committed May 2, 2011
2 parents ae14ffc + 7d19f70 commit fc58e39
Show file tree
Hide file tree
Showing 41 changed files with 1,126 additions and 709 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
0.34-rc1:
* Now using VBOs and shaders for faster rendering when OpenGL 2.0 is available.
* Eliminated bloom colour banding artifacts (requires OpenGL 2.0).
* New font rendering library derived from FTGL (FTGL no longer required).
* Single pass font/shadow rendering (with lots of help from Chris Forbes).
* Added --no-vsync option.
* Fixed bug where tree is out of alignment with object positions in windowed
mode due to using the wrong display dimensions internally.
* Removed default max-files limit.

0.33:
* Added --hide root option to not draw branches from the root directory.
* Fixed log parsing of Bazaar merges and tagged commits.
Expand Down
6 changes: 3 additions & 3 deletions INSTALL
Expand Up @@ -15,15 +15,15 @@ Gource requires the following libraries to compile:
SDL 1.2 (libsdl1.2-dev)
SDL Image 1.2 (libsdl-image1.2-dev)
PCRE3 (libpcre3-dev)
FTGL 2.1.3~rc5-2 (libftgl-dev)
PNG library (libpng12-dev)
JPEG library (libjpeg62-dev)
Freetype 2 (libfreetype6-dev)
GLEW (libglew1.5-dev)

Optional:

TinyXML (libtinyxml-dev)

Note: SDL Image needs to have been built with support PNG and JPEG images.

2. Building
===========

Expand Down
7 changes: 7 additions & 0 deletions Makefile.am
Expand Up @@ -5,6 +5,7 @@ bin_PROGRAMS = gource
gource_SOURCES = \
src/action.cpp src/action.h \
src/apache.cpp src/apache.h \
src/bloom.cpp src/bloom.h \
src/bzr.cpp src/bzr.h \
src/commitlog.cpp src/commitlog.h \
src/core/bounds.h \
Expand All @@ -13,6 +14,7 @@ gource_SOURCES = \
src/core/display.cpp src/core/display.h \
src/core/frustum.cpp src/core/frustum.h \
src/core/fxfont.cpp src/core/fxfont.h \
src/core/gl.h \
src/core/logger.cpp src/core/logger.h \
src/core/mousecursor.cpp src/core/mousecursor.h \
src/core/pi.h \
Expand All @@ -24,12 +26,14 @@ gource_SOURCES = \
src/core/sdlapp.cpp src/core/sdlapp.h \
src/core/seeklog.cpp src/core/seeklog.h \
src/core/settings.cpp src/core/settings.h \
src/core/shader.cpp src/core/shader.h \
src/core/stringhash.cpp src/core/stringhash.h \
src/core/texture.cpp src/core/texture.h \
src/core/utf8/checked.h \
src/core/utf8/core.h \
src/core/utf8/unchecked.h \
src/core/utf8/utf8.h \
src/core/vbo.cpp src/core/vbo.h \
src/core/vectors.h \
src/custom.cpp src/custom.h \
src/cvs-exp.cpp src/cvs-exp.h \
Expand All @@ -56,6 +60,9 @@ CPPFLAGS = -DSDLAPP_RESOURCE_DIR=\"$(pkgdatadir)\"

dist_pkgdata_DATA = data/beam.png data/bloom.tga data/bloom_alpha.tga data/cursor.png data/file.png data/no_photo.png data/gource.style

shadersdir = $(pkgdatadir)/shaders
dist_shaders_DATA = data/shaders/shadow.vert data/shaders/shadow.frag data/shaders/bloom.vert data/shaders/bloom.frag data/shaders/text.vert data/shaders/text.frag

install-data-hook:
mkdir -p -m 755 ${DESTDIR}/$(mandir)/man1
gzip -cf9 data/gource.1 > $(DESTDIR)$(mandir)/man1/gource.1.gz
Expand Down
5 changes: 4 additions & 1 deletion README
Expand Up @@ -169,7 +169,10 @@ options:
--multi-sampling
Enable multi-sampling.

--bloom-multiplier FLOAT
--no-vsync
Disable vsync.

--bloom-multiplier FLOAT
Adjust the amount of bloom.

--bloom-intensity FLOAT
Expand Down
23 changes: 8 additions & 15 deletions configure.ac
Expand Up @@ -3,7 +3,7 @@

AC_PREREQ(2.61)

AC_INIT(Gource, 0.33, [acaudwell@gmail.com])
AC_INIT(Gource, 0.34-rc1, [acaudwell@gmail.com])
AC_CONFIG_SRCDIR([src/main.h])

AM_INIT_AUTOMAKE([dist-bzip2 foreign subdir-objects])
Expand Down Expand Up @@ -41,24 +41,18 @@ CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

#Freetype2
AC_CHECK_FT2([9.0.3],[],[AC_MSG_ERROR([FreeType2 is required by FTGL. Please see INSTALL])])
AC_CHECK_FT2([9.0.3],[],[AC_MSG_ERROR([FreeType2 is required. Please see INSTALL])])
CXXFLAGS="$CXXFLAGS $FT2_CFLAGS"
CPPFLAGS="$CPPFLAGS $FT2_CFLAGS"
LIBS="$LIBS $FT2_LIBS"

#FTGL
PKG_CHECK_MODULES(FTGL, ftgl >= 2.1.3, [], AC_MSG_ERROR(FTGL 2.1.3 or greater is required. Please see INSTALL))
CXXFLAGS="$CXXFLAGS $FTGL_CFLAGS"
CPPFLAGS="$CPPFLAGS $FTGL_CFLAGS"
LIBS="$LIBS $FTGL_LIBS"

#PNG library
AC_CHECK_LIB(png, png_read_info, , AC_MSG_ERROR([PNG library required. Please see INSTALL]))
#SDL_image library with PNG support
AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, LIBS="$LIBS", AC_MSG_ERROR([SDL_image with PNG support required. Please see INSTALL]))

#JPEG library
AC_CHECK_LIB(jpeg, jpeg_read_header, , AC_MSG_ERROR([JPEG library required. Please see INSTALL]))
#SDL_image library with JPG support
AC_CHECK_LIB(SDL_image, IMG_LoadJPG_RW, LIBS="$LIBS", AC_MSG_ERROR([SDL_image with JPG support required. Please see INSTALL]))

#SDL_image library with PNG support
AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, LIBS="$LIBS -lSDL_image", AC_MSG_ERROR([SDL_image required. Please see INSTALL]))
LIBS="$LIBS -lSDL_image"

#PCRE
AC_CHECK_LIB([pcre], [pcre_compile],, AC_MSG_ERROR(PCRE is required. Please see INSTALL))
Expand All @@ -69,7 +63,6 @@ AC_CHECK_LIB(GLEW, glewInit, LIBS="$LIBS -lGLEW", AC_MSG_ERROR([GLEW required. P
#Check for required headers
AC_CHECK_HEADER([SDL.h],, AC_MSG_ERROR(SDL.h is required. Please see INSTALL))
AC_CHECK_HEADER([SDL_image.h],, AC_MSG_ERROR(SDL_image.h is required. Please see INSTALL))
AC_CHECK_HEADER([ftgl.h],, AC_MSG_ERROR(ftgl.h is required. Please see INSTALL))
AC_CHECK_HEADER([pcre.h],, AC_MSG_ERROR(pcre.h is required. Please see INSTALL))
AC_CHECK_HEADER([GL/glew.h],, AC_MSG_ERROR(glew.h is required. Please see INSTALL))

Expand Down
3 changes: 3 additions & 0 deletions data/gource.1
Expand Up @@ -139,6 +139,9 @@ Camera view padding.
\fB\-\-multi\-sampling\fR
Enable multi-sampling.
.TP
\fB\-\-no\-vsync\fR
Disable vsync.
.TP
\fB\-\-bloom\-multiplier FLOAT\fR
Adjust the amount of bloom.
.TP
Expand Down
16 changes: 16 additions & 0 deletions data/shaders/bloom.frag
@@ -0,0 +1,16 @@

varying vec3 pos;

void main()
{
float r = fract(sin(dot(pos.xy ,vec2(11.3713,67.3219))) * 2351.3718);

float offset = (0.5 - r) * gl_TexCoord[0].x * 0.045;

float intensity = min(1.0, cos((length(pos*2.0)+offset)/gl_TexCoord[0].x));
float gradient = intensity * smoothstep(0.0, 2.0, intensity);

gradient *= smoothstep(1.0,0.67+r*0.33, 1.0-intensity);

gl_FragColor = gl_Color * gradient;
}
10 changes: 10 additions & 0 deletions data/shaders/bloom.vert
@@ -0,0 +1,10 @@

varying vec3 pos;

void main()
{
pos = gl_Vertex.xyz - gl_MultiTexCoord0.yzw;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_FrontColor = gl_Color;
gl_Position = ftransform();
}
9 changes: 9 additions & 0 deletions data/shaders/shadow.frag
@@ -0,0 +1,9 @@
uniform sampler2D tex;
uniform float shadow_strength;

void main(void)
{
vec4 colour = texture2D(tex,gl_TexCoord[0].st);

gl_FragColor = vec4(0.0, 0.0, 0.0, gl_Color.w * colour.w * shadow_strength);
}
6 changes: 6 additions & 0 deletions data/shaders/shadow.vert
@@ -0,0 +1,6 @@
void main(void)
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_FrontColor = gl_Color;
}
13 changes: 13 additions & 0 deletions data/shaders/text.frag
@@ -0,0 +1,13 @@
uniform sampler2D tex;
uniform float shadow_strength;
uniform float texel_size;

void main(void)
{
float colour_alpha = texture2D(tex,gl_TexCoord[0].xy).w;
float shadow_alpha = texture2D(tex,gl_TexCoord[0].xy - vec2(texel_size)).w * shadow_strength;

float combined_alpha = 1.0 - (1.0-shadow_alpha)*(1.0-colour_alpha);

gl_FragColor = gl_Color * vec4(vec3(colour_alpha / combined_alpha), combined_alpha);
}
6 changes: 6 additions & 0 deletions data/shaders/text.vert
@@ -0,0 +1,6 @@
void main(void)
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_FrontColor = gl_Color;
}
83 changes: 0 additions & 83 deletions debian/changelog

This file was deleted.

1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

20 changes: 0 additions & 20 deletions debian/control

This file was deleted.

41 changes: 0 additions & 41 deletions debian/copyright

This file was deleted.

1 change: 0 additions & 1 deletion debian/dirs

This file was deleted.

2 changes: 0 additions & 2 deletions debian/docs

This file was deleted.

0 comments on commit fc58e39

Please sign in to comment.