source: nanovis/trunk/ColorTableShader.cpp @ 4794

Last change on this file since 4794 was 3630, checked in by ldelgass, 7 years ago

Nanovis refactoring to fix problems with scaling and multiple results.
Do rendering in world space to properly place and scale multiple data sets.
Also fix flows to reduce resets of animations. More work toward removing
Cg dependency. Fix panning to convert viewport coords to world coords.

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