Do some cleaning

This commit is contained in:
Vincent Lejeune 2014-05-18 19:56:25 +02:00
parent bf71c2f71d
commit eca3999d52
19 changed files with 0 additions and 862 deletions

View File

@ -1,12 +0,0 @@
uniform sampler2D tex1;
uniform sampler2D tex2;
out vec4 FragColor;
void main()
{
vec4 col1 = texture(tex1, gl_TexCoord[0].xy);
vec4 col2 = vec4(vec3(texture(tex2, gl_TexCoord[0].xy).x), 1.0);
FragColor = col1 * col2;
}

View File

@ -1,21 +0,0 @@
uniform sampler2D tex;
uniform sampler2D normals_and_depth;
uniform mat4 invproj;
uniform vec2 screen;
out vec4 FragColor;
void main()
{
vec2 xy = gl_FragCoord.xy / screen;
float FragZ = gl_FragCoord.z;
float EnvZ = texture(normals_and_depth, xy).a;
vec4 FragmentPos = invproj * (2. * vec4(xy, FragZ, 1.0) - 1.);
FragmentPos /= FragmentPos.w;
vec4 EnvPos = invproj * (2. * vec4(xy, EnvZ, 1.0) - 1.);
EnvPos /= EnvPos.w;
float len = dot(vec3(1.0), abs(texture(normals_and_depth, xy).xyz));
float alpha = (len < 0.2) ? 1. : clamp((EnvPos.z - FragmentPos.z) * 0.3, 0., 1.);
FragColor = texture(tex, gl_PointCoord.xy);
FragColor.a *= alpha;
}

View File

@ -1,12 +0,0 @@
uniform float screenw;
void main()
{
const float size = 0.5;
vec4 eyepos = gl_Vertex;
vec4 projCorner = gl_ProjectionMatrix * vec4(vec2(size), eyepos.z, eyepos.w);
gl_PointSize = screenw * projCorner.x / projCorner.w;
gl_Position = gl_ProjectionMatrix * eyepos;
}

View File

@ -1,28 +0,0 @@
uniform float time;
uniform vec3 campos;
uniform mat4 viewm;
in vec3 initialPosition;
out vec3 currentPosition;
void main()
{
// This simulation will run accurately for a bit under five days.
vec4 start = vec4(initialPosition, 1.0);
start.y -= time;
// How many times has it fell?
float count = floor(start.y / 24.0);
start.x += sin(count);
start.z += cos(count);
vec2 signs = sign(start.xz);
start.xz = mod(start.xz, 17.5) * signs;
start.y = mod(start.y, 24.0) - 3.0;
start.xyz += campos;
currentPosition = (viewm * start).xyz;
gl_Position = vec4(0.);
}

View File

@ -1,47 +0,0 @@
uniform sampler2D halft; // half is a reserved word
uniform sampler2D quarter;
uniform sampler2D eighth;
in vec2 uv;
out vec4 FragColor;
void main()
{
vec3 val[3];
val[0] = texture(halft, uv).xyz;
val[1] = texture(quarter, uv).xyz;
val[2] = texture(eighth, uv).xyz;
// Find the first level with a penumbra value
int i;
float q = 0.0;
float outval = 1.0;
float hasshadow = dot(vec3(1.0), vec3(val[0].z, val[1].z, val[2].z));
if (hasshadow > 0.9)
{
for (i = 0; i < 3; i++)
{
if (val[i].z > 0.9)
{
q = val[i].y;
break;
}
}
q *= 8.0;
q = max(1.0, q);
q = log2(q);
q = min(1.9, q);
// q is now between 0 and 1.9.
int down = int(floor(q));
int up = down + 1;
float interp = q - float(down);
outval = 1.0 - mix(val[down].x, val[up].x, interp);
}
FragColor = vec4(vec3(outval), 1.0);
}

View File

