Closed iqch closed 2 years ago
Currently OSPRay only supports a single topology, i.e. if a vertex position is shared also its attributes are shared between faces. For meshes you sketched the workaround: not sharing the vertex. But you need that mainly for SubDs? SubD support in OSPRay is a first step, thus we should add support for multiple typologies (concretely an optional index.texcoord
) in a further iteration? What about color
?
All varying parameters can be passed in facevarying mode - color, normals, textures. it is a standard feature now. Of course, subdivs are popular and useful visual primitives, for modern renderer is better to pay attention this fact. Why are you keep away from OpenSubdiv?
while it doesn't sound like you are using ptex, it is supported in OSPRay through the ptex module, https://github.com/ospray/module_ptex. Embree's subd params are compatible with opensubdiv's. You could map the output of OpenSubdiv to a quadmesh if you are already using OpenSubdiv, but it would likely make more sense to use the grid primitive which hasn't been exposed through OSPRay yet, though will likely be put in soon. Fortunately OSPRay is pretty easy to extend through modules...
Embree does support face-varying data: https://www.embree.org/api.html#face-varying-data
And I think OSPRay should as well, i.e. it's SubD geometry should be OpenSubDiv compatible. Internally we will use Embree's grid primitive, but hide that from the user (i.e., not expose as own geometry, unless there are compelling reasons (maybe displacement mapping?)). This means adding optional parameters
uint[] index.texcoord
(defaulting to index
if not present)int mode.texcoord
(defaulting to mode
if not present)uint[] index.color
(defaulting to index
if not present)int mode.color
(defaulting to mode
if not present)Does this look ok?
It looks nice (except of normal, but it is very rare usecase), but is it implemented in OSPRay? I look into its sources and found just same set of parameters, as mentioned in doc, none of above. Displacement - if you operate with regular grids - can be tricky, because it is getting more and more popular photometric and depth scans, they may require huge datasets, which can be stored as level maps for optimizing and may require highly irregular grid structures.
OSPRay uses the geometry normal of the (limit) surface for SubDs, currently no support for vertex normals.
index.texcoord
, etc., is a proposal, not implemented yet.
-3. Yes, I said, that since OSPRay serves as Embree frontend -it is good to wait when it will support this feature. And some other like loop subdivision scheme. -2. I feel myself overhelmed a bit with poor documented source code now, sleazy cmake files, obsolete dependencies etc. Of course, it is typical situation, all my skills was achieved in same conditions - but I had some general line in developing which I permanently shoud leave to another siddhi :). Better have a documentation for this. -1. Yes, I seem it is an hour of work, if I understood that sourcecode right. I can promice to test it asap too
Ah, ok. I still cannot imagine, that such critical production feature may lack in modern renderer
@iqch yes, OSPRay was originally focused on scientific visualization and we are still adding in features for studio rendering. We appreciate your comments and hope to add that soon, even if it may have taken us a while to get to it:)
coming in the next release via 7d080b6eb30e8457c404f2eb388d32afddd63e01
Face-varying attributes are now supported on Mesh and SubD via normal
, color
and texcoord
data arrays (vs. the vertex.*
variants which are vertex-varying).
setting vertex.texcoord means just a pair for each mesh point. Of course we can split mesh to parts according to texture islands, but it will not work for subdivs (ok, I know, that it will work, making extra poly-stripes and disabling boundaries interpolation, but it is too much fun and not an universal solution)