Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 25, 2006, 12:10:07 PM (18 years ago)
Author:
bensch
Message:

Switching to new Shader layout, with Shader and ShaderData. Shaders do not render for the time being

Location:
branches/new_class_id/src/world_entities/weather_effects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/world_entities/weather_effects/cloud_effect.cc

    r9760 r9818  
    7676    if (glIsTexture(noise3DTexName))
    7777        glDeleteTextures(1, &noise3DTexName);
    78 
    79     delete shader;
    8078}
    8179
     
    122120    this->skydome->setTexture(noise3DTexName);
    123121
    124     this->shader = new Shader(ResourceManager::getInstance()->getDataDir() + "/shaders/cloud.vert",
     122    this->shader = Shader(ResourceManager::getInstance()->getDataDir() + "/shaders/cloud.vert",
    125123                              ResourceManager::getInstance()->getDataDir() + "/shaders/cloud.frag");
    126124
    127     this->shader->activateShader();
     125    this->shader.activateShader();
    128126
    129127    Shader::Uniform(shader, "Noise").set(0);
     
    133131    this->cloudcolor = new Shader::Uniform(shader, "CloudColor");
    134132
    135     this->shader->deactivateShader();
    136 
    137     this->skydome->setShader(shader);
     133    this->shader.deactivateShader();
     134
     135    this->skydome->setShader(&shader);
    138136}
    139137
     
    163161
    164162    // Can only be set after the loadParams call
    165     this->shader->activateShader();
     163    this->shader.activateShader();
    166164    Shader::Uniform(shader, "Scale").set(this->scale);
    167165    this->skycolor->set
     
    169167    this->cloudcolor->set
    170168    (cloudColor.x, cloudColor.y, cloudColor.z);
    171     this->shader->deactivateShader();
     169    this->shader.deactivateShader();
    172170
    173171    this->skydome->generateSkyPlane(this->divs, this->planetRadius, this->atmosphericRadius, 1, 1);
     
    192190        this->offsetZ += 0.05 * dt * this->animationSpeed;
    193191
    194         this->shader->activateShader();
     192        this->shader.activateShader();
    195193        this->offset->set
    196194        (0.0f, 0.0f, offsetZ);
     
    258256        }
    259257
    260         this->shader->deactivateShader();
     258        this->shader.deactivateShader();
    261259    }
    262260}
  • branches/new_class_id/src/world_entities/weather_effects/cloud_effect.h

    r9760 r9818  
    143143
    144144    // SHADER STUFF
    145     Shader*          shader;
     145    Shader           shader;
    146146    Shader::Uniform* offset;
    147147    Shader::Uniform* skycolor;
Note: See TracChangeset for help on using the changeset viewer.