Joined: May 28, 2015
Post Count: 607
Status:
Offline
Several rendering engines in the same plugin
To date, Sweet Home 3D default rendering engine is SunFlow (written in Java). The YafaRay rendering plugin offers another rendering engine (written in C++ and accessible in Java Native Interface).
Grouping these 2 rendering engines in one plugin with a selector seems like a good idea.
1st problem For YafaRay rendering to work when selected, you must apparently respect the order and name of the initial com/eteks/sweethome3d/plugin/yafarayrendering packages. In this case, the YafarayRenderer.h and YafarayRenderer.cpp files do not appear to be necessary but use the lib folder containing the DLLs (Windows, Mac OS X and Linux). - Solution #1: In the plugin project folder, use the com/eteks/sweethome3d/plugin/yafarayrendering packages for all files (photo panel, SunFlow and YafaRay rendering engines). This is a problem when adding another rendering engine where you will also have to respect the order and the name of the initial packages.
- Solution #2: In the plugin project folder, keep the package created for the SunFlow rendering engine and the photo panel. Use com/eteks/sweethome3d/plugin/yafarayrendering packages for the YafarayRenderer.java file by adding an
Joined: May 28, 2015
Post Count: 607
Status:
Offline
Re: Several rendering engines in the same plugin
2nd problem When you press the Stop button, the YafaRay rendering is not interrupted when it is selected.
Solution: Take into account the different management of the Stop button by the YafaRay rendering plugin (YafarayPhotoPanel).
----------------------------------------
EnkoNyito
France
Joined: Nov 7, 2005
Post Count: 9394
Status:
Offline
Re: Several rendering engines in the same plugin
YafarayRenderer.h, YafarayRenderer.cpp and any source files like Java ones are not necessary for a plug-in to work. I just took the habit to include source code in the plug-in to avoid developers to download it from another place (these files are generally not very large). SunFlow and YafaRay renderers are completely independent from each other, so you can organize the packages where you use them like you want. The only thing to take care of, is too update in the YafaRay program according to where the DLLs it requires are stored, so the plug-in can find these DLLs to extract and load them.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
France
Joined: Nov 7, 2005
Post Count: 9394
Status:
Offline
Re: Several rendering engines in the same plugin
In the Beta 4 version of YafaRay plug-in where I recompiled YafaRay DLLs, I already removed many options to make its DLLs smaller. Not sure, I can do better. By the way, once added the DLLs for 32 bit systems, the size of the plug-in will be even twice as large. The only way I can think of to reduce the plug-in size, would be to produce one plug-in per operating system / architecture, but I'm not sure that it will be as easy to maintain, distribute and explain. We could say it's the weight of portability!
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
France
Joined: Nov 7, 2005
Post Count: 9394
Status:
Offline
Re: Several rendering engines in the same plugin
Sorry, I forgot about the DLLs found in yafaray-plugins folder. It should be possible to remove the ones which are not used: list the values associated to all the parameters named "types" in the program, and remove the DLLs which doesn't match the found names. But this might be more complicated that this, because libjpgHandler and libpngHandler DLLs must be kept to support JPEG and PNG of texture images. There might be other dependencies that will need a deeper study.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
France
Joined: Nov 7, 2005
Post Count: 9394
Status:
Offline
Re: Several rendering engines in the same plugin
Useless bytes are never welcomed so if the plug-in size could be reduced easily, it would be a nice gain. By the way, larger DLLs means also more time to extract and load them at the launch of the first rendering.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
Switzerland
Joined: Aug 31, 2017
Post Count: 421
Status:
Offline
Re: Several rendering engines in the same plugin
Useless bytes are never welcomed so if the plug-in size could be reduced easily, it would be a nice gain. By the way, larger DLLs means also more time to extract and load them at the launch of the first rendering.
Correct! But, it's the wrong priority to search for useless bytes while the plug-in is not fully functional yet. And it's totally the wrong priority if the plug-in is 12MB and not 120MB. But as written bevore, this is only my opinion...
----------------------------------------
Pascal
Joined: May 28, 2015
Post Count: 607
Status:
Offline
Re: Several rendering engines in the same plugin
About the integration of the YafaRay rendering engine.
Photos panel at points of view. The name of the selected rendering engine is added at the end of the image file name. No particular problem.
Video panel. The name of the selected rendering engine is added at the end of the video file name. The video shows a frozen image with the YafaRay renderer while the sequence is animated with the SunFlow renderer. The following warnings are returned after the first image rendered: