Page 1 of 1

Trying to implementing simple custom shape

Posted: Sat Sep 15, 2018 5:12 pm
by minimal_surface
Hi there.

At first, I'm sorry for my poor english.

I trying to implementing simple custom shape. https://github.com/NativeMeta/LuxCoreRender_CustomShape

That is the instant method below.

1) Input custom shape data
- Currently, the custom shape data is parasitic on the definition of "scene.objects.*.ply" in the "*.scn" file.

2) Intercept ray intersection
- Any function.

3) Return intersection information
- Materials obtained at the time of input are diverted.

image of implemented sphere intersection result.
Image

Something is indefinite, but it is under investigation.

Re: Trying to implementing simple custom shape

Posted: Mon Sep 17, 2018 12:59 pm
by Dade
I'm not sure to understand exactly the question.

LuxCore support a pre-processing step where you can transform any kind of input in a triangle mesh. For instance, this is used to transform and tessellate a hair file in a triangle mesh. Or to implement the "pointiness" feature.
This is by far the most simple way to add the support for some kind of new shape: you have only to implement the transformation to a triangle mesh step.

Adding the support for a new type of primitive to the core is a LOT more complex and is not even expected/planned. You have to modify a LOT of C++ and OpenCL C code. It is really a complex task.

Re: Trying to implementing simple custom shape

Posted: Mon Sep 17, 2018 4:01 pm
by minimal_surface
Thank you for your reply.

Certainly the attributes supported by LuxCore are diverse and complicated.
Of course, as it will be completely independent from LuxCore's product.

The implementation of custom shapes seems unusual, I examined the SDK such as MentalRay, Maxwell etc, but there was no API to bypass the ray intersection.

Re: Trying to implementing simple custom shape

Posted: Fri Oct 05, 2018 1:59 pm
by minimal_surface
I found out that the local coordinate system of the intersection position is indeterminate and fixed the bug, so I do not know if there is demand but post it.

https://github.com/NativeMeta/LuxCoreRender_CustomShape

Image
sphere rendering

Image
polyhedron rendering

Image
Absolute value of difference

I'm sorry for my poor english.

Re: Trying to implementing simple custom shape

Posted: Fri Oct 05, 2018 2:37 pm
by minimal_surface
#if CUSTOM_SHAPE_CODE
#else
#endif
Since it is enclosed by this, I think that it can be easily traced.

Re: Trying to implementing simple custom shape

Posted: Sat Oct 20, 2018 8:32 am
by minimal_surface
Hi there.

I made that possible to describe custom shapes restrictively with the syntax of the LuxCoreRender scene file.
It must be added at the end of the shape definition line.

https://github.com/NativeMeta/LuxCoreRender_CustomShape

I'm sorry for my poor English.