10#include "point.frag.h"
14#include <cuda_gl_interop.h>
29 this->
setName(
"point_renderer");
30 this->inColor()->tagOptional(
true);
31 this->varPointSize()->setRange(0.001f, 1.0f);
33 this->varForceUpdate()->setValue(
true);
47 this->varColorMode()->setCurrentKey(mode);
52 mPosition.create(GL_ARRAY_BUFFER, GL_DYNAMIC_DRAW);
53 mColor.create(GL_ARRAY_BUFFER, GL_DYNAMIC_DRAW);
60 POINT_VERT,
sizeof(POINT_VERT),
61 POINT_FRAG,
sizeof(POINT_FRAG));
91 if (this->varColorMode()->currentKey() == ColorMapMode::PER_VERTEX_SHADER
92 && !this->inColor()->isEmpty())
100 glDisableVertexAttribArray(1);
108 auto pPointSet = this->inPointSet()->getDataPtr();
109 auto points = pPointSet->getPoints();
113 if (this->varColorMode()->currentKey() == ColorMapMode::PER_VERTEX_SHADER
114 && !this->inColor()->isEmpty())
116 auto colors = this->inColor()->getData();
131 mShaderProgram->setFloat(
"uPointSize", this->varPointSize()->getValue());
135 mShaderProgram->setFloat(
"uMetallic", this->varMetallic()->getValue());
136 mShaderProgram->setFloat(
"uRoughness", this->varRoughness()->getValue());
145 printf(
"WARNING: GLPointVisualModule does not support transparency!\n");
150 printf(
"Unknown render pass!\n");
155 auto color = this->varBaseColor()->getValue();
156 glVertexAttrib3f(1, color.r, color.g, color.b);
#define IMPLEMENT_CLASS(name)
virtual void updateGL() override
virtual bool initializeGL() override
virtual void paintGL(const RenderParams &rparams) override
virtual void updateImpl() override
void setColorMapMode(ColorMapMode mode)
XBuffer< Vec3f > mPosition
virtual void releaseGL() override
void setName(std::string name)
static Program * createProgramSPIRV(const void *vs, size_t vs_len, const void *fs, size_t fs_len, const void *gs=0, size_t gs_len=0)
This is an implementation of AdditiveCCD based on peridyno.
static const int TRANSPARENCY