We're doing some work to bring back the latest production code to the
main repository, as well as add some new features in what will become
v1.3.
We would love to get your input to make sure that that interface we
create is complete enough to serve everyone's purposes. Please respond
with your questions and comments. I will most likely add a v1.3 branch
to the GitHub repository in the coming weeks, so the code will be
available then, but we won't move the master branch for a while.
* Extending MatrixFieldMapping.
FieldMapping has always had both time- and nontime-dependent
transform calls. But so far the matrix mapping did not use
time in its calculations.
> virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const = 0;
> virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const = 0;
We are adding a second setLocalToWorld call that lets you specify
a time sample as well.
> void setLocalToWorld(const M44d &lsToWs);
> void setLocalToWorld(float t, const M44d &lsToWs);
Field3D will make no assumptions about what the time represents,
the valid range will be [-inf,inf], but here we are letting time represent
offset from current frame start. So forward motion blur would sample
[0,0.5], centered blur would sample [-.25,.25], etc (assuming 180
degree shutter).
v1.3 will be able to read .f3d files from earlier versions of the library
but fields written out with MatrixFieldMapping in v1.3 will not be
readable in earlier versions.
* Adding a frustum mapping class.
Up until now we've had a custom plugin for frustum buffers
specific to our volume renderer, but we wanted to include a
generic one with Field3D, partly to share between different
in-house apps, but also to make Field3D more feature-complete.
The interface for specifying the frustum buffer will be similar to
the matrix mapping, and it will support temporally varying transforms,
which are required to handle moving cameras.
> void setTransforms(const M44d &ssToWs, const M44d &csToWs);
> void setTransforms(float t, const M44d &ssToWs, const M44d &csToWs);
There will be support for two types of Z slice distributions:
* Uniform - equal distance in world space depth.
* Perspective - equal distance in screen space depth.
* Removing the iterator-based transforms in FieldMapping
> virtual void voxelToWorld(std::vector<V3d>::const_iterator vsP,
std::vector<V3d>::const_iterator end,
std::vector<V3d>::iterator wsP) const = 0;
These were originally added with the assumption that they would
optimize away virtual function calls. It has turned out not to be needed
and we felt that they were cluttering the interface.
* Removing the use of typeid()
Field3D already had an RTTI replacement to facilitate safe downcasting
of field types across DSO boundaries. We recently had to use Field3D
in an LLVM-based app, which requires RTTI to be turned off,
so we changed the internal implementation of field_dynamic_cast to
not use typeid(). This should not break existing code, but it may
make life easier for anyone integrating Field3D into a non-RTTI environment.
--
You received this message because you are subscribed to the Google Groups "Field3D dev" group.
To post to this group, send email to field...@googlegroups.com.
To unsubscribe from this group, send email to field3d-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/field3d-dev?hl=en.
Regarding having resolution vary with time: Are you trying to account
for this in in-frame motion blur?
The idea with the temporally varying mappings is just to support
motion of the field as a whole. I.e., you would add a localToWorld
matrix time sample at t=0 and t=0.5 (or t=0.5*dt, depending on
renderer conventions) for forward motion blur and 180 degree shutter.
It does assume that the resolution of the field is constant over the
current frame. But it doesn't assume that the resolution is constant
frame-to-frame.
Magnus
Sorry for the slow reply, I've been out for a few days.
We did consider a world velocity vector, but that wouldn't allow
multi-segment motion blur, or rotational motion blur, unless I
misunderstand what you mean.
Magnus
On Fri, Jul 8, 2011 at 12:43 AM, Alexis Angelidis
Depending on how the matrix is constructed (Trans * Rot vs Rot * Trans), just blending the 16 floats for two matrices could give _very_ strange results. You might want to decompose the matrix into Rot/Trans/Scale, interpolate those, and recompose the resulting matrix.
Or use quaternions :)
________________________________________
From: Magnus Wrenninge [magnus.w...@gmail.com]
Sent: 18 July 2011 19:47
To: field...@googlegroups.com
Subject: Re: Upcoming features in v1.3
MatrixFieldMapping provides linear interpolation. It would be possible
to add others, but once again we get into trying to support everything
everyone wants. I think if a particular application requires something
special, with curved rotational interpolation etc, the cleanest way to
do so would be to, upon load, read the samples from
MatrixFieldMapping, create CustomMapping, and the assign that to the
field. And vice versa on write. I don't think the use of linear
interpolation in MatrixFieldMapping is too much of a stretch, as that
covers what both PRMan and Arnold do internally.
Basically, Field3D on disk makes no assumptions about neither time nor
interpolation of the matrices. The MatrixFieldMapping gives a library
user the very simplest interpolation possible (linear).
Magnus
On Mon, Jul 18, 2011 at 2:40 PM, Alexis Angelidis