Last change
on this file since 3464 was
2956,
checked in by ldelgass, 12 years ago
|
First batch of converting shaders to use new parameter support in NvShader?.
|
-
Property svn:eol-style set to
native
|
File size:
674 bytes
|
Line | |
---|
1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | #include "NvColorTableShader.h" |
---|
3 | |
---|
4 | NvColorTableShader::NvColorTableShader() |
---|
5 | { |
---|
6 | init(); |
---|
7 | } |
---|
8 | |
---|
9 | NvColorTableShader::~NvColorTableShader() |
---|
10 | { |
---|
11 | } |
---|
12 | |
---|
13 | void NvColorTableShader::init() |
---|
14 | { |
---|
15 | loadFragmentProgram("one_plane.cg", "main"); |
---|
16 | } |
---|
17 | |
---|
18 | void NvColorTableShader::bind(Texture2D *plane, TransferFunction *tf) |
---|
19 | { |
---|
20 | setFPTextureParameter("data", plane->id()); |
---|
21 | setFPTextureParameter("tf", tf->id()); |
---|
22 | |
---|
23 | setFPParameter4f("render_param", 0., 0., 0., 0.); |
---|
24 | |
---|
25 | NvShader::bind(); |
---|
26 | } |
---|
27 | |
---|
28 | void NvColorTableShader::unbind() |
---|
29 | { |
---|
30 | disableFPTextureParameter("data"); |
---|
31 | disableFPTextureParameter("tf"); |
---|
32 | |
---|
33 | NvShader::unbind(); |
---|
34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.