source: nanovis/branches/1.1/ColorTableShader.cpp

Last change on this file was 4904, checked in by ldelgass, 5 years ago

Merge serveral changes from trunk. Does not include threading, world space
changes, etc.

  • Property svn:eol-style set to native
File size: 729 bytes
RevLine 
[2798]1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
[3502]2/*
3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 *
5 */
[3612]6#include "ColorTableShader.h"
[580]7
[3611]8using namespace nv;
9
[3612]10ColorTableShader::ColorTableShader()
[580]11{
12    init();
13}
14
[3612]15ColorTableShader::~ColorTableShader()
[580]16{
17}
18
[3612]19void ColorTableShader::init()
[580]20{
[4904]21    loadFragmentProgram("one_plane.cg"); 
[580]22}
[2859]23
[3612]24void ColorTableShader::bind(Texture2D *plane, TransferFunction *tf)
[2859]25{
[2956]26    setFPTextureParameter("data", plane->id());
27    setFPTextureParameter("tf", tf->id());
[2859]28
[2956]29    setFPParameter4f("render_param", 0., 0., 0., 0.);
30
[3612]31    Shader::bind();
[2859]32}
33
[3612]34void ColorTableShader::unbind()
[2859]35{
[2956]36    disableFPTextureParameter("data");
37    disableFPTextureParameter("tf");
[2914]38
[3612]39    Shader::unbind();
[2859]40}
Note: See TracBrowser for help on using the repository browser.