36 bool BoxGrid::Cell::compareOccludersByShallowestPoint(
const BoxGrid::OccluderData *
a,
37 const BoxGrid::OccluderData *
b)
39 return a->shallowest <
b->shallowest;
42 void BoxGrid::Cell::indexPolygons()
45 sort(
faces.begin(),
faces.end(), compareOccludersByShallowestPoint);
58 cout <<
"Searching for occluders of edge centered at " << _target <<
" in cell ["
59 << 1_cell->boundary[0] <<
", " << _cell->boundary[1] <<
", " << _cell->boundary[2] <<
", "
60 << _cell->boundary[3] <<
"] (" << _cell->faces.size() <<
" occluders)" << endl;
65 _current = _cell->faces.begin();
80 cout <<
"Generate Cell structure" << endl;
86 cout <<
"Distribute occluders" << endl;
92 cout <<
"Reorganize cells" << endl;
97 cout <<
"Ready to use BoxGrid" << endl;
107 _cellSize =
density.cellSize();
110 _cellOrigin[0] =
density.cellOrigin(0);
111 _cellOrigin[1] =
density.cellOrigin(1);
113 cout <<
"Using " << _cellsX <<
"x" << _cellsY <<
" cells of size " << _cellSize <<
" square."
115 cout <<
"Cell origin: " << _cellOrigin[0] <<
", " << _cellOrigin[1] << endl;
119 _cells.resize(_cellsX * _cellsY);
120 for (cellContainer::iterator i = _cells.begin(), end = _cells.end(); i != end; ++i) {
126 for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end(); f != fend;
128 if ((*f)->isInImage()) {
131 getCellCoordinates(
point, i, j);
132 if (_cells[i * _cellsY + j] ==
nullptr) {
136 x = _cellOrigin[0] + _cellSize * i;
139 y = _cellOrigin[1] + _cellSize * j;
143 Cell *
b = _cells[i * _cellsY + j] =
new Cell();
152 unsigned long nFaces = 0;
153 unsigned long nKeptFaces = 0;
160 _faces.push_back(occluder);
175 cout <<
"Distributed " << nFaces <<
" occluders. Retained " << nKeptFaces <<
"." << endl;
182 for (vector<Cell *>::iterator i = _cells.begin(), end = _cells.end(); i != end; ++i) {
184 (*i)->indexPolygons();
189 void BoxGrid::getCellCoordinates(
const Vec3r &
point,
unsigned &
x,
unsigned &
y)
191 x =
min(_cellsX - 1, (
unsigned)
floor(
max((
double)0.0f,
point[0] - _cellOrigin[0]) / _cellSize));
192 y =
min(_cellsY - 1, (
unsigned)
floor(
max((
double)0.0f,
point[1] - _cellOrigin[1]) / _cellSize));
198 getCellCoordinates(
point,
x,
y);
199 return _cells[
x * _cellsY +
y];
Class to define a cell grid surrounding the projected image of a scene.
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
void assignCells(OccluderSource &source, GridDensityProvider &density, ViewMap *viewMap)
const Vec3r & viewpoint() const
Cell * findCell(const Vec3r &point)
void distributePolygons(OccluderSource &source)
bool insertOccluder(OccluderSource &source, OccluderData *&occluder)
bool orthographicProjection() const
vector< FEdge * > fedges_container
fedges_container & FEdges()
VecMat::Vec3< real > Vec3r
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)