11 #ifndef __VGEO_Volume__
12 #define __VGEO_Volume__
31 class VEX_LateBinding;
37 class VGEO_ShadeObject;
62 virtual float getNativeStepSize()
const = 0;
82 float zerothreshold)
const = 0;
102 float radius,
float time,
103 int idx,
float *
data)
const = 0;
115 virtual void evaluateMulti(
const UT_Vector3 *pos,
119 int idx,
float *
data,
151 VGEO_RayState &state,
152 VGEO_ShadeObject *prim,
163 , myStepSize(stepsize) {}
166 float tmin()
const {
return myTMin; }
169 float tmax()
const {
return myTMax; }
172 float zoff()
const {
return myZOff; }
181 void addHit(
float t,
const UT_Vector3 &pos,
bool backface);
187 exint entries()
const;
190 VGEO_HitList &myHits;
191 VGEO_RayState &myState;
192 VGEO_ShadeObject *myPrim;
209 virtual void intersectIsosurface(
const VGEO_Ray &ray,
215 HitList &hits)
const;
223 virtual void intersectVolume(
const VGEO_Ray &ray,
224 HitList &hits)
const;
235 float radius,
float time,
249 virtual bool isSDF()
const {
return false; }
255 : myStepSize(stepsize)
262 mySteps =
exint((myStepSize - myZOff + tmin) / myStepSize);
263 float tval = myZOff + mySteps*myStepSize;
268 tval = myZOff + mySteps*myStepSize;
272 UT_ASSERT(tval > tmin &&
"0 sized volume?");
276 float step() { mySteps++;
return myZOff + mySteps*myStepSize; }
277 float stepback() { mySteps--;
return myZOff + mySteps*myStepSize; }
291 float zerothreshold);
294 void fillBinding(VEX_LateBinding &bind)
const;
302 float zerothreshold);
308 float zerothreshold);
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
virtual float getGradientDelta() const
Returns a local distance for use in default gradient calculations.
float stepsize() const
Return the volume step size for ray marching algorithms.
virtual bool evaluateInterval(const UT_BoundingBox &box, const UT_Filter &filter, float radius, float time, int idx, float *minval, float *maxval) const
Utility class to perform numerically safe ray marching.
GT_API const UT_StringHolder time
DiscreteRayMarcher(float stepsize, float zoff)
virtual GA_Offset getGeoVertex() const
Base class for volume primitives in mantra.
virtual float getVoxelSize() const
Returns the voxel size in the same space as 'pos' in evaluate.
A reference counter base class for use with UT_IntrusivePtr.
#define GA_INVALID_OFFSET
virtual GA_Offset getGeoPrimitive() const
GLint GLenum GLboolean GLsizei stride
Wrapper around hboost::intrusive_ptr.
virtual int getNormalAttribute() const
float tmin() const
Return the minimum ray parameter for hit insertion.
HitList(VGEO_HitList &hits, VGEO_RayState &state, VGEO_ShadeObject *prim, float zoff, float tmin, float tmax, float stepsize)
Constructor (used internally)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
virtual bool isSDF() const
Returns true when the volume data should be interpreted as an SDF.