Message Boards Message Boards

Photorealistic Rendering: A walkthrough for working with LuxCoreRender

Attachments:
POSTED BY: Silvia Hao
10 Replies

enter image description here - Congratulations! This post is now featured in our Staff Pick column as distinguished by a badge on your profile of a Featured Contributor! Thank you, keep it coming!

POSTED BY: Moderation Team

On a lower-brow note, Ms. Hao has excellent coding style, viz. her use of whitespace and leading commas (indicating call sequence).

POSTED BY: Vincent Virgilio

Well I didn't invent that. I adopted it from gurus. I guess the take-away is WL does tolerant all kinds of coding styles one can imagine :)

POSTED BY: Silvia Hao

Thanks for posting this amazing walkthrough! I'm new to luxcorerender and am trying to get this notebook to work. When I evaluate the notebook and run pyluxcoretool, it emits this relatively unhelpful error message:

C:\Users\Ben\Downloads\luxcorerender-v2.2-blender2.80-win64-opencl\luxcorerender-v2.2-blender2.80-win64-opencl
? pyluxcoretool console diamond.cfg
[MainThread][2019-12-01 18:41:00,669] LuxCore 2.2
Traceback (most recent call last):
  File "pyluxcoretool.py", line 59, in <module>
  File "C:\Users\Ben\AppData\Local\Temp\_MEI112042\pyluxcoretools.zip\pyluxcoretools\pyluxcoreconsole\cmd.py", line 174, in main
  File "C:\Users\Ben\AppData\Local\Temp\_MEI112042\pyluxcoretools.zip\pyluxcoretools\pyluxcoreconsole\cmd.py", line 126, in LuxCoreConsole
RuntimeError: Syntax error in a Properties at line 1
[20124] Failed to execute script pyluxcoretool

I noticed when I evaluated the notebook that some warnings were thrown when generating diamond.scn, which I believe to be the problem:

In[35]:= sceneFile = 
 sceneConfig // luxcoreWriter // Export["diamond.scn", #, "String"] &

During evaluation of In[35]:= StringJoin::string: String expected at position 2 in scene.camera.lookat.orig = <>1<>7.<>2<>2<>(-7.)<>3<>3<>5.<>4.

During evaluation of In[35]:= StringJoin::string: String expected at position 3 in scene.camera.lookat.orig = <>1<>7.<>2<>2<>(-7.)<>3<>3<>5.<>4.

During evaluation of In[35]:= StringJoin::string: String expected at position 4 in scene.camera.lookat.orig = <>1<>7.<>2<>2<>(-7.)<>3<>3<>5.<>4.

During evaluation of In[35]:= General::stop: Further output of StringJoin::string will be suppressed during this calculation.

During evaluation of In[35]:= Part::partw: Part 2 of branch[#1[[1;;All,1,2]]&/*(ExportString[#1,RawJSON,Compact->0]&)/*StringReplace[{,-> ,[|]:>}],#1[[1,2]]&][{{{1,7.},2},{{2,-7.},3},{{3,5.},4}}] does not exist.

During evaluation of In[35]:= Part::partw: Part 2 of branch[#1[[1;;All,1,2]]&/*(ExportString[#1,RawJSON,Compact->0]&)/*StringReplace[{,-> ,[|]:>}],#1[[1,2]]&][{{{1,-0.2},5},{{2,0},6},{{3,-0.3},7}}] does not exist.

During evaluation of In[35]:= Part::partw: Part 2 of branch[#1[[1;;All,1,2]]&/*(ExportString[#1,RawJSON,Compact->0]&)/*StringReplace[{,-> ,[|]:>}],#1[[1,2]]&][{{{1,-3.80007},8},{{2,3.69452},9},{{3,10.0419},10}}] does not exist.

During evaluation of In[35]:= General::stop: Further output of Part::partw will be suppressed during this calculation.

Out[35]= "diamond.scn"

I'm not sure why this is throwing this error -- do you know what the issue is? This is running on Mathematica 12.0 and luxcorerender v2.2.

Thanks in advance!

POSTED BY: Ben Bartlett

Hi Ben,

I'm sorry I forgot to include the definition of a helper function branch in the Notebook.

It should go before the definition of luxcoreWriter. Please refer to the beginning of the Import and Export LuxCoreRender SDL files section of the original post above. Also I have updated the attached notebook in the original post.

Thank you for spotting the issue!

POSTED BY: Silvia Hao

Incredible! While I've used Mathematica a bit (at university) and LuxCoreRender since it was LuxRender, mathematically generating scenes with the flexibility this gives reminds me of Pov-Ray, except both the engine and scene generation are more powerful.

A tip for speed, using the Hybrid Backwards/Forwards path tracer will produce much faster results than Bi-Dir, while getting the same kind of results: https://forums.luxcorerender.org/viewtopic.php?f=5&t=1187

Thanks a lot for your tip Alan, I didn't aware of that! I did some test according to the forum post you kindly pointed out. The hybrid tracer does make quite an improvement on performance when working with PATHOCL. I must confess I'm still a newcomer and have lots to learn.

POSTED BY: Silvia Hao

Very cool! Thanks very much for sharing!!

POSTED BY: Sander Huisman

Beautiful render Sylvia! I feel like an amateur now, which I am. I can envision some true Mathematica(l) art being generated with this workflow. Thank you for the detailed description and notebook!

POSTED BY: Tim Laska
POSTED BY: Silvia Hao
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract