FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
SplatRenderObject.hpp
1#ifndef __SPLATRENDEROBJECT_HPP
2#define __SPLATRENDEROBJECT_HPP
3
4#include <bone/BundleInput.hpp>
5#include <bone/FishField.hpp>
6
7#include <ocean/GLvish/BoundingBox.hpp>
8#include <ocean/GLvish/Shader.hpp>
9
10#include <eagle/PhysicalSpace.hpp>
11
12#include <ocean/shrimp/VEnum.hpp>
13
14#include <GL/fieldGL.hpp>
15#include <GL/FieldBuffer.hpp>
16#include <GL/PartialElementRenderer.hpp>
17
18#include "fish/pond/eye/retina/VertexRenderObject.hpp"
19#include "fish/pond/eye/retina/Iris.hpp"
20
21namespace Wizt
22{
23
24using namespace Fiber;
25using namespace Eagle;
26
27
41{
42public:
45 TypedSlot<double> sizeOffset;
46
49
52 TypedSlot<double> m_ref_factor;
53
54 TypedSlot<VEnum> renderMode;
55
56 TypedSlot<int> tsStartPoint,
57 tsHowManyPoints;
58
67 SplatRenderObject(const string&name, int p, const RefPtr<VCreationPreferences>&VP,
68 double SizeScale = 150.0,
69 int AnimationVisibility = 5);
70
73
78 {
80
84 enum mode
85 {
92
95
98
99 starlike = accumulative,
100 particles = depthsorted,
101 massive = alphaclamped
102 };
103
104 mode render_mode;
105
111
128
131
132 ~Renderer();
133
134 void prefix() override;
135
141 bool draw() override;
142
143 void postfix() override;
144 };
145
147static const char*DefaultModifySizeFunction;
148
188static string setPointAttenuation(const string&ModifySizeFunction = DefaultModifySizeFunction);
189
208static const char default_vertex_shader[];
209
210 virtual string splat_vertex_shader(VGLRenderContext&Context) const = 0;
211
230static const char default_fragment_shader[];
231
232 virtual string splat_fragment_shader(VGLRenderContext&Context) const = 0;
233
261 virtual void setShaderVariables(VGLRenderContext&Context, const RefPtr<GLProgram>&ShaderProgram) const;
262
268 const RefPtr<FragmentSelector>&FS) const override;
269
273/*
274 virtual void updateRenderer(VRenderContext&Context,
275 const RefPtr<VBO::Renderer>&R,
276 const RefPtr<MemBase>&FieldCoordinates,
277 const RefPtr<FragmentSelector>&FS) const;
278*/
279
281 void setRendererParameters(VGLRenderContext&Context,
284 const RefPtr<GLProgram>&theShaderProgram) const override;
285
286
287/*
288 bool request(VRequest&R, double precision,
289 const WeakVObjectPtr&ImmediateRequestor,
290 const WeakVObjectPtr&RootRequestor) override;
291*/
292
293 bool must_update(const VRequest&, double precision) const override;
294
303 bool renderGL(VGLRenderContext&Context) const override;
304
305 string help(HelpType=HTMLText) const override;
306
310//static string createChildname(const string&parent_name);
311
316 virtual string FragmentShaderPrefix(VRenderContext&) const;
317};
318
319} // namespace Wizt
320
321#endif // __SPLATRENDEROBJECT_HPP
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Base class for render object that draw a splat for each vertex of a Grid object.
Definition SplatRenderObject.hpp:41
TypedSlot< double > AnimationSpeed
Animation control.
Definition SplatRenderObject.hpp:48
TypedSlot< double > MaxSize
The maximal pixel diameter value.
Definition SplatRenderObject.hpp:51
TypedSlot< double > sizeFactor
The exponential scaling factor for the size of the splats.
Definition SplatRenderObject.hpp:44
Base class for object that render data given on vertices.
Definition VertexRenderObject.hpp:113
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
note: cannot derive from FloatingSkeletonRenderer as long as independent base class TriangleRenderer ...
Definition fs/init.hpp:20
Base class to draw a selection of elements as OpenGL points.
Definition PartialElementRenderer.hpp:85
Helper class to generate textures with Gaussian spots (or similar) to be used as a point sprite when ...
Definition Iris.hpp:23
A Vertex Buffer Render object for making splats.
Definition SplatRenderObject.hpp:78
mode
The rendering parameters for the point sets.
Definition SplatRenderObject.hpp:85
@ accumulative_absorption
Do two-pass rendering, absorption first, then emission.
Definition SplatRenderObject.hpp:97
@ alphaclamped
Do rendering via alpha-clamping.
Definition SplatRenderObject.hpp:91
@ depthsorted
Do rendering via depth-sorting (might be slow)
Definition SplatRenderObject.hpp:89
@ alphaToCoverage
Alpha to coverage (dithering)
Definition SplatRenderObject.hpp:94
@ accumulative
Just add colors accumulative.
Definition SplatRenderObject.hpp:87
GLenum AlphaClampMode
Mode for alpha clamping.
Definition SplatRenderObject.hpp:127
double AlphaThreshold
Treshold for alphaclamped mode.
Definition SplatRenderObject.hpp:110