Merged with trunk, final part.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@14608 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-12-02 04:43:14 +00:00
commit bc2432bb57
187 changed files with 37008 additions and 49109 deletions

View File

@ -11,9 +11,11 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "STKRelease")
endif()
option(USE_WIIUSE "Support for wiimote input devices" OFF)
option(USE_WIIUSE "Support for wiimote input devices" ON)
option(USE_FRIBIDI "Support for right-to-left languages" ON)
option(USE_CPP2011 "Activate C++ 2011 mode (GCC only)" OFF)
if(UNIX)
option(USE_CPP2011 "Activate C++ 2011 mode (GCC only)" OFF)
endif()
set(STK_SOURCE_DIR "src")
set(STK_DATA_DIR "${PROJECT_SOURCE_DIR}/data")
@ -60,6 +62,8 @@ endif()
if(APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch i386")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch i386 -F/Library/Frameworks")
elseif(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") # Enable multi-processor compilation (faster)
endif()
# OpenAL
@ -103,8 +107,10 @@ if(USE_FRIBIDI)
endif()
endif()
if(USE_CPP2011)
add_definitions("-std=gnu++11")
if(UNIX)
if(USE_CPP2011)
add_definitions("-std=gnu++11")
endif()
endif()
# OpenGL
@ -153,7 +159,7 @@ source_group_hierarchy(STK_SOURCES STK_HEADERS)
if(APPLE)
# icon files to copy in the bundle
set(OSX_ICON_FILES ${PROJECT_SOURCE_DIR}/src/ide/Xcode/stk.icns)
set(OSX_ICON_FILES ${PROJECT_SOURCE_DIR}/data/supertuxkart.icns)
set_source_files_properties(${OSX_ICON_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(STK_SOURCES ${STK_SOURCES} ${OSX_ICON_FILES})
@ -175,7 +181,7 @@ if(APPLE)
# configure CMake to use a custom Info.plist
set_target_properties(supertuxkart PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/src/ide/Xcode/SuperTuxKart-Info.plist)
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/data/SuperTuxKart-Info.plist)
if(CMAKE_GENERATOR MATCHES "Xcode")
add_custom_command(TARGET supertuxkart POST_BUILD
@ -265,7 +271,8 @@ endif()
install(TARGETS supertuxkart RUNTIME DESTINATION ${STK_INSTALL_BINARY_DIR} BUNDLE DESTINATION .)
install(DIRECTORY ${STK_DATA_DIR} DESTINATION ${STK_INSTALL_DATA_DIR} PATTERN ".svn" EXCLUDE)
install(FILES ${PROJECT_BINARY_DIR}/supertuxkart.desktop DESTINATION share/applications)
install(FILES data/supertuxkart_32.xpm data/supertuxkart_64.xpm DESTINATION share/pixmaps)
install(FILES data/supertuxkart_32.png data/supertuxkart_128.png DESTINATION share/pixmaps)
install(FILES data/supertuxkart.appdata DESTINATION share/appdata)
set(PREFIX ${CMAKE_INSTALL_PREFIX})
configure_file(data/supertuxkart_desktop.template supertuxkart.desktop)

View File

@ -1,3 +1,25 @@
SuperTuxkart 0.8.1
~~~~~~~~~~~~~~~
* New track STK Enterprise
* Updated track The old mines
* Updated Lighthouse track
* Updated Zen Garden track
* New Soccer mode
* New Egg Hunt mode
* New karts Xue and Sara
* Updated Beastie kart
* Added Tutorial
* Added new Supertux difficulty
* New bubblegum shield weapon
* New Speeodmeter and nitro meter
* Add ability to filter addons
* Updated nitro models
* Add ability to save and resume Grand Prix
* Improve skid marks and nitro effects
* Wiimote support
SuperTuxkart 0.8
~~~~~~~~~~~~~~~
* Story mode and new challenge set

View File

@ -3,13 +3,25 @@
# - SRCS list of source files
# - HDRS list of header files
function(source_group_hierarchy SRCS HDRS)
foreach(source_file ${${SRCS}})
source_group_file(${source_file} "Source Files\\")
endforeach()
if(MSVC)
# This removes the 'Source Files' folder, which is
# not really necessary. Also, put header and source
# files into the same folder
foreach(source_file ${${SRCS}})
source_group_file(${source_file} "")
endforeach()
foreach(header_file ${${HDRS}})
source_group_file(${header_file} "")
endforeach()
else()
foreach(source_file ${${SRCS}})
source_group_file(${source_file} "Source Files\\")
endforeach()
foreach(header_file ${${HDRS}})
source_group_file(${header_file} "Source Files\\")
endforeach()
endif()
foreach(header_file ${${HDRS}})
source_group_file(${header_file} "Header Files\\")
endforeach()
endfunction()
# Determine source_group depending on file path

Binary file not shown.

View File

@ -14,7 +14,7 @@ desktopdir = $(prefix)/share/applications
desktop_DATA = supertuxkart.desktop
icondir = $(prefix)/share/pixmaps
dist_icon_DATA = supertuxkart_32.xpm supertuxkart_64.xpm
dist_icon_DATA = supertuxkart_32.png supertuxkart_128.png
# The desktop file needs the absolute path to the binary

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>SuperTuxKart</string>
<key>CFBundleIconFile</key>
<string>supertuxkart.icns</string>
<key>CFBundleIdentifier</key>
<string>net.sourceforge.supertuxkart</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>SuperTuxKart</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.8.1</string>
<key>CFBundleSignature</key>
<string>SPTK</string>
<key>CFBundleVersion</key>
<string>0.8.1</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>

View File

@ -6,11 +6,11 @@
<hard>
<karts number="1"/>
<requirements energy="16" time="135"/>
<requirements energy="18" time="135"/>
</hard>
<medium>
<karts number="1"/>
<requirements energy="14" time="155"/>
<requirements energy="15" time="155"/>
</medium>
<easy>
<karts number="1"/>

View File

@ -9,7 +9,7 @@
y="-0.01"
z="0.0" />
<material file="snowflake.png"/>
<material file="snowflake.png" clampu="Y" clampv="Y" />
<!-- Amount of particles emitted per second -->
<rate min="400"
@ -23,10 +23,13 @@
<size min="0.40"
max="0.60" />
<color min="255 255 255"
<color min="40 40 255"
max="255 255 255" />
<!-- How much time in milliseconds before the particle is fully faded out -->
<fadeout time="100" />
<wind speed="0.16"
flips="Y" />
</particles>

View File

@ -63,7 +63,7 @@
* thunderbird model
by Funto & Kinsu, released under CC-BY-SA 3.0
* thunderbird texture, bomb texture
* thunderbird texture, easter egg, bomb texture
by Fraag, released under CC-BY-SA 3.0
* swatter-icon
@ -72,7 +72,7 @@
* balldimpleddark
by Hero, released under CC-BY-SA 3.0
* rubber_ball-icon, plunger icon, cake icon, bowling ball texture and icon
* rubber_ball-icon, plunger icon, easter egg icon, cake icon, bowling ball texture and icon
by Totoplus62, released under CC-BY-SA 3.0
* shield-icon

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
data/models/christmas_hat.b3d Executable file → Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 KiB

View File

@ -11,6 +11,8 @@
<material name="stk_mod_nitroBottle.png" />
<material name="stk_mod_nitroLogo.png" compositing="additive" light="N" disable-z-write="Y" />
<material name="bubblegum_shield.png" compositing="blend" disable-z-write="Y"/>
<material name="bubblegum_shield_nolok.png" compositing="blend" disable-z-write="Y"/>
<material name="parachute.png" backface-culling="n" ignore="Y"/>
<material name="zipper.png" light="N" zipper="Y"/>
<material name="zipper_collect.png" light="N" zipper="Y"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -99,7 +99,7 @@
w-multi=" 0 30 30 30 30 0 0 0 0 0" />
<last w=" 0 30 10 90 60 0 10 60 60 0"
w-multi=" 0 30 30 100 60 0 0 0 0 0" />
<battle w=" 0 30 60 0 0 10 30 0 0 0"
<battle w="10 30 60 0 0 10 30 0 0 0"
w-multi=" 0 0 5 0 0 0 0 0 0 0" />
<tuto w=" 0 0 0 0 0 0 0 0 0 0"
w-multi=" 0 0 100 0 0 0 0 0 0 0" />

39
data/shaders/MLAA_COPYING Normal file
View File

@ -0,0 +1,39 @@
/**
* Copyright (C) 2010 Jorge Jimenez (jorge@iryoku.com)
* Copyright (C) 2010 Belen Masia (bmasia@unizar.es)
* Copyright (C) 2010 Jose I. Echevarria (joseignacioechevarria@gmail.com)
* Copyright (C) 2010 Fernando Navarro (fernandn@microsoft.com)
* Copyright (C) 2010 Diego Gutierrez (diegog@unizar.es)
* Copyright (C) 2011 Lauri Kasanen (cand@gmx.com)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the following statement:
*
* "Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia,
* Jose I. Echevarria, Fernando Navarro and Diego Gutierrez."
*
* Only for use in the Mesa project, this point 2 is filled by naming the
* technique Jimenez's MLAA in the Mesa config options.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
* IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holders.
*/

13
data/shaders/bloom.frag Normal file
View File

@ -0,0 +1,13 @@
uniform sampler2D tex;
uniform float low;
void main()
{
vec3 weights = vec3(0.2126, 0.7152, 0.0722); // ITU-R BT. 709
vec3 col = texture2D(tex, gl_TexCoord[0].xy).xyz;
float luma = dot(weights, col);
col *= smoothstep(low, 0.9, luma);
gl_FragColor = vec4(col, 1.0);
}

View File

@ -0,0 +1,10 @@
uniform sampler2D tex;
void main()
{
vec4 col = texture2D(tex, gl_TexCoord[0].xy);
col.xyz *= 10.0 * col.a;
gl_FragColor = vec4(col.xyz, 1.0);
}

View File

@ -0,0 +1,11 @@
uniform float power;
uniform sampler2D tex;
void main()
{
vec4 col = texture2D(tex, gl_TexCoord[0].xy);
if (col.a < 0.5)
discard;
gl_FragColor = vec4(col.xyz, power);
}

View File

@ -1,11 +1,26 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2013 the SuperTuxKart team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
uniform sampler2D main_texture;
uniform sampler2D tex;
uniform float transparency;
varying vec2 uv;
void main()
{
gl_FragColor = texture2D(main_texture, uv);
gl_FragColor.a *= transparency;
gl_FragColor = texture2D(tex, uv);
gl_FragColor.a *= transparency;
}

View File

@ -1,3 +1,21 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2013 the SuperTuxKart team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Creates a bubble (wave) effect by distorting the texture depending on time
uniform float time;

View File

@ -0,0 +1,17 @@
uniform sampler2D tex;
uniform sampler2D caustictex;
uniform vec2 dir;
uniform vec2 dir2;
void main()
{
vec2 tc = gl_TexCoord[0].xy;
vec3 col = texture2D(tex, tc).xyz;
float caustic = texture2D(caustictex, tc + dir).x;
float caustic2 = texture2D(caustictex, (tc.yx + dir2 * vec2(-0.6, 0.3)) * vec2(0.6)).x;
col += caustic * caustic2 * 10.0;
gl_FragColor = vec4(col, 1.0);
}

View File

@ -0,0 +1,25 @@
uniform sampler2D tex;
uniform sampler2D oldtex;
uniform vec2 pixel;
uniform vec2 multi;
uniform int size;
void main()
{
float res = 0.0;
vec2 tc = gl_TexCoord[0].xy;
// tc.y = 1.0 - tc.y;
tc *= multi;
for (int i = 0; i < size; i++)
{
float col = texture2D(tex, tc).x;
res = max(col, res);
tc += pixel;
}
float old = texture2D(oldtex, gl_TexCoord[0].xy).x;
gl_FragColor = vec4(mix(old, res, 0.7));
}

View File

@ -0,0 +1,6 @@
uniform vec3 col;
void main()
{
gl_FragColor = vec4(col, 1.0);
}

View File

@ -0,0 +1,11 @@
uniform vec3 col;
uniform sampler2D tex;
void main()
{
float alpha = texture2D(tex, gl_TexCoord[0].xy).a;
if (alpha < 0.5)
discard;
gl_FragColor = vec4(col, 1.0);
}

View File

@ -0,0 +1,40 @@
uniform sampler2D tex;
uniform vec2 screen;
uniform vec2 dir;
uniform vec2 dir2;
varying float camdist;
void main()
{
vec2 tc = gl_TexCoord[0].xy;
vec4 col = vec4(0.0);
const float maxlen = 0.02;
float horiz = texture2D(tex, tc + dir).x;
float vert = texture2D(tex, (tc.yx + dir2) * vec2(0.9)).x;
vec2 offset = vec2(horiz, vert);
offset *= 2.0;
offset -= 1.0;
// Fade according to distance to cam
float fade = 1.0 - smoothstep(1.0, 40.0, camdist);
// Fade according to distance from the edges
vec2 edger = gl_TexCoord[1].xy;
const float mindist = 0.1;
fade *= smoothstep(0.0, mindist, edger.x) * smoothstep(0.0, mindist, edger.y) *
(1.0 - smoothstep(1.0 - mindist, 1.0, edger.x)) *
(1.0 - smoothstep(1.0 - mindist, 1.0, edger.y));
offset *= 50.0 * fade * maxlen;
col.r = step(offset.x, 0.0) * -offset.x;
col.g = step(0.0, offset.x) * offset.x;
col.b = step(offset.y, 0.0) * -offset.y;
col.a = step(0.0, offset.y) * offset.y;
gl_FragColor = col;
}

View File

@ -0,0 +1,9 @@
varying float camdist;
void main() {
gl_Position = ftransform();
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_MultiTexCoord1;
camdist = length((gl_ModelViewMatrix * gl_Vertex).xyz);
}

View File

@ -0,0 +1,6 @@
void main() {
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_MultiTexCoord1;
gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex).xyww;
gl_FrontColor = gl_Color;
}

17
data/shaders/flip.frag Normal file
View File

@ -0,0 +1,17 @@
uniform sampler2D tex;
void main()
{
vec2 texc = gl_TexCoord[0].xy;
texc.y = 1.0 - texc.y;
vec4 col = texture2D(tex, texc);
//col = col * 256;
//col = (1 - col);
col = col / (1 - col);
gl_FragColor = vec4(col.rgb, 1.0);
}

34
data/shaders/fog.frag Normal file
View File

@ -0,0 +1,34 @@
uniform sampler2D tex;
uniform float fogmax;
uniform float startH;
uniform float endH;
uniform float start;
uniform float end;
uniform vec3 col;
uniform vec3 campos;
uniform mat4 ipvmat;
float decdepth(vec4 rgba) {
return dot(rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0));
}
void main()
{
float z = decdepth(vec4(texture2D(tex, gl_TexCoord[0].xy).xyz, 0.0));
vec3 tmp = vec3(gl_TexCoord[0].xy, z);
tmp = tmp * 2.0 - 1.0;
vec4 xpos = vec4(tmp, 1.0);
xpos = ipvmat * xpos;
xpos.xyz /= xpos.w;
float dist = distance(campos, xpos.xyz);
float fog = smoothstep(start, end, dist);
fog *= 1.0 - smoothstep(startH, endH, xpos.y);
fog = min(fog, fogmax);
gl_FragColor = vec4(col, fog);
}

View File

@ -0,0 +1,19 @@
uniform sampler2D tex;
uniform vec2 pixel;
// Gaussian separated blur with radius 3.
void main()
{
vec4 sum = vec4(0.0);
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
sum += texture2D(tex, vec2(X - 3.0 * pixel.x, Y)) * 0.03125;
sum += texture2D(tex, vec2(X - 1.3333 * pixel.x, Y)) * 0.328125;
sum += texture2D(tex, vec2(X, Y)) * 0.273438;
sum += texture2D(tex, vec2(X + 1.3333 * pixel.x, Y)) * 0.328125;
sum += texture2D(tex, vec2(X + 3.0 * pixel.x, Y)) * 0.03125;
gl_FragColor = sum;
}

View File

@ -0,0 +1,19 @@
uniform sampler2D tex;
uniform vec2 pixel;
// Gaussian separated blur with radius 3.
void main()
{
vec4 sum = vec4(0.0);
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
sum += texture2D(tex, vec2(X, Y - 3.0 * pixel.y)) * 0.03125;
sum += texture2D(tex, vec2(X, Y - 1.3333 * pixel.y)) * 0.328125;
sum += texture2D(tex, vec2(X, Y)) * 0.273438;
sum += texture2D(tex, vec2(X, Y + 1.3333 * pixel.y)) * 0.328125;
sum += texture2D(tex, vec2(X, Y + 3.0 * pixel.y)) * 0.03125;
gl_FragColor = sum;
}

View File

@ -0,0 +1,21 @@
uniform sampler2D tex;
uniform vec2 pixel;
// Gaussian separated blur with radius 6.
void main()
{
vec4 sum = vec4(0.0);
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
sum += texture2D(tex, vec2(X - 5.13333 * pixel.x, Y)) * 0.00640869;
sum += texture2D(tex, vec2(X - 3.26667 * pixel.x, Y)) * 0.083313;
sum += texture2D(tex, vec2(X - 1.4 * pixel.x, Y)) * 0.305481;
sum += texture2D(tex, vec2(X, Y)) * 0.209473;
sum += texture2D(tex, vec2(X + 1.4 * pixel.x, Y)) * 0.305481;
sum += texture2D(tex, vec2(X + 3.26667 * pixel.x, Y)) * 0.083313;
sum += texture2D(tex, vec2(X + 5.13333 * pixel.x, Y)) * 0.00640869;
gl_FragColor = sum;
}

View File

@ -0,0 +1,21 @@
uniform sampler2D tex;
uniform vec2 pixel;
// Gaussian separated blur with radius 6.
void main()
{
vec4 sum = vec4(0.0);
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
sum += texture2D(tex, vec2(X, Y - 5.13333 * pixel.y)) * 0.00640869;
sum += texture2D(tex, vec2(X, Y - 3.26667 * pixel.y)) * 0.083313;
sum += texture2D(tex, vec2(X, Y - 1.4 * pixel.y)) * 0.305481;
sum += texture2D(tex, vec2(X, Y)) * 0.209473;
sum += texture2D(tex, vec2(X, Y + 1.4 * pixel.y)) * 0.305481;
sum += texture2D(tex, vec2(X, Y + 3.26667 * pixel.y)) * 0.083313;
sum += texture2D(tex, vec2(X, Y + 5.13333 * pixel.y)) * 0.00640869;
gl_FragColor = sum;
}

16
data/shaders/glow.frag Normal file
View File

@ -0,0 +1,16 @@
uniform sampler2D tex;
uniform vec2 res;
void main()
{
vec2 coords = gl_FragCoord.xy / res;
vec4 col = texture2D(tex, coords);
float alpha = col.a;
if (alpha < 0.04) discard;
col *= vec4(vec3(4.0), 1.5);
gl_FragColor = col;
}

16
data/shaders/godfade.frag Normal file
View File

@ -0,0 +1,16 @@
uniform sampler2D tex;
uniform vec3 col;
void main()
{
vec4 res = texture2D(tex, gl_TexCoord[0].xy);
// Keep the sun fully bright, but fade the sky
float mul = distance(res.xyz, col);
mul = step(mul, 0.02);
mul *= 0.97;
res = res * vec4(mul);
gl_FragColor = res;
}

29
data/shaders/godray.frag Normal file
View File

@ -0,0 +1,29 @@
uniform sampler2D tex;
uniform vec2 sunpos;
#define SAMPLES 12
const float decaystep = 0.88;
void main()
{
vec2 texc = gl_TexCoord[0].xy;
vec2 tosun = sunpos - texc;
if (dot(tosun, tosun) > 0.49) discard;
vec2 dist = tosun * 1.0/(float(SAMPLES) * 1.12);
vec3 col = texture2D(tex, texc).xyz;
float decay = 1.0;
for (int i = 0; i < SAMPLES; i++) {
texc += dist;
vec3 here = texture2D(tex, texc).xyz;
here *= decay;
col += here;
decay *= decaystep;
}
gl_FragColor = vec4(col, 1.0) * 0.8;
}

View File

@ -1,36 +1,8 @@
uniform vec4 fogColor;
uniform float fogFrom;
uniform float fogTo;
uniform int fog;
uniform sampler2D tex;
varying vec4 coord;
void main()
{
vec4 color = texture2D(tex, gl_TexCoord[0].st);
vec4 solidColor = vec4(color.r, color.g, color.b, 1);
vec4 color = texture2D(tex, gl_TexCoord[0].st);
if (fog == 1)
{
if (coord.z > fogTo)
{
gl_FragColor = fogColor;
gl_FragColor.a = color.a;
}
else if (coord.z > fogFrom)
{
float fogIntensity = (coord.z - fogFrom) / (fogTo - fogFrom);
vec4 color2 = fogIntensity*fogColor + (1.0 - fogIntensity)*solidColor;
color2.a = color.a;
gl_FragColor = color2;
}
else
{
gl_FragColor = color;
}
}
else
{
gl_FragColor = color;
}
gl_FragColor = color;
}

View File

@ -1,15 +1,11 @@
uniform float angle;
uniform float amplitude;
varying vec4 coord;
uniform vec3 windDir;
void main()
{
gl_TexCoord[0] = gl_MultiTexCoord0;
vec4 vertexPosition = ftransform(); //gl_ModelViewMatrix * gl_Vertex;
vertexPosition += vec4(1,0,0,0) * amplitude * gl_Color.r * sin(angle);
gl_Position = vertexPosition;
gl_FrontColor = vec4(1,1,1,1);
gl_BackColor = vec4(1,1,1,1);
coord = vertexPosition;
}
gl_TexCoord[0] = gl_MultiTexCoord0;
vec4 vertexPosition = gl_Vertex;
vertexPosition.xyz += windDir * gl_Color.r;
gl_Position = gl_ModelViewProjectionMatrix * vertexPosition;
}

View File

@ -1,3 +1,21 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2013 the SuperTuxKart team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Jean-manuel clemencon (c) supertuxkart 2013
// bubble gum shield
// TODO: Add a nice texture and soft edges when intersect with geometry
@ -13,8 +31,8 @@ void main()
{
float inter = dot(normal, eyeVec);
float m = texture2D(tex, vec2(0.5, uv.y)).r;
inter = 1 - inter;
float alpha = inter + 1;// * m;
inter = 1.0 - inter;
float alpha = inter + 1.0;// * m;
gl_FragColor = vec4(0.8, 0.16, 0.48, alpha);
}

View File

@ -1,3 +1,21 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2013 the SuperTuxKart team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Jean-manuel clemencon (c) supertuxkart 2013
// Creates a bubble gum shield effect
// ---

View File

@ -1,3 +1,21 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2013 the SuperTuxKart team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Jean-manuel clemencon supertuxkart
// Creates a cone lightbeam effect by smoothing edges
// Original idea: http://udn.epicgames.com/Three/VolumetricLightbeamTutorial.html

Some files were not shown because too many files have changed in this diff Show More