@ -1,71 +0,0 @@
uniform sampler2D ntex;
uniform sampler2D ctex;
uniform vec3 campos;
uniform int low;
in vec3 wpos;
in vec2 texc;
out vec4 FragColor;
float luminanceImp()
{
// A full-res fetch kills on low-end
if (low > 0) return 1.0;
const vec3 weights = vec3(0.2126, 0.7152, 0.0722); // ITU-R BT. 709
vec3 col = texture(ctex, texc).xyz;
float luma = dot(weights, col);
// Dark surfaces need less resolution
float f = smoothstep(0.1, 0.4, luma);
f = max(0.05, f);
return f;
}
float normalImp(vec3 normal)
{
vec3 camdir = normalize(campos - wpos);
vec3 N = normalize(normal);
// Boost surfaces facing the viewer directly
float f = 2.0 * max(0.0, dot(N, camdir));
return f;
}
float depthImp(float linearz)
{
/* const float skip = 0.7;
float f = min(linearz, skip);
f *= 1.0/skip;*/
float z = log(1.0 + linearz * 9.0) / log(10.0);
float f = 1.0 - (z * 0.9);
return f;
}
void main()
{
vec4 ntmp = texture(ntex, texc);
vec3 normal = ntmp.xyz * 2.0 - 1.0;
float linearz = ntmp.a;
float importance = normalImp(normal) * depthImp(linearz) * luminanceImp();
importance = clamp(importance, 0.0, 1.0);
float low = step(0.001, importance);
// Quantize it
const float steps = 16.0;
importance *= steps;
importance = ceil(importance) * low;
importance /= steps;
FragColor = vec4(importance);
gl_FragDepth = 1.0 - importance;
}

View File

@ -1,30 +0,0 @@
uniform sampler2D dtex;
uniform mat4 ipvmat;
uniform mat4 shadowmat;
out vec3 wpos;
out vec2 texc;
float decdepth(vec4 rgba) {
return dot(rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0));
}
void main()
{
texc = gl_Vertex.xy / vec2(32767.0);
float z = decdepth(vec4(texture(dtex, texc).xyz, 0.0));
vec3 tmp = vec3(texc, z);
tmp = tmp * 2.0 - 1.0;
vec4 xpos = vec4(tmp, 1.0);
xpos = ipvmat * xpos;
xpos.xyz /= xpos.w;
wpos = xpos.xyz;
// Now we have this pixel's world-space position. Convert to shadow space.
vec4 pos = shadowmat * vec4(xpos.xyz, 1.0);
gl_Position = pos;
}

View File

@ -1,37 +0,0 @@
uniform sampler2D tex;
uniform int hastex;
uniform int viz;
uniform int wireframe;
uniform float objectid;
in vec2 uv;
out vec4 FragColor;
vec4 encdepth(float v) {
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v;
enc = fract(enc);
enc -= enc.yzww * vec4(1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0);
return enc;
}
void main() {
if (hastex != 0) {
float alpha = texture(tex, uv).a;
if (alpha < 0.5)
discard;
}
if (viz < 1)
{
FragColor = vec4(encdepth(gl_FragCoord.z).xyz, objectid);
}
else {
if (wireframe > 0)
FragColor = vec4(1.0);
else
FragColor = texture(tex, uv);
}
}

View File

@ -1,27 +0,0 @@
uniform sampler2D warpx;
uniform sampler2D warpy;
out vec2 uv;
float decdepth(vec4 rgba) {
return dot(rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0));
}
void main()
{
vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
uv = gl_MultiTexCoord0.xy;
vec2 tc = pos.xy * vec2(0.5) + vec2(0.5);
float movex = decdepth(texture(warpx, tc));
float movey = decdepth(texture(warpy, tc));
float dx = movex * 2.0 - 1.0;
float dy = movey * 2.0 - 1.0;
dx *= 2.0;
dy *= 2.0;
gl_Position = pos + vec4(dx, dy, vec2(0.0));
}

View File

