Is it possible to completely manipulate camera ray
On 23/01/2016 at 04:51, xxxxxxxx wrote:
Cinema 4D Version: R17
Platform: Mac ;
Language(s) : C++ ;
I'm looking at writing a plugin somewhat analogous to Lightwave's surface bake camera, which (as I understand it) lets you render out a scene to a texture using a specified mesh and UV map. I believe the way this works is that the raster space is basically mapped onto the 2D UV texture, and then the camera rays are fired downwards towards the mesh so that the rays are parallel to the polygon (or phong?) normal, hitting anything down along the way. This basically lets you bake out things like floating geometry or high poly models to low poly models by controlling the distance from the surface at which the camera rays are spawned. Modo seems to have a very similar feature that works quite well.
I know C4D has the "bake texture" tag, but this feature hasn't been touched in years (decades?) and doesn't support baking out floating geometry or stacked materials applied via polygon selections or alpha masks. I need to be able to do these things, preferably inside C4D, which means I guess I'm gonna have to write my own plugin to do it.
Anyways, what I'm wondering is where I should be starting with this... I know you can manipulate the camera rays in C4D as I'm pretty sure Per-Anders' Degamma plugin does this as a part of his VR rendering solution. What I don't know is what kind of plugin type is required to actually do this (and I can't find a demo of Degamma anywhere).
Can anyone offer any kinds of pointers on where to begin with something like this? I will ultimately need to control where the camera rays originate from and their vector, presumably before anything is actually rendered. I think I can handle the rest, I just don't really know where to begin.
On 23/01/2016 at 05:47, xxxxxxxx wrote:
Hey, that's already on my todo list!
On a side note, look at VideoPostData::CreateRay().
On 23/01/2016 at 19:58, xxxxxxxx wrote:
Thanks for the reply!
That looks like it's what I'm looking for. I'm a little bit confused about the wording of "Video Post Data"... Can a VPD plugin actually run during the renderer itself? For some reason I always thought this class was used for applying effects to the finished render (hence the "post" bit), not manipulating camera rays and what not during the render (but that seems to be what VIDEOPOSTINFO_CUSTOMLENS is for)...
On 24/01/2016 at 04:22, xxxxxxxx wrote:
Yes it can do post effects, but you can also do custom renderers and lens plugins with it. The name really is misleading. ;)
On 25/01/2016 at 01:28, xxxxxxxx wrote:
the "Execute" function and other functions of a VideoPostData plugin are called at various stages of the rendering process. The calling sequence of "Execute" is described in the documentation.