/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx 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 2, or (at your option) any later version. ### File Specific: main-programmer: Silvan Nellen co-programmer: ... */ //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ #include "heat_haze_manager.h" #include "resource_shader.h" ObjectListDefinition(HeatHazeManager); /** * the constructor * */ HeatHazeManager::HeatHazeManager () { this->registerObject(this, HeatHazeManager::_objectList); this->init(); } /** * standard deconstructor */ HeatHazeManager::~HeatHazeManager () { } /** * initialise the heathaze manager */ void HeatHazeManager::init () { this->heatShader = ResourceShader( "shaders/heat_haze.vert", "shaders/heat_haze.frag"); this->heatShader.activateShader(); Shader::Uniform(heatShader, "ParticlesShot").set(0); Shader::Uniform(heatShader, "FinalRender").set(1); parameters = new Shader::Uniform(heatShader, "parameters"); //parameters->set(1.0f/offScreenWidth, 1.0f/offScreenHeight, scale, scale); this->heatShader.deactivateShader(); } /** * Get the mask of all heat particles */ void HeatHazeManager::acquireMask() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); for (ObjectList::const_iterator it = HeatParticles::objectList().begin(); it != HeatParticles::objectList().end(); ++it) { //TODO: Let all the HeatParticles draw the particles in a temporary buffer (texture unit 1) } // TODO: Copy the current framebuffer into a texture (particleMask) //particleMask. } /** * Apply the disortion effect to the frame */ void HeatHazeManager::apply() { }