@ -1,56 +0,0 @@
uniform sampler2D tex;
uniform int size;
uniform vec2 pixel;
out vec4 FragColor;
vec4 encdepth(float v) {
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v;
enc = fract(enc);
enc -= enc.yzww * vec4(1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0);
return enc;
}
void main()
{
vec2 origtc = gl_TexCoord[0].xy;
// Get total sum
float first = 1.0, last = 0.0;
float lower = 0.0;
float total = 0.0;
vec2 tc = 0.5 * pixel;
for (int i = 0; i < size; i++)
{
float col = texture(tex, tc).x;
lower += col * step(tc.x, origtc.x);
total += col;
if (col > 0.0001)
{
first = min(first, tc.x);
last = max(last, tc.x);
}
tc += pixel;
}
float res = (lower / total) - origtc.x;
// Outside the edges?
if (origtc.x <= first)
{
res = origtc.x * -2.1;
}
else if (origtc.x >= last)
{
res = (1.0 - origtc.x) * 2.1;
}
res = res * 0.5 + 0.5;
res = clamp(res, 0.01, 0.99);
FragColor = encdepth(res);
}

View File

@ -1,56 +0,0 @@
uniform sampler2D tex;
uniform int size;
uniform vec2 pixel;
out vec4 FragColor;
vec4 encdepth(float v) {
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v;
enc = fract(enc);
enc -= enc.yzww * vec4(1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0);
return enc;
}
void main()
{
vec2 origtc = gl_TexCoord[0].xy;
// Get total sum
float first = 1.0, last = 0.0;
float lower = 0.0;
float total = 0.0;
vec2 tc = pixel * 0.5;
for (int i = 0; i < size; i++)
{
float col = texture(tex, tc).x;
lower += col * step(tc.y, origtc.y);
total += col;
if (col > 0.0001)
{
first = min(first, tc.y);
last = max(last, tc.y);
}
tc += pixel;
}
float res = (lower / total) - origtc.y;
// Outside the edges?
if (origtc.y <= first)
{
res = origtc.y * -2.1;
}
else if (origtc.y >= last)
{
res = (1.0 - origtc.y) * 2.1;
}
res = res * 0.5 + 0.5;
res = clamp(res, 0.01, 0.99);
FragColor = encdepth(res);
}

View File

