Display a triangular surface as transparent object with a pretty shader using conventional depth-sorting (NOT depth-peeling).
#include <ocean/GLvish/VGLRenderObject.hpp>
#include <ocean/GLvish/BoundingBox.hpp>
#include <ocean/GLvish/ArrayTypes.hpp>
#include <ocean/GLvish/colors.hpp>
#include <ocean/shrimp/VObjectStatus.hpp>
#include <eagle/PhysicalSpace.hpp>
#include <field/Cell.hpp>
#include <GL/fiberGL.hpp>
#include <baseop/ExpandBBox.hpp>
#include <eye/retina/VSkeletonRenderObject.hpp>
#include <grid/types/TriangularSurface.hpp>
#include <bundle/BundleProperty.hpp>
#include <bone/GridActor.hpp>
#include <GL/PartialElementRenderer.hpp>
#include <GLvish/Programmable.hpp>
namespace
{
{
public:
using glsl = RenderNamespace::glsl;
{
#embed "CrystalSurface.vert"
} );
}
{
#embed "CrystalSurface.frag"
} );
}
{
using TriangularSurface::operator=;
};
{
return new MyState();
}
SurfaceBackColor;
Alpha,
Colority;
, SurfaceColor(this, "color", {1.,.1,1., 1.0},0)
, SurfaceBackColor(this, "backcolor", {.0, 1.,1.0, 1.0},0)
, Transparency(this, "transparency", 0.5, 0)
, Alpha(this, "alpha", 1.0, 2)
, Colority(this, "colorness", 0.5, 1)
{}
bool update(
VRequest&R,
double precision)
override;
static string createChildname(
const string&
parent_name)
{
}
};
{
if (!G)
{
return setStatusError(
Context,
"No Grid found.");
}
*S = G;
if (!*S)
return setStatusError(
Context,
"No surface available.");
setBoundingBall(
Context, getBoundingBox( S->CoordField ) );
return setStatusInfo(
Context,
"Surface ready to render.");
}
{
{
assert( Cells->getTypedStorage() );
}
{
}
{
}
};
{
if (!myState)
return false;
return false;
{
printf("Did not find coordinates :( \n");
return false;
}
{
printf("Did not find triangles :( \n");
return false;
}
{
double Alpha = 0.5;
}
MyProgram->use();
try
{
{
{
{
return true;
}
}
}
}
{}
{
}
return true;
}
}
namespace
{
Description(
"Show trianglular surface transparently, emphasizing the outline regions." ) +
Url(
"http://vish.fiberbundle.net/wiki" ),
ObjectQuality::OUTDATED );
}
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 objects that render information given on the triangle of a Grid.
Definition TriangleRenderer.hpp:22
Base class for objects rendering skeletons of a fiber bundle.
Definition VSkeletonRenderObject.hpp:21
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 ...
RenderNamespace::glsl embed_glsl(const char(&file_content)[N])
Definition GridInspector.hpp:13
A triangular surface stored on a Grid.
Definition TriangularSurface.hpp:43
Base class to draw a selection of elements as OpenGL points.
Definition PartialElementRenderer.hpp:85