On Tue, May 24, 2016 at 11:40 AM, Param Hanji <param.catchch...@gmail.com>
wrote:

> I was trying to compare and contrast the existing ANSI C and OpenCL code.
> I noticed that these are starkly different. The ANSI C has extensive
> documentation (as it has probably been the for a long time). The OpenCL
> code I'm finding rather difficult to understand in its current state.
>

The OpenCL code is a simplification of the main code path used by the ANSI
C renderer which is implemented across several files. So it probably looks
a lot different. But the main functions should have similar names and
equivalent code for what is actually implemented there.

Specifically, boolweave() and boolfinal() are called in function
> shootray(). There is an implementation of shootray() in the OpenCL kernel
> code as well. However the 2 versions have no similarities. I can't seem to
> figure out if and how weaving and evaluation happen currently in OpenCL. My
> guess is that complex objects can't be rendered in OpenCL mode as of now.
> Please help me gain a better understanding.
>

The current OpenCL version only does first-hit ray tracing and multi-hit
ray tracing. It currently has no CSG support whatsoever. So it does not
call boolweave or boolfinal anywhere. Those functions are used to support
CSG solid modeling operators (e.g. union, difference, etc).

You can see the difference in rendering output if you try rendering any of
the .g files which use CSG like db/operators.g with both renderers.

You had also mentioned that it was a good idea to generate the segments
> using OpenCL and then process the same using the existing ANSI C functions.
> If I understood right, this would mean converting output from clt_frame()
> into a suitable form to call the generic do_run() function, instead of the
> OpenCL specific clt_run(). I'll start working on this.
>

What I suggested was to change clt_frame(). One of the code paths already
generates segment arrays on the GPU (it calls clt_store_segs_kernel). You
copy the segment arrays (psegs) to the CPU, convert them into segment
lists, call boolweave() and boolfinal() on the input segment list and thus
generate an output CSG segment list, which you then copy to the GPU in
segment array format in order to perform final rendering (with
clt_shade_segs_kernel).

I'll try to find the time to look at your primitive intersection patch this
week.

Regards,

-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to