Maya 1.0
|
SDF rendering widget based on sphere-tracing. More...
#include <realtime.h>
Public Member Functions | |
SphereTracingWidget (QWidget *parent=nullptr) | |
Default constructor. | |
~SphereTracingWidget () | |
Destructor. Release shader program. | |
virtual void | paintGL () |
Renders the scene. | |
virtual void | ReloadShaders () |
Reload the shaders of the widget. Useful for realtime editing and fine tuning of the rendering. | |
void | AddSDF (const QString &, const QString &) |
Add a new sdf in the scene. | |
void | DeleteSDF (const QString &) |
Delete a sdf in the scene from its name. | |
bool | HasSDF (const QString &) const |
Check if a sdf exists in the widget. | |
void | ClearAll () |
Destroys all sdf objects in the scene. | |
void | UpdateSDF (const QString &, const FrameScaled &) |
Updates the transform of a sdf given its name. | |
void | EnableSDF (const QString &) |
Enable a sdf given its name. | |
void | DisableSDF (const QString &) |
Disable a sdf given its name. The sdf will not be rendered until it's enabled again. | |
void | setShading (int) |
Set the shading to use. | |
void | setSampleFieldNormal (const Vector &) |
Set the normal of the plane showing the sdf field. | |
void | setSampleFieldPoint (const Vector &) |
Set the offset of the plane showing the sdf field. | |
void | setSampleFieldParam (float freq, float size, bool disk, bool cost, bool showInPhotobox) |
Set the frequence of the sdf field. | |
void | setMaxCost (int) |
Set the maximum cost to show on the cost shader. | |
void | setKG (float) |
Set the geometric interpolation coeficient. | |
void | setKN (float) |
Set the normal interpolation coeficient. | |
void | setAA (int) |
Set the anti-aliasing level. | |
void | setUseBEIS (float) |
Set the useBEIS variable. | |
void | setUseLoD (float) |
Set the useBEIS variable. | |
void | setVerticalLoD (bool) |
Set the verticalLoD variable. | |
void | setAutoScaleCost (bool) |
Set the autoScaleCost variable. | |
void | setEvaluationPoints (std::vector< Vector >, std::vector< float >) |
Set all the evaluations points. | |
void | setNbSteps (int) |
Set the number of step of the sphere tracing. | |
Protected Member Functions | |
void | RenderSDF () |
Render all the sdf. | |
void | RenderPoints () |
Render all the evaluation points. | |
Protected Attributes | |
int | aa = 0 |
Anti aliasing size. | |
PointGL | evaluationsPoints |
3D points where we count the number of reccursive call done when evaluating the tree. | |
SDF rendering widget based on sphere-tracing.
void SphereTracingWidget::AddSDF | ( | const QString & | name, |
const QString & | sdf_code_glsl ) |
Add a new sdf in the scene.
sdf_code_glsl | new sdf glsl code |
frame | sdf frame, identity by default. |
void SphereTracingWidget::DeleteSDF | ( | const QString & | name | ) |
Delete a sdf in the scene from its name.
sdf | mesh sdf |
void SphereTracingWidget::DisableSDF | ( | const QString & | name | ) |
Disable a sdf given its name. The sdf will not be rendered until it's enabled again.
name | sdf name |
void SphereTracingWidget::EnableSDF | ( | const QString & | name | ) |
Enable a sdf given its name.
name | sdf name |
bool SphereTracingWidget::HasSDF | ( | const QString & | name | ) | const |
Check if a sdf exists in the widget.
name | sdf name |
|
protected |
Render all the evaluation points.
References evaluationsPoints, Matrix4Float::LookAt(), Matrix4Float::Orthographic(), Matrix4Float::Perspective(), and Math::RadianToDegree().
Referenced by paintGL().
|
protected |
Render all the sdf.
References aa, Matrix4Float::Inverse(), Matrix4Float::LookAt(), Matrix4Float::Orthographic(), Matrix4Float::Perspective(), and Math::RadianToDegree().
Referenced by paintGL().
void SphereTracingWidget::setAA | ( | int | a | ) |
void SphereTracingWidget::setAutoScaleCost | ( | bool | autoScaleCost | ) |
Set the autoScaleCost variable.
void SphereTracingWidget::setEvaluationPoints | ( | std::vector< Vector > | points, |
std::vector< float > | nbRecCalls ) |
Set all the evaluations points.
References evaluationsPoints.
void SphereTracingWidget::setKG | ( | float | kg | ) |
Set the geometric interpolation coeficient.
void SphereTracingWidget::setKN | ( | float | kn | ) |
Set the normal interpolation coeficient.
void SphereTracingWidget::setMaxCost | ( | int | maxCost | ) |
Set the maximum cost to show on the cost shader.
void SphereTracingWidget::setNbSteps | ( | int | newNbSteps | ) |
Set the number of step of the sphere tracing.
void SphereTracingWidget::setSampleFieldNormal | ( | const Vector & | sampleFieldNormal | ) |
Set the normal of the plane showing the sdf field.
void SphereTracingWidget::setSampleFieldParam | ( | float | freq, |
float | size, | ||
bool | disk, | ||
bool | cost, | ||
bool | showInPhotobox ) |
Set the frequence of the sdf field.
void SphereTracingWidget::setSampleFieldPoint | ( | const Vector & | sampleFieldPoint | ) |
Set the offset of the plane showing the sdf field.
void SphereTracingWidget::setShading | ( | int | newShading | ) |
Set the shading to use.
void SphereTracingWidget::setUseBEIS | ( | float | useBEIS | ) |
Set the useBEIS variable.
void SphereTracingWidget::setUseLoD | ( | float | useLoD | ) |
Set the useBEIS variable.
void SphereTracingWidget::setVerticalLoD | ( | bool | verticalLoD | ) |
Set the verticalLoD variable.
void SphereTracingWidget::UpdateSDF | ( | const QString & | name, |
const FrameScaled & | frame ) |
Updates the transform of a sdf given its name.
name | sdf name |
frame | new frame |