|
FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
|
The CarpetAnemone handles a colormap attached to an Anemone. More...
#include <CarpetAnemone.hpp>
Classes | |
| struct | ColormapTexture |
| A ColormapTexture object is an interface that allows to remember a set of textures. More... | |
Public Types | |
| template<class T , int EL = VSlotContainer::InvalidExpertLevel> | |
| using | in_t = VObject::in< T, EL > |
Public Member Functions | |
| CarpetAnemone (VObject *that, const string &slotname="colormap", int EL=0) | |
| std::string | scalarfield_vertex_shader (VRenderContext &Context) const |
Public Member Functions inherited from Wizt::Colorizer | |
| Colorizer (VObject *that, const string &slotname="colormap", int EL=0) | |
| MemCore::RefPtr< RenderBasin::TextureTentacle > | createColormapTexture (VRenderContext &Context, int TextureUnit, const MemCore::RefPtr< RenderBasin::TextureTentacle > &OldTT=NullPtr(), bool IntegerTexture=false) const |
| bool | haveNewerColormap (VRenderContext &Context, const Ageable &) const |
| MemCore::RefPtr< RenderBasin::TextureTentacle > | makeColormapTexture (VRenderContext &Context, const RefPtr< RenderBasin::Program > &ShaderProgram, int TextureUnit, const string &ShaderTexturename="", bool IntegerTexture=false) const |
Public Attributes | |
| VObject::in< bool > | inUseLocalBoundingBoxForHeightRange |
The CarpetAnemone handles a colormap attached to an Anemone.
Carpet anemones: Beautiful, fragile, and deadly
Anemones of the genus Stichodactyla are some of the most colorful inverts in the sea, but they're also notoriously poor shippers, and those that do survive their trek from sea to aquarium can turn out to be deadly additions to your reef. Leonard Ho http://www.advancedaquarist.com/blog/carpet-anemones-beautiful-but-deadly
To check whether the colormap has changed and the render Anemone needs to be updated, use code like this (note that updating just the colormap instead of re-creating the Anemone yet has to be implemented - 12SEP14):
Optionally, an additional colormap input slot can be checked by specifying this slot:
To use and possibly create a default color map, override the setup() function in a derived class an implement like this:
|
static |
In the shader code the color map will be accessible under the name that
we define here. In the GLSL code it will then be named as
@code
uniform sampler1D Colormap;
@endcode
and can be accessed via
@code
vec4 Color = texture1D( Colormap, 0.5 );
@endode
where the floating point value is any number between zero and one.
To be called from GridAnemone::initializeAnemone() or a child class,
for instance feedAnemone() as called by SkeletonRenderer and kids.
/
RefPtr<RenderBasin::TextureTentacle>
createColormapTexture(Anemone&RenderAnemone,
VRenderContext&Context,
AnemoneCreatorBase&AC,
int ColormapTextureUnit = 0,
const std::string&ColorMapShaderName = "Colormap"
) const;
RefPtr<RenderBasin::TextureTentacle>
createColormapTexture(Anemone&RenderAnemone,
const GridAnemone::AnemoneCreationContext&ACC,
int ColormapTextureUnit = 0,
const std::string&ColorMapShaderName = "Colormap"
) const;
/**
Normalization of height values according to a given explicit
range or, without such availability, using the height of the
current bounding box of the rendering object.
This function couples an input range to a shader variable of
type vec2, which allows to scale a height value into normalized
[0,1] range by using the following expression: