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 | |
---|
8 | using namespace nv; |
---|
9 | |
---|
10 | ColorTableShader::ColorTableShader() |
---|
11 | { |
---|
12 | init(); |
---|
13 | } |
---|
14 | |
---|
15 | ColorTableShader::~ColorTableShader() |
---|
16 | { |
---|
17 | } |
---|
18 | |
---|
19 | void ColorTableShader::init() |
---|
20 | { |
---|
21 | loadFragmentProgram("one_plane.cg", "main"); |
---|
22 | } |
---|
23 | |
---|
24 | void 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 | |
---|
34 | void ColorTableShader::unbind() |
---|
35 | { |
---|
36 | disableFPTextureParameter("data"); |
---|
37 | disableFPTextureParameter("tf"); |
---|
38 | |
---|
39 | Shader::unbind(); |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.