GPUParticles: Reenable rain, windows build is fixed
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14815 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
df2bd304ab
commit
187abe584b
@ -358,6 +358,7 @@ src/graphics/CBatchingMesh.hpp
|
|||||||
src/graphics/explosion.hpp
|
src/graphics/explosion.hpp
|
||||||
src/graphics/glow.hpp
|
src/graphics/glow.hpp
|
||||||
src/graphics/glwrap.hpp
|
src/graphics/glwrap.hpp
|
||||||
|
src/graphics/gpuparticles.h
|
||||||
src/graphics/hardware_skinning.hpp
|
src/graphics/hardware_skinning.hpp
|
||||||
src/graphics/hit_effect.hpp
|
src/graphics/hit_effect.hpp
|
||||||
src/graphics/hit_sfx.hpp
|
src/graphics/hit_sfx.hpp
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#if 0
|
|
||||||
#include "graphics/irr_driver.hpp"
|
#include "graphics/irr_driver.hpp"
|
||||||
#include "gpuparticles.h"
|
#include "gpuparticles.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@ -6,9 +5,48 @@
|
|||||||
#include "config/user_config.hpp"
|
#include "config/user_config.hpp"
|
||||||
#include <ICameraSceneNode.h>
|
#include <ICameraSceneNode.h>
|
||||||
|
|
||||||
|
#ifdef _IRR_WINDOWS_API_
|
||||||
|
#define IRR_OGL_LOAD_EXTENSION(X) wglGetProcAddress(reinterpret_cast<const char*>(X))
|
||||||
|
|
||||||
|
|
||||||
|
PFNGLGENTRANSFORMFEEDBACKSPROC glGenTransformFeedbacks;
|
||||||
|
PFNGLBINDTRANSFORMFEEDBACKPROC glBindTransformFeedback;
|
||||||
|
PFNGLDRAWTRANSFORMFEEDBACKPROC glDrawTransformFeedback;
|
||||||
|
PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback;
|
||||||
|
PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback;
|
||||||
|
PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings;
|
||||||
|
PFNGLBINDBUFFERBASEPROC glBindBufferBase;
|
||||||
|
PFNGLGENBUFFERSPROC glGenBuffers;
|
||||||
|
PFNGLBINDBUFFERPROC glBindBuffer;
|
||||||
|
PFNGLBUFFERDATAPROC glBufferData;
|
||||||
|
PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;
|
||||||
|
PFNGLCREATESHADERPROC glCreateShader;
|
||||||
|
PFNGLCOMPILESHADERPROC glCompileShader;
|
||||||
|
PFNGLSHADERSOURCEPROC glShaderSource;
|
||||||
|
PFNGLCREATEPROGRAMPROC glCreateProgram;
|
||||||
|
PFNGLATTACHSHADERPROC glAttachShader;
|
||||||
|
PFNGLLINKPROGRAMPROC glLinkProgram;
|
||||||
|
PFNGLUSEPROGRAMPROC glUseProgram;
|
||||||
|
PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray;
|
||||||
|
PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray;
|
||||||
|
PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
|
||||||
|
PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv;
|
||||||
|
PFNGLUNIFORM1FPROC glUniform1f;
|
||||||
|
PFNGLUNIFORM3FPROC glUniform3f;
|
||||||
|
PFNGLDELETESHADERPROC glDeleteShader;
|
||||||
|
PFNGLGETSHADERIVPROC glGetShaderiv;
|
||||||
|
PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
|
||||||
|
PFNGLACTIVETEXTUREPROC glActiveTexture;
|
||||||
|
PFNGLUNIFORM2FPROC glUniform2f;
|
||||||
|
PFNGLUNIFORM1IPROC glUniform1i;
|
||||||
|
PFNGLGETPROGRAMIVPROC glGetProgramiv;
|
||||||
|
PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;
|
||||||
|
#endif
|
||||||
|
|
||||||
void initGL()
|
void initGL()
|
||||||
{
|
{
|
||||||
/* glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)IRR_OGL_LOAD_EXTENSION("glGenTransformFeedbacks");
|
#ifdef _IRR_WINDOWS_API_
|
||||||
|
glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)IRR_OGL_LOAD_EXTENSION("glGenTransformFeedbacks");
|
||||||
glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)IRR_OGL_LOAD_EXTENSION("glBindTransformFeedback");
|
glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)IRR_OGL_LOAD_EXTENSION("glBindTransformFeedback");
|
||||||
glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)IRR_OGL_LOAD_EXTENSION("glDrawTransformFeedback");
|
glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)IRR_OGL_LOAD_EXTENSION("glDrawTransformFeedback");
|
||||||
glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)IRR_OGL_LOAD_EXTENSION("glBeginTransformFeedback");
|
glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)IRR_OGL_LOAD_EXTENSION("glBeginTransformFeedback");
|
||||||
@ -34,14 +72,13 @@ void initGL()
|
|||||||
glDeleteShader = (PFNGLDELETESHADERPROC)IRR_OGL_LOAD_EXTENSION("glDeleteShader");
|
glDeleteShader = (PFNGLDELETESHADERPROC)IRR_OGL_LOAD_EXTENSION("glDeleteShader");
|
||||||
glGetShaderiv = (PFNGLGETSHADERIVPROC)IRR_OGL_LOAD_EXTENSION("glGetShaderiv");
|
glGetShaderiv = (PFNGLGETSHADERIVPROC)IRR_OGL_LOAD_EXTENSION("glGetShaderiv");
|
||||||
glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)IRR_OGL_LOAD_EXTENSION("glGetShaderInfoLog");
|
glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)IRR_OGL_LOAD_EXTENSION("glGetShaderInfoLog");
|
||||||
#ifdef _IRR_WINDOWS_API_
|
|
||||||
glActiveTexture = (PFNGLACTIVETEXTUREPROC)IRR_OGL_LOAD_EXTENSION("glActiveTexture");
|
glActiveTexture = (PFNGLACTIVETEXTUREPROC)IRR_OGL_LOAD_EXTENSION("glActiveTexture");
|
||||||
#endif
|
|
||||||
glUniform2f = (PFNGLUNIFORM2FPROC)IRR_OGL_LOAD_EXTENSION("glUniform2f");
|
glUniform2f = (PFNGLUNIFORM2FPROC)IRR_OGL_LOAD_EXTENSION("glUniform2f");
|
||||||
glUniform1i = (PFNGLUNIFORM1IPROC)IRR_OGL_LOAD_EXTENSION("glUniform1i");
|
glUniform1i = (PFNGLUNIFORM1IPROC)IRR_OGL_LOAD_EXTENSION("glUniform1i");
|
||||||
glGetProgramiv = (PFNGLGETPROGRAMIVPROC)IRR_OGL_LOAD_EXTENSION("glGetProgramiv");
|
glGetProgramiv = (PFNGLGETPROGRAMIVPROC)IRR_OGL_LOAD_EXTENSION("glGetProgramiv");
|
||||||
glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)IRR_OGL_LOAD_EXTENSION("glGetProgramInfoLog");
|
glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)IRR_OGL_LOAD_EXTENSION("glGetProgramInfoLog");
|
||||||
glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)IRR_OGL_LOAD_EXTENSION("glTransformFeedbackVaryings");*/
|
glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)IRR_OGL_LOAD_EXTENSION("glTransformFeedbackVaryings");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mostly from shader tutorial
|
// Mostly from shader tutorial
|
||||||
@ -207,4 +244,3 @@ void GPUParticle::render() {
|
|||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@ -1,54 +1,12 @@
|
|||||||
#if 0
|
|
||||||
#ifndef GPUPARTICLES_H
|
#ifndef GPUPARTICLES_H
|
||||||
#define GPUPARTICLES_H
|
#define GPUPARTICLES_H
|
||||||
|
|
||||||
|
#ifndef _IRR_WINDOWS_API_
|
||||||
#define GL_GLEXT_PROTOTYPES 1
|
#define GL_GLEXT_PROTOTYPES 1
|
||||||
|
#endif
|
||||||
#include "graphics/glwrap.hpp"
|
#include "graphics/glwrap.hpp"
|
||||||
#include <ISceneManager.h>
|
#include <ISceneManager.h>
|
||||||
|
|
||||||
/*#ifdef _IRR_WINDOWS_API_
|
|
||||||
#define IRR_OGL_LOAD_EXTENSION(X) wglGetProcAddress(reinterpret_cast<const char*>(X))
|
|
||||||
#else
|
|
||||||
#include <GL/glx.h>
|
|
||||||
#define IRR_OGL_LOAD_EXTENSION(X) glXGetProcAddress(reinterpret_cast<const GLubyte*>(X))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
PFNGLGENTRANSFORMFEEDBACKSPROC glGenTransformFeedbacks;
|
|
||||||
PFNGLBINDTRANSFORMFEEDBACKPROC glBindTransformFeedback;
|
|
||||||
PFNGLDRAWTRANSFORMFEEDBACKPROC glDrawTransformFeedback;
|
|
||||||
PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback;
|
|
||||||
PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback;
|
|
||||||
PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings;
|
|
||||||
PFNGLBINDBUFFERBASEPROC glBindBufferBase;
|
|
||||||
PFNGLGENBUFFERSPROC glGenBuffers;
|
|
||||||
PFNGLBINDBUFFERPROC glBindBuffer;
|
|
||||||
PFNGLBUFFERDATAPROC glBufferData;
|
|
||||||
PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;
|
|
||||||
PFNGLCREATESHADERPROC glCreateShader;
|
|
||||||
PFNGLCOMPILESHADERPROC glCompileShader;
|
|
||||||
PFNGLSHADERSOURCEPROC glShaderSource;
|
|
||||||
PFNGLCREATEPROGRAMPROC glCreateProgram;
|
|
||||||
PFNGLATTACHSHADERPROC glAttachShader;
|
|
||||||
PFNGLLINKPROGRAMPROC glLinkProgram;
|
|
||||||
PFNGLUSEPROGRAMPROC glUseProgram;
|
|
||||||
PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray;
|
|
||||||
PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray;
|
|
||||||
PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
|
|
||||||
PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv;
|
|
||||||
PFNGLUNIFORM1FPROC glUniform1f;
|
|
||||||
PFNGLUNIFORM3FPROC glUniform3f;
|
|
||||||
PFNGLDELETESHADERPROC glDeleteShader;
|
|
||||||
PFNGLGETSHADERIVPROC glGetShaderiv;
|
|
||||||
PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
|
|
||||||
#ifdef _IRR_WINDOWS_API_
|
|
||||||
PFNGLACTIVETEXTUREPROC glActiveTexture;
|
|
||||||
#endif
|
|
||||||
PFNGLUNIFORM2FPROC glUniform2f;
|
|
||||||
PFNGLUNIFORM1IPROC glUniform1i;
|
|
||||||
PFNGLGETPROGRAMIVPROC glGetProgramiv;
|
|
||||||
PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;*/
|
|
||||||
|
|
||||||
void initGL();
|
void initGL();
|
||||||
GLuint LoadProgram(const char * vertex_file_path, const char * fragment_file_path);
|
GLuint LoadProgram(const char * vertex_file_path, const char * fragment_file_path);
|
||||||
GLuint LoadTFBProgram(const char * vertex_file_path, const char **varyings, unsigned varyingscount);
|
GLuint LoadTFBProgram(const char * vertex_file_path, const char **varyings, unsigned varyingscount);
|
||||||
@ -70,4 +28,3 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // GPUPARTICLES_H
|
#endif // GPUPARTICLES_H
|
||||||
#endif
|
|
||||||
|
@ -42,7 +42,7 @@ using namespace core;
|
|||||||
class RainNode: public scene::ISceneNode
|
class RainNode: public scene::ISceneNode
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
// GPUParticle *gpupart;
|
GPUParticle *gpupart;
|
||||||
public:
|
public:
|
||||||
RainNode(scene::ISceneManager* mgr, ITexture *tex)
|
RainNode(scene::ISceneManager* mgr, ITexture *tex)
|
||||||
: scene::ISceneNode(0, mgr, -1)
|
: scene::ISceneNode(0, mgr, -1)
|
||||||
@ -72,7 +72,7 @@ public:
|
|||||||
vertices[3 * i + 1] = y;
|
vertices[3 * i + 1] = y;
|
||||||
vertices[3 * i + 2] = z;
|
vertices[3 * i + 2] = z;
|
||||||
}
|
}
|
||||||
//gpupart = new GPUParticle(count, vertices, getTextureGLuint(mat.getTexture(0)), getTextureGLuint(irr_driver->getRTT(RTT_NORMAL_AND_DEPTH)));
|
gpupart = new GPUParticle(count, vertices, getTextureGLuint(mat.getTexture(0)), getTextureGLuint(irr_driver->getRTT(RTT_NORMAL_AND_DEPTH)));
|
||||||
|
|
||||||
box.addInternalPoint(vector3df((float)(-area/2)));
|
box.addInternalPoint(vector3df((float)(-area/2)));
|
||||||
box.addInternalPoint(vector3df((float)( area/2)));
|
box.addInternalPoint(vector3df((float)( area/2)));
|
||||||
@ -80,13 +80,13 @@ public:
|
|||||||
|
|
||||||
~RainNode()
|
~RainNode()
|
||||||
{
|
{
|
||||||
// delete gpupart;
|
delete gpupart;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void render()
|
virtual void render()
|
||||||
{
|
{
|
||||||
// gpupart->simulate();
|
gpupart->simulate();
|
||||||
// gpupart->render();
|
gpupart->render();
|
||||||
// We need to force irrlicht to update its internal states
|
// We need to force irrlicht to update its internal states
|
||||||
IVideoDriver * const drv = irr_driver->getVideoDriver();
|
IVideoDriver * const drv = irr_driver->getVideoDriver();
|
||||||
drv->setMaterial(mat);
|
drv->setMaterial(mat);
|
||||||
|
Loading…
Reference in New Issue
Block a user