[Bf-committers] A suggestion about raycasting.

Łukasz Michalczyk l.a.m.michalczyk at gmail.com
Thu Sep 10 16:24:45 CEST 2015

I don't know if this is the right place to post a suggestion, but 
nowhere else I've found a place to do it.

To the merits:

My idea is to let Blender perform a scripted callback through rendering 

What I actually mean is to allow scripts to do one thing:
-discard a triangle hit, when blender casts a ray for raycasting

Technically speaking:
I don't exactly know how the raycasting works in Blender, but I guess, 
that it works
the usual way: a ray is casted from the active camera forward to the 
scene, then it's checked for
intersections with geometries in the scene. The intersections are sorted 
the nearest to the furthest and the first intersection is taken as the 
rendering point.
That is what I assume, how it works - correct me if I'm wrong.
What I'm up to is to let the script (or perhaps dynamically linked 
library process)
receive world position of such an intersection and decide whether to 
pass it further for rendering.
If the script discarded the intersection, then pass it the next 
intersection, that is further away.

Here is a pastebin to some Python conceptual code to illustrate what I mean:

The rationale behind this is it would allow many different things to 
take place,
it would allow to easily render cross sections, or parts of the scene, 
that are in irregular shapes - what
is not possible with compositor.

That's it. Also, perhaps there's already such a possibility in Blender, 
which I'm not aware of.
If so, please - point me to it and burn this message.

Thank you.

More information about the Bf-committers mailing list