36 bool SphericalGrid::Cell::compareOccludersByShallowestPoint(
const SphericalGrid::OccluderData *
a,
37 const SphericalGrid::OccluderData *
b)
39 return a->shallowest <
b->shallowest;
42 void SphericalGrid::Cell::indexPolygons()
45 sort(
faces.begin(),
faces.end(), compareOccludersByShallowestPoint);
56 #if SPHERICAL_GRID_LOGGING
58 cout <<
"Searching for occluders of edge centered at " << _target <<
" in cell ["
59 << _cell->boundary[0] <<
", " << _cell->boundary[1] <<
", " << _cell->boundary[2] <<
", "
60 << _cell->boundary[3] <<
"] (" << _cell->faces.size() <<
" occluders)" << endl;
65 _current = _cell->faces.begin();
79 cout <<
"Generate Cell structure" << endl;
84 cout <<
"Distribute occluders" << endl;
89 cout <<
"Reorganize cells" << endl;
94 cout <<
"Ready to use SphericalGrid" << endl;
104 _cellSize =
density.cellSize();
107 _cellOrigin[0] =
density.cellOrigin(0);
108 _cellOrigin[1] =
density.cellOrigin(1);
110 cout <<
"Using " << _cellsX <<
"x" << _cellsY <<
" cells of size " << _cellSize <<
" square."
112 cout <<
"Cell origin: " << _cellOrigin[0] <<
", " << _cellOrigin[1] << endl;
116 _cells.resize(_cellsX * _cellsY);
117 for (cellContainer::iterator i = _cells.begin(), end = _cells.end(); i != end; ++i) {
123 for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end(); f != fend;
125 if ((*f)->isInImage()) {
128 getCellCoordinates(
point, i, j);
129 if (_cells[i * _cellsY + j] ==
nullptr) {
133 x = _cellOrigin[0] + _cellSize * i;
136 y = _cellOrigin[1] + _cellSize * j;
140 Cell *
b = _cells[i * _cellsY + j] =
new Cell();
149 unsigned long nFaces = 0;
150 unsigned long nKeptFaces = 0;
157 _faces.push_back(occluder);
171 cout <<
"Distributed " << nFaces <<
" occluders. Retained " << nKeptFaces <<
"." << endl;
178 for (vector<Cell *>::iterator i = _cells.begin(), end = _cells.end(); i != end; ++i) {
180 (*i)->indexPolygons();
185 void SphericalGrid::getCellCoordinates(
const Vec3r &
point,
unsigned &
x,
unsigned &
y)
187 x =
min(_cellsX - 1, (
unsigned)
floor(
max((
double)0.0f,
point[0] - _cellOrigin[0]) / _cellSize));
188 y =
min(_cellsY - 1, (
unsigned)
floor(
max((
double)0.0f,
point[1] - _cellOrigin[1]) / _cellSize));
194 getCellCoordinates(
point,
x,
y);
195 return _cells[
x * _cellsY +
y];
224 newPoint[2] =
::sqrt(
M[0] *
M[0] +
M[1] *
M[1] +
M[2] *
M[2]);
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
Class to define a cell grid surrounding the projected image of a scene.
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
bool orthographicProjection() const
Cell * findCell(const Vec3r &point)
void distributePolygons(OccluderSource &source)
bool insertOccluder(OccluderSource &source, OccluderData *&occluder)
vector< FEdge * > fedges_container
fedges_container & FEdges()
INLINE Rall1d< T, V, S > atan(const Rall1d< T, V, S > &x)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)