@ -255,126 +255,6 @@ void SunLightProvider::OnSetConstants(IMaterialRendererServices *srv, int)
//-------------------------------------
void ShadowPassProvider::OnSetConstants(IMaterialRendererServices *srv, int)
{
const int hastex = mat.TextureLayer[0].Texture != NULL;
srv->setVertexShaderConstant("hastex", &hastex, 1);
int viz = irr_driver->getShadowViz();
srv->setVertexShaderConstant("viz", &viz, 1);
int wireframe = mat.Wireframe;
srv->setVertexShaderConstant("wireframe", &wireframe, 1);
float objectid = 0;
if (hastex)
{
const stringc name = mat.TextureLayer[0].Texture->getName().getPath();
objectid = shash8((const u8 *) name.c_str(), name.size()) / 255.0f;
}
srv->setVertexShaderConstant("objectid", &objectid, 1);
//if (!firstdone)
// Can't use the firstdone optimization, as this callback is used for multiple shaders
{
int tex = 0;
srv->setVertexShaderConstant("tex", &tex, 1);
tex = 1;
srv->setVertexShaderConstant("warpx", &tex, 1);
tex = 2;
srv->setVertexShaderConstant("warpy", &tex, 1);
firstdone = true;
}
}
//-------------------------------------
void ShadowImportanceProvider::OnSetConstants(IMaterialRendererServices *srv, int)
{
srv->setVertexShaderConstant("shadowmat", m_shadowmat.pointer(), 16);
srv->setVertexShaderConstant("ipvmat", m_invprojview.pointer(), 16);
srv->setVertexShaderConstant("campos", m_campos, 3);
int low = UserConfigParams::m_shadows == 1;
srv->setVertexShaderConstant("low", &low, 1);
if (!firstdone)
{
int tex = 0;
srv->setVertexShaderConstant("ntex", &tex, 1);
tex = 1;
srv->setVertexShaderConstant("dtex", &tex, 1);
tex = 2;
srv->setVertexShaderConstant("ctex", &tex, 1);
firstdone = true;
}
}
//-------------------------------------
void CollapseProvider::OnSetConstants(IMaterialRendererServices *srv, int)
{
srv->setVertexShaderConstant("pixel", m_pixel, 2);
srv->setVertexShaderConstant("multi", m_multi, 2);
srv->setVertexShaderConstant("size", &m_size, 1);
//if (!firstdone)
// Can't use the firstdone optimization, as this callback is used for multiple shaders
{
int tex = 0;
srv->setVertexShaderConstant("tex", &tex, 1);
tex = 1;
srv->setVertexShaderConstant("oldtex", &tex, 1);
firstdone = true;
}
}
//-------------------------------------
void MultiplyProvider::OnSetConstants(IMaterialRendererServices *srv, int)
{
if (!firstdone)
{
int tex = 0;
srv->setVertexShaderConstant("tex1", &tex, 1);
tex = 1;
srv->setVertexShaderConstant("tex2", &tex, 1);
firstdone = true;
}
}
//-------------------------------------
void ShadowGenProvider::OnSetConstants(IMaterialRendererServices *srv, int)
{
if (!firstdone)
{
int tex = 0;
srv->setVertexShaderConstant("halft", &tex, 1);
tex = 1;
srv->setVertexShaderConstant("quarter", &tex, 1);
tex = 2;
srv->setVertexShaderConstant("eighth", &tex, 1);
firstdone = true;
}
}
//-------------------------------------
void DisplaceProvider::OnSetConstants(IMaterialRendererServices *srv, int)
{

View File

@ -426,98 +426,6 @@ private:
//
class ShadowPassProvider: public CallBase
{
public:
virtual void OnSetConstants(video::IMaterialRendererServices *srv, int);
};
//
class ShadowImportanceProvider: public CallBase
{
public:
virtual void OnSetConstants(video::IMaterialRendererServices *srv, int);
void updateIPVMatrix()
{
// Update the IPV matrix, only once per frame since it's costly
const video::IVideoDriver * const drv = irr_driver->getVideoDriver();
const core::vector3df &campos =
irr_driver->getSceneManager()->getActiveCamera()->getAbsolutePosition();
m_campos[0] = campos.X;
m_campos[1] = campos.Y;
m_campos[2] = campos.Z;
m_invprojview = drv->getTransform(video::ETS_PROJECTION);
m_invprojview *= drv->getTransform(video::ETS_VIEW);
m_invprojview.makeInverse();
}
void setShadowMatrix(const core::matrix4 &mat)
{
m_shadowmat = mat;
}
private:
core::matrix4 m_invprojview, m_shadowmat;
float m_campos[3];
};
//
class CollapseProvider: public CallBase
{
public:
virtual void OnSetConstants(video::IMaterialRendererServices *srv, int);
void setResolution(const int x, const int y)
{
m_pixel[0] = 1.0f / x;
m_pixel[1] = 1.0f / y;
m_multi[0] = m_multi[1] = 1;
if (x < 2 || y < 2)
{
u32 i;
for (i = 0; i < 2; i++)
{
// No increase for the other direction
if (m_pixel[i] > 0.9f) m_pixel[i] = m_multi[i] = 0;
}
std::swap(m_multi[0], m_multi[1]);
}
m_size = (int)std::max(x, y);
}
private:
float m_pixel[2];
int m_size;
float m_multi[2];
};
//
class MultiplyProvider: public CallBase
{
public:
virtual void OnSetConstants(video::IMaterialRendererServices *srv, int);
};
//
class ShadowGenProvider: public CallBase
{
public:
virtual void OnSetConstants(video::IMaterialRendererServices *srv, int);
};
//
class DisplaceProvider: public CallBase
{
public:

View File

@ -477,7 +477,6 @@ void IrrDriver::initDevice()
if(m_glsl)
{
m_shaders = new Shaders();
m_shadow_importance = new ShadowImportance();
m_mrt.clear();
m_mrt.reallocate(2);

View File

@ -202,8 +202,6 @@ private:
float m_lwhite;
/** RTTs. */
RTT *m_rtts;
/** Shadow importance. */
ShadowImportance *m_shadow_importance;
std::vector<core::matrix4> sun_ortho_matrix;
/** Additional details to be shown in case that a texture is not found.

View File

@ -42,11 +42,6 @@ Shaders::Shaders()
m_callbacks[ES_MIPVIZ] = new MipVizProvider();
m_callbacks[ES_COLORIZE] = new ColorizeProvider();
m_callbacks[ES_SUNLIGHT] = new SunLightProvider();
m_callbacks[ES_SHADOWPASS] = new ShadowPassProvider();
m_callbacks[ES_SHADOW_IMPORTANCE] = new ShadowImportanceProvider();
m_callbacks[ES_COLLAPSE] = new CollapseProvider();
m_callbacks[ES_MULTIPLY_ADD] = new MultiplyProvider();
m_callbacks[ES_SHADOWGEN] = new ShadowGenProvider();
m_callbacks[ES_DISPLACE] = new DisplaceProvider();
for (s32 i = 0; i < ES_COUNT; i++)
@ -212,9 +207,6 @@ void Shaders::loadShaders()
m_shaders[ES_BUBBLES] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_BUBBLES], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_shaders[ES_RAIN] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_RAIN], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_shaders[ES_MOTIONBLUR] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_MOTIONBLUR]);
@ -236,29 +228,6 @@ void Shaders::loadShaders()
m_shaders[ES_SUNLIGHT] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_SHADOWPASS] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_SHADOWPASS]);
m_shaders[ES_SHADOW_IMPORTANCE] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_SHADOW_IMPORTANCE]);
m_shaders[ES_COLLAPSE] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_COLLAPSE]);
m_shaders[ES_SHADOW_WARPH] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_COLLAPSE]);
m_shaders[ES_SHADOW_WARPV] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_COLLAPSE]);
m_shaders[ES_MULTIPLY_ADD] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_MULTIPLY_ADD], EMT_ONETEXTURE_BLEND);
m_shaders[ES_PENUMBRAH] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_GAUSSIAN3H], EMT_SOLID);
m_shaders[ES_PENUMBRAV] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_GAUSSIAN3H], EMT_SOLID);
m_shaders[ES_SHADOWGEN] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_SHADOWGEN], EMT_SOLID);
m_shaders[ES_DISPLACE] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_DISPLACE]);

View File

@ -889,7 +889,6 @@ public:
ACT(ES_GRASS) \
ACT(ES_GRASS_REF) \
ACT(ES_BUBBLES) \
ACT(ES_RAIN) \
ACT(ES_MOTIONBLUR) \
ACT(ES_GAUSSIAN3H) \
ACT(ES_GAUSSIAN3V) \
@ -900,15 +899,6 @@ public:
ACT(ES_OBJECTPASS_REF) \
ACT(ES_SUNLIGHT) \
ACT(ES_OBJECTPASS_RIMLIT) \
ACT(ES_SHADOWPASS) \
ACT(ES_SHADOW_IMPORTANCE) \
ACT(ES_COLLAPSE) \
ACT(ES_SHADOW_WARPH) \
ACT(ES_SHADOW_WARPV) \
ACT(ES_MULTIPLY_ADD) \
ACT(ES_PENUMBRAH) \
ACT(ES_PENUMBRAV) \
ACT(ES_SHADOWGEN) \
ACT(ES_DISPLACE) \
ACT(ES_PASSFAR) \

View File

@ -1,168 +0,0 @@
//
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2013 Lauri Kasanen
//
// 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.
#include "config/user_config.hpp"
#include "graphics/glwrap.hpp"
#include "graphics/irr_driver.hpp"
#include "graphics/large_mesh_buffer.hpp"
#include "graphics/material_manager.hpp"
#include "graphics/material.hpp"
#include "graphics/per_camera_node.hpp"
#include "graphics/shadow_importance.hpp"
#include "graphics/shaders.hpp"
#include "graphics/rtts.hpp"
#include "utils/vs.hpp"
#include <ISceneManager.h>
using namespace video;
using namespace scene;
using namespace core;
// The actual ShadowImportance node
class ShadowImportanceNode: public scene::ISceneNode
{
public:
ShadowImportanceNode(scene::ISceneManager* mgr)
: scene::ISceneNode(0, mgr, -1)
{
mat.Lighting = false;
mat.ZWriteEnable = false;
mat.MaterialType = irr_driver->getShader(ES_SHADOW_IMPORTANCE);
// mat.setTexture(0, irr_driver->getRTT(RTT_NORMAL_AND_DEPTH));
// mat.setTexture(2, irr_driver->getRTT(RTT_COLOR));
mat.setFlag(EMF_BILINEAR_FILTER, false);
u32 i;
for (i = 0; i < MATERIAL_MAX_TEXTURES; i++)
{
mat.TextureLayer[i].TextureWrapU =
mat.TextureLayer[i].TextureWrapV = ETC_CLAMP_TO_EDGE;
}
// Low shadows only back-project every other pixel
const u32 incr = UserConfigParams::m_shadows < 2 ? 2 : 1;
count = (UserConfigParams::m_width * UserConfigParams::m_height) / (incr * incr);
// Fill in the mesh buffer
buf.Vertices.clear();
buf.Indices.clear();
buf.Vertices.set_used(count);
buf.Indices.set_used(count);
buf.Primitive = EPT_POINTS;
buf.setHardwareMappingHint(EHM_STATIC);
const float halfx = 0.5f / UserConfigParams::m_width;
const float halfy = 0.5f / UserConfigParams::m_height;
list = glGenLists(1);
s32 x, y;
i = 0;
glNewList(list, GL_COMPILE);
glBegin(GL_POINTS);
for (x = 0; x < UserConfigParams::m_width; x += incr)
{
const float xpos = ((float) x) / UserConfigParams::m_width + halfx;
for (y = 0; y < UserConfigParams::m_height; y += incr)
{
const float ypos = ((float) y) / UserConfigParams::m_height + halfy;
buf.Indices[i] = i;
buf.Vertices[i] = S3DVertex(xpos, ypos, 0, 0, 0, 0,
SColor(255, 255, 255, 255), 0, 0);
glVertex2s((int)roundf(xpos * 32767), (int)roundf(ypos * 32767));
i++;
}
}
glEnd();
glEndList();
box.addInternalPoint(vector3df(-1));
box.addInternalPoint(vector3df(1));
}
~ShadowImportanceNode()
{
}
virtual void render()
{
IVideoDriver * const drv = irr_driver->getVideoDriver();
drv->setMaterial(mat);
drv->setTransform(ETS_WORLD, IdentityMatrix);
// drv->drawMeshBuffer(&buf);
// Setup the env for drawing our list by drawing one point
drv->drawVertexPrimitiveList(buf.getVertices(), 1, buf.getIndices(), 1,
EVT_STANDARD, EPT_POINTS);
glCallList(list);
}
virtual const core::aabbox3d<f32>& getBoundingBox() const
{
return box;
}
virtual void OnRegisterSceneNode()
{
ISceneNode::OnRegisterSceneNode();
}
virtual u32 getMaterialCount() const { return 1; }
virtual video::SMaterial& getMaterial(u32 i) { return mat; }
private:
video::SMaterial mat;
core::aabbox3d<f32> box;
u32 count;
GLuint list;
scene::LargeMeshBuffer buf;
};
// The ShadowImportance manager
ShadowImportance::ShadowImportance()
{
m_node = new ShadowImportanceNode(irr_driver->getSceneManager());
m_node->setAutomaticCulling(0);
} // ShadowImportance
// ----------------------------------------------------------------------------
ShadowImportance::~ShadowImportance()
{
m_node->drop(); // drop STK's reference
m_node->remove(); // Then remove it from the scene graph.
}
// ----------------------------------------------------------------------------
void ShadowImportance::render()
{
m_node->render();
}

View File

@ -1,41 +0,0 @@
//
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2013 Lauri Kasanen
//
// 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.
#ifndef HEADER_SHADOW_IMPORTANCE_HPP
#define HEADER_SHADOW_IMPORTANCE_HPP
#include <vector3d.h>
namespace irr
{
namespace video { class SMaterial; class ITexture; }
namespace scene { class ICameraSceneNode; class ISceneNode; }
}
using namespace irr;
class ShadowImportance
{
scene::ISceneNode *m_node;
public:
ShadowImportance();
~ShadowImportance();
void render();
};
#endif