[Bf-cycles] Could we do this with Cycles ?

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Feb 27 01:55:29 CET 2014

Hi Antoine,

If you want to modify the source code locally to do this, then it may
be relatively simple. If you want this to be accepted in an official
Cycles release, it's more complicated because it has to align with our
goals, I would only add functionality like this if it also benefits
rendering to create "pretty images" basically. It may be that this
fits but I don't fully understand what is needed here.

There's two things I can see missing in Cycles here: support for this
light type and the ability to extract the distance. Cycles also only
does path tracing, nothing bidirectional. Maybe that's not enough for
you, I'm not sure.

For the light beam you'd have to implement a new light type. If you
search the source code for "spot" for example you should find all
places where a spot lamp is used, and you could copy that code and
modify it add support for your new light type. Lights need to
implement an "eval" and "sample" function, one used for evaluation
after BSDF direction sampling and the other for sampling a point on
the light. If this is a perfect laser I think you only need to
implement "sample" because the probability of sampling the BSDF in the
right direction would be zero.

For extracting the distance, is that a kind of render pass or is it
written out in some other way? If it is a render pass you could
implement your own render pass type to store this distance, again
looking at some existing render pass and copying the code. We don't
currently support custom render passes, if we did perhaps it could
have been done with shader nodes or an OSL shader.

But I'm not sure if you expect the output to actually be RGBA +
distance render passes. If instead you need to send some number of
rays from the light and then somehow dump them to a file, then you
need to do bigger changes.


On Tue, Feb 25, 2014 at 10:58 PM, Antoine Cottin <adancottin at gmail.com> wrote:
> Hi,
> My name is Antoine. I'm a senior developer at Carbomap. Our core business is
> forest monitoring using airborne laser scanner (lidar).
> You might have seen some of our graphics/video on BlenderNation lately:
> http://carbomap.wordpress.com/2014/02/11/free-forest-mapping-graphics/
> https://www.sharein.com/invest/pitch/508176573/mri-scan-for-forests
> We are currently designing a new multi-wavelength lidar system (hardware and
> software) specifically tailored for forest monitoring. For this I have
> developed a ray tracing engine in IDL (www.exelisvis.com) to simulate the
> system response. We use Blender to create our 3D virtual scene/world.
> This setup works but is a bit tedious as we need to export the scene to a
> specific file format and then process the file into our engine. I also think
> that we could benefit (and not need to reinvent the wheel) from all the
> texture/material already present into Cycles... bottom line this would
> facilite the implementation of the overall simulator.
> So I was wondering, as a Blender user, if the direct integration of our
> simulator into Blender could be easily achievable.
> Basically what we need to simulate the system response is:
> - a mesh light that project a light beam with a 2D gaussian shape (kind of
> spot light) -> this act as the laser source
> - a camera -> this act as the optical scanner/PMT photon detector
> - and the ability to get the travel distance camera-object-light -> to model
> the time response system
> - and the shader value/response -> to model the light/mater interaction
> (similar to physical render based engines)
> So two questions:
> 1. Do you think this could be easily easily?
> 2. If so, does anyone has valuable guidance on how to get started?
> PS: I've been already scouting the source code, and I can somehow understand
> the overall structure/sens of it, however it is always difficult and
> intimidating to get into a huge piece of code with any guidances/help. Not
> to mention that C++ is not my native language... so still struggling and
> stumbling sometimes.
> PS2: We are a commercial company, but we don't see (nor seek) any commercial
> outputs from this development, beside being able to design and develop a
> better hardware. If we succeed, we will most likely release this simulator
> to the public and scientific community.
> Thank you for your time.
> Cheers.
> Antoine
> -------------------
> Dr Antoine Cottin
> Senior Software Developer/Analyst
> Carbomap Ltd.
> 7th Floor, Appleton Tower
> 11 Crichton Street
> Edinburgh
> EH8 9LE
> http://www.carbomap.com
> +44 (0)7577 444-046
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> http://lists.blender.org/mailman/listinfo/bf-cycles

More information about the Bf-cycles mailing list