[10214] | 1 | /* |
---|
| 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | |
---|
| 11 | ### File Specific: |
---|
| 12 | main-programmer: Silvan Nellen |
---|
| 13 | co-programmer: ... |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ |
---|
| 17 | |
---|
| 18 | #include "heat_haze_manager.h" |
---|
| 19 | #include "resource_shader.h" |
---|
| 20 | |
---|
| 21 | ObjectListDefinition(HeatHazeManager); |
---|
| 22 | |
---|
| 23 | |
---|
| 24 | /** |
---|
| 25 | * the constructor |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | HeatHazeManager::HeatHazeManager () |
---|
| 29 | { |
---|
| 30 | this->registerObject(this, HeatHazeManager::_objectList); |
---|
[10250] | 31 | this->init(); |
---|
[10214] | 32 | } |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | /** |
---|
| 36 | * standard deconstructor |
---|
| 37 | */ |
---|
| 38 | HeatHazeManager::~HeatHazeManager () |
---|
| 39 | { |
---|
| 40 | |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | /** |
---|
| 45 | * initialise the heathaze manager |
---|
| 46 | */ |
---|
| 47 | void HeatHazeManager::init () |
---|
| 48 | { |
---|
| 49 | this->heatShader = ResourceShader( "shaders/heat_haze.vert", "shaders/heat_haze.frag"); |
---|
| 50 | |
---|
| 51 | this->heatShader.activateShader(); |
---|
[10250] | 52 | Shader::Uniform(heatShader, "ParticlesShot").set(0); |
---|
| 53 | Shader::Uniform(heatShader, "FinalRender").set(1); |
---|
[10214] | 54 | parameters = new Shader::Uniform(heatShader, "parameters"); |
---|
[10250] | 55 | //parameters->set(1.0f/offScreenWidth, 1.0f/offScreenHeight, scale, scale); |
---|
[10214] | 56 | this->heatShader.deactivateShader(); |
---|
| 57 | |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | /** |
---|
| 62 | * Get the mask of all heat particles |
---|
| 63 | */ |
---|
| 64 | void HeatHazeManager::acquireMask() |
---|
| 65 | { |
---|
[10250] | 66 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
---|
| 67 | |
---|
[10214] | 68 | for (ObjectList<HeatParticles>::const_iterator it = HeatParticles::objectList().begin(); |
---|
| 69 | it != HeatParticles::objectList().end(); |
---|
| 70 | ++it) |
---|
| 71 | { |
---|
[10250] | 72 | //TODO: Let all the HeatParticles draw the particles in a temporary buffer (texture unit 1) |
---|
[10214] | 73 | } |
---|
| 74 | |
---|
[10250] | 75 | // TODO: Copy the current framebuffer into a texture (particleMask) |
---|
| 76 | //particleMask. |
---|
[10214] | 77 | } |
---|
| 78 | |
---|
| 79 | /** |
---|
| 80 | * Apply the disortion effect to the frame |
---|
| 81 | */ |
---|
| 82 | void HeatHazeManager::apply() |
---|
| 83 | { |
---|
| 84 | |
---|
| 85 | } |
---|