Trying to implementing simple custom shape

Discussion related to the Engine functionality, implementations and API.
Post Reply
minimal_surface
Posts: 4
Joined: Sat Jul 21, 2018 7:05 pm

Trying to implementing simple custom shape

Post by minimal_surface » Sat Sep 15, 2018 5:12 pm

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.

User avatar
Dade
Developer
Posts: 1340
Joined: Mon Dec 04, 2017 8:36 pm

Re: Trying to implementing simple custom shape

Post by Dade » Mon Sep 17, 2018 12:59 pm

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.
Support LuxCoreRender project with salts and bounties

minimal_surface
Posts: 4
Joined: Sat Jul 21, 2018 7:05 pm

Re: Trying to implementing simple custom shape

Post by minimal_surface » Mon Sep 17, 2018 4:01 pm

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.

minimal_surface
Posts: 4
Joined: Sat Jul 21, 2018 7:05 pm

Re: Trying to implementing simple custom shape

Post by minimal_surface » Fri Oct 05, 2018 1:59 pm

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.

minimal_surface
Posts: 4
Joined: Sat Jul 21, 2018 7:05 pm

Re: Trying to implementing simple custom shape

Post by minimal_surface » Fri Oct 05, 2018 2:37 pm

#if CUSTOM_SHAPE_CODE
#else
#endif
Since it is enclosed by this, I think that it can be easily traced.

Post Reply