Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 173
Posts: 173   Pages: 18   [ Previous Page | 2 3 4 5 6 7 8 9 10 11 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 417045 times and has 172 replies Next Thread
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9176
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

Hi,

For various reasons, I wanted to be able to recompile YafaRay DLLs. I succeeded to achieve this task without big problems under Windows and Linux thanks to the instructions given in YafaRay source code, but I had much more difficulties to make it work under macOS!
Finally, I was able to generate new DLLs based on a slightly modified version of the current source code (to fix an issue on normals management) and I'm happy to propose a version 1.0 Beta 4.
This new version is much smaller (13 MB instead of 46 MB) and should work under more systems.

enkonyito, before I investigate your problem, could you try again with this new version fist?

Happy New Year 2020 to everyone smile
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Jan 12, 2020, 1:56:47 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member




Joined: May 28, 2015
Post Count: 607
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

With the YafaRay Blender-Exporter, I was able to find examples of XML scenes using different types of light.


enkonyito, before I investigate your problem, could you try again with this new version fist?
With this version 1.0 Beta 4, the following three problems occur again.

1. No light emitted for arealight.
Example of implementation.
params.put("type", "arealight");
Point3f corner = new Point3f(-100, -100, 100);
Point3f point1 = new Point3f(-100, 100, 100);
Point3f point2 = new Point3f(100, -100, 100);
params.put("corner", corner);
params.put("point1", point1);
params.put("point2", point2);
params.put("from", new float [] {0, 0, 100});
params.put("color", new float [] {
((lightColor >> 16) & 0xFF) * ((this.homeLightColor >> 16) & 0xFF),
((lightColor >> 8) & 0xFF) * ((this.homeLightColor >> 8) & 0xFF),
(lightColor & 0xFF) * (this.homeLightColor & 0xFF), 1});
params.put("power", power);
params.put("samples", 4);
createLight(UUID.randomUUID().toString(), params);
I think it's related to line 84 of the arealight.cc file even for double sided panels.

2. Identifier not taken into account for spherelight and arealight.
To make the sphere or area lights visible, add
params.put("object", id);
returns the error "Invalid object ID given!".
How to find this identifier after the creation of the object (mesh)?

3. SH3D crash for meshlight.
Example of implementation.
params.put("type", "meshlight");
params.put("double_sided", false);
params.put("light_enabled", true);
params.put("object", 1);
params.put("color", new float [] {
((lightColor >> 16) & 0xFF) * ((this.homeLightColor >> 16) & 0xFF),
((lightColor >> 8) & 0xFF) * ((this.homeLightColor >> 8) & 0xFF),
(lightColor & 0xFF) * (this.homeLightColor & 0xFF), 1});
params.put("power", power);
params.put("samples", 4);
createLight(UUID.randomUUID().toString(), params);

These portions of code are implemented in the exportLightSource method of the YafarayRenderer class.
----------------------------------------
EnkoNyito
[Jan 13, 2020, 3:46:08 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
UbuntuBirdy
Advanced Member
Member's Avatar

Switzerland
Joined: Aug 31, 2017
Post Count: 421
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

Still not what I expected, but it's getting better (Beta 4):


Screenshot of the 3D-view:

----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x
[Jan 13, 2020, 7:32:14 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9176
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

Thank you all for your feedback smile

Tonight, the version 1.0 Beta 5 of the plug-in now shows borders around rendered tiles and brings a bug fix that could give weird results with lines (UbuntuBirdy, I hope it will resolve your issue). I also removed double faces to avoid bad results shown on the chairs in Cecilia's test file.



Enkonyito, I made some tests about area and mesh lights, and you can use some working code found in the comments of YafarayRenderer constructor.
In the source code you posted, corner, point1 and point2 must be arrays of 3 floats not Point3f instances (by the way, from parameter isn't used).
You should also take care of the orientation of the triangle built from corner, point1 and point2 (if ever it's wrongly oriented, just swap corner and point1).

About mesh lights, you have to provide the integer id of the mesh used as a light in a parameter named object. This id is returned by startTriMesh method so you'll have to store the ids of the meshes used as lights somewhere.
Good luck! smile
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Jan 14, 2020, 6:44:08 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
hansmex
Advanced Member
Member's Avatar

Netherlands
Joined: Sep 26, 2009
Post Count: 3950
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

After updating my plugins, I did a few test renders. Some results were as expected, others were shocking.

Too many large images, so look here for the comparison between standard SH3D render, Enko's plugin v1.8, and the YafaRay plugin v1b5.

http://www.hansdirkse.info/sh3d/
----------------------------------------
Hans

new website - under constuction
hansdirkse.info
----------------------------------------
[Edit 1 times, last edit by hansmex at Jan 15, 2020, 1:06:21 PM]
[Jan 15, 2020, 1:04:59 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
UbuntuBirdy
Advanced Member
Member's Avatar

Switzerland
Joined: Aug 31, 2017
Post Count: 421
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

... (UbuntuBirdy, I hope it will resolve your issue)...


Emmanuel, you are a genius!


----------------------------------------
Pascal

SH3D 6.6 / Ubuntu 22.04 (Mainline-Kernel) / Radeon RX580 / Ryzen 7 5800x
[Jan 15, 2020, 4:00:26 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Ceciliabr
Advanced Member
Member's Avatar

Denmark
Joined: Jul 7, 2013
Post Count: 619
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

Seems the YafaRay renderer is still not completely up to speed on the CPU handling.



But I noticed little difference in speed. Maybe YafaRay was a fraction faster.


I also noticed another oddity:





This is a larger image, rendered by YafaRay:




Rendered by Sunflow:




And to make an unjust comparison; here's a rendering made with Enko's SPR v1.8:




___________________

In case you want to have a look at the terrain that YafaRay failed to render:

YafaTestTerrain.sh3d


Cec
[Jan 15, 2020, 9:01:02 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9176
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

Many thanks for your tests. It looks like we get closer to a working solution smile

The version 1.0 Beta 6 published today brings support for BMP, WBMP and GIF images (that will fix Cecilia's issue) and improves the cache of texture images to speed up YafaRay launch during subsequent times.

Cecilia, I tried your file and noted a similar CPU usage on my computer, even if it wasn't as low as in your case. As I wondered if it could be because of the very large images you use as textures, I created another version with much smaller images, but this gave the same results! Could you try with some files of the gallery (like the Alps hotel that you seem to like ;-), and report how rendering works with them?

Among the remaining issues, I noted that the default sky used in aerial view still gives some images a little bluer than with SunFlow. After some investigations, I didn't find any solution yet.
Before releasing a version 1.0, I shall add the support for Windows and Linux 32 bit and a Depth of field lens option. As YafaRay doesn't seem to be able to generate some equirectangular images, I fear there won't be any Spherical lens option at the moment. Any other ideas in mind?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Jan 16, 2020, 9:50:30 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member




Joined: May 28, 2015
Post Count: 607
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

Enkonyito, I made some tests about area and mesh lights, and you can use some working code found in the comments of YafarayRenderer constructor.
In the source code you posted, corner, point1 and point2 must be arrays of 3 floats not Point3f instances (by the way, from parameter isn't used).
You should also take care of the orientation of the triangle built from corner, point1 and point2 (if ever it's wrongly oriented, just swap corner and point1).

About mesh lights, you have to provide the integer id of the mesh used as a light in a parameter named object. This id is returned by startTriMesh method so you'll have to store the ids of the meshes used as lights somewhere.
Good luck! smile


Thank you Puybaret for the advice on area lights! This works for unviewable light panels.



Using
long meshLightId = startTriMesh(-1, vertices.length / 3, verticesIndices.length / 3, false, uvs != null, 0, 0);
and
params.put("object", Integer.parseInt(light.getProperty(this.INT_MESH_LIGHT_ID)));
Sweet Home 3D no longer crashes for mesh lights but the opaque light panel emits light without being luminescent.
----------------------------------------
EnkoNyito
[Jan 23, 2020, 2:52:11 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9176
Status: Offline
Reply to this Post  Reply with Quote 
Re: YafaRay rendering plug-in

It's great you could find out. About the light panel color, maybe you could apply a light_mat material on the mesh (see the end of exportAppearance method)?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Jan 23, 2020, 7:59:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 173   Pages: 18   [ Previous Page | 2 3 4 5 6 7 8 9 10 11 | Next Page ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved