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: 17
Posts: 17   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 6929 times and has 16 replies Next Thread
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Is Sunflow limited in Sweet Home 3D?

Sunflow offers other types of light (Point Light, Meshlight/Area Light, Directional Lights, Cornell Box) or global illumination (Instant GI, Irradiance Caching, Fake Ambient Term).
Is there a reason why these were not taken into account in Sweet Home 3D?

The configuration of these parameters is not very detailed in the Sunflow documentation and I noticed differences in terms with the source code .
Is it possible to test or integrate these "new" options in a plug-in or a derived version of SH3D?
----------------------------------------
EnkoNyito
[Mar 19, 2018, 10:56:09 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: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Is Sunflow limited in Sweet Home 3D?

There's no limitation. Feel free to test anything you want in SunFlow from a plug-in or a derived version of Sweet Home 3D.
Some classes of SunFlow project are missing in lib/sunflow-0.07.3i.jar but I don't think they are related to the features you mentioned. Anyway it shouldn't be difficult to rebuild a full version of SunFlow by removing <exclude> elements found in buildForSweetHome3D.xml entry of sunflow-0.07.3i-src-diff.zip found in source code. This file contains the modifications I introduced in SunFlow to fix some bugs and add support for missing features.

Good luck! smile
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Mar 20, 2018, 9:45:06 AM] 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
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Is Sunflow limited in Sweet Home 3D?

There's no limitation. Feel free to test anything you want in SunFlow from a plug-in or a derived version of Sweet Home 3D.
Ok, so I continue my tests.

Some classes of SunFlow project are missing in lib/sunflow-0.07.3i.jar but I don't think they are related to the features you mentioned. Anyway it shouldn't be difficult to rebuild a full version of SunFlow by removing <exclude> elements found in buildForSweetHome3D.xml
By following your method to rebuild a full version of Sunflow I did not notice any difference from the original file of source code.

Is it possible to retrieve a Sunflow error message to display it in Sweet Home 3D?
Examples from the LightServer.java file:
"LIGHT error: Unable to trace virtual photons, no lights in scene"
"LIGHT error: Photon mapping enabled, no virtual photons to emit"

----------------------------------------
EnkoNyito
[Mar 24, 2018, 1:01:54 AM] 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
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Is Sunflow limited in Sweet Home 3D?

I get these messages with the "igi" global illumination
this.sunflow.parameter("gi.engine", "igi");
this.sunflow.parameter("gi.igi.samples", 64);
this.sunflow.parameter("gi.igi.sets", 1);
this.sunflow.parameter("gi.igi.c", 0.00003f);
this.sunflow.parameter("gi.igi.bias_samples", 0);
for SunSkyLight or ImageBasedLight only.
The consequence is a completely black image and a progress bar stuck in indeterminate mode.

So I changed the behavior of the progress bar.
It is also possible to disable virtual photons by choosing igi.samples=0. The higher this value, the greater the rendering time when there is no visual difference.
----------------------------------------
EnkoNyito
[Mar 26, 2018, 5:40:07 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: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Is Sunflow limited in Sweet Home 3D?

Is it possible to retrieve a Sunflow error message to display it in Sweet Home 3D?
If you comment the line
UI.set(new SilentInterface());
in PhotoRenderer class, logs will appear in the console, so you could probably implement UserInterface another way to keep SunFlow messages.

I get these messages with the "igi" global illumination
The messages are missing sad
But anyway, I'm not sure I can help you on these parameters. I don't remember having tested them...
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Mar 26, 2018, 6:53:13 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
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Is Sunflow limited in Sweet Home 3D?

If you comment the line
UI.set(new SilentInterface());
in PhotoRenderer class, logs will appear in the console
Yes, in the Eclipse console.

The messages are missing
Only if SphereLight is used in addition.

But anyway, I'm not sure I can help you on these parameters.
Some parameters are not very understandable even with the help of the Sunflow doc.

Thank you for answering!
----------------------------------------
EnkoNyito
[Mar 29, 2018, 4:43:50 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
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Is Sunflow limited in Sweet Home 3D?

When the other types of lights or global illumination offered by Sunlow are properly implemented in Sweet Home 3D, they do not necessarily improve the current configuration.


With these parameters,
this.sunflow.parameter("gi.engine", "igi");
this.sunflow.parameter("gi.igi.samples", 0);
this.sunflow.parameter("gi.igi.sets", 1);
this.sunflow.parameter("gi.igi.c", 0.0000001f);
int bias_samplesMax = 512;
int bias_samples = (int) (bias_samplesMax / (Math.pow(4, antiAliasingMax)));
if (bias_samples < 1) {
bias_samples = 1;
}
this.sunflow.parameter("gi.igi.bias_samples", bias_samples);
this.sunflow.options(SunflowAPI.DEFAULT_OPTIONS);
the "igi" global illumination is similar to "path" with an equivalent rendering time.




The PointLight type
power = 100 * power;
this.sunflow.parameter("center", new Point3(lightSourceLocation.getX(),
lightSourceLocation.getY(),
lightSourceLocation.getZ()));
this.sunflow.parameter("power", null,
power * (lightColor >> 16) * (this.homeLightColor >> 16),
power * ((lightColor >> 8) & 0xFF) * ((this.homeLightColor >> 8) & 0xFF),
power * (lightColor & 0xFF) * (this.homeLightColor & 0xFF));
this.sunflow.light(UUID.randomUUID().toString(), "point");
does not allow to have soft shadows and differs from the SphereLight type.





----------------------------------------
EnkoNyito
[Mar 31, 2018, 10:37:35 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
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Is Sunflow limited in Sweet Home 3D?

Emmanuel, how can we retrieve the coordinates of the vertices of a plane object so that its rotations are taken into account as light?

My attempt is not very conclusive.

I transformed this plane object
g Plane_1_1_1
usemtl None
v 0.0 100.0 -0.05
v 100.0 100.0 -0.05
v 100.0 250.0 -0.05
v 0.0 250.0 -0.05
vn 0.0 0.0 1.0
f 1//1 2//1 3//1
f 1//1 3//1 4//1
in light,
id#1=Meshlight#Vertical
name#1=Vertical shape sh3d
category#1=Light sources 2
icon#1=/Vertical shape sh3d.png
model#1=/vertical_shape_sh3d.obj
width#1=100
depth#1=0.1
height#1=150
movable#1=true
doorOrWindow#1=false
## Mandatory for light source
lightSourceX#1=50
lightSourceY#1=0
lightSourceZ#1=75
lightSourceColor#1=#919189
## Optional for light source
##lightSourceDiameter#1=
elevation#1=100
modelSize#1=325
creator#1=Enko Nyito
which gives in the Home.xml file.
<light catalogId='Meshlight#Vertical' name='Vertical shape sh3d' creator='Enko Nyito' model='1' icon='0' x='50.0' y='-0.05' elevation='100.0' width='100.0' depth='0.1' height='150.0' modelSize='325' power='0.1'>
<lightSource x='0.5' y='0.0' z='0.5' color='00919189'/>
</light>

I notice that the position of the light source is not the same.

By implementing the TriangleMeshLight type,
...
int samples = 4;
int np = 4;
int nt = 2;
power = power / 100;
this.sunflow.parameter("radiance", null,
power * (lightColor >> 16) * (this.homeLightColor >> 16),
power * ((lightColor >> 8) & 0xFF) * ((this.homeLightColor >> 8) & 0xFF),
power * (lightColor & 0xFF) * (this.homeLightColor & 0xFF));
this.sunflow.parameter("samples", samples);
this.sunflow.parameter("points", "point", "vertex", parseFloatArray(np * 3, light, lightSourceLocation));
this.sunflow.parameter("triangles", parseIntArray(nt * 3));
this.sunflow.light(UUID.randomUUID().toString(), "triangle_mesh");
...

private int[] parseIntArray(int size) {
int[] data = {0, 1, 2,
0, 2, 3};
return data;
}

private float[] parseFloatArray(int size, HomeLight light, Point3f lightSourceLocation) {
float[] data = {lightSourceLocation.getX() - light.getWidthInPlan()/2, lightSourceLocation.getY() - light.getHeightInPlan()/2, lightSourceLocation.getZ() - light.getDepthInPlan()/2,
lightSourceLocation.getX() + light.getWidthInPlan()/2, lightSourceLocation.getY() - light.getHeightInPlan()/2, lightSourceLocation.getZ() - light.getDepthInPlan()/2,
lightSourceLocation.getX() + light.getWidthInPlan()/2, lightSourceLocation.getY() + light.getHeightInPlan()/2, lightSourceLocation.getZ() + light.getDepthInPlan()/2,
lightSourceLocation.getX() - light.getWidthInPlan()/2, lightSourceLocation.getY() + light.getHeightInPlan()/2, lightSourceLocation.getZ() + light.getDepthInPlan()/2};
return data;
}
I get those results.



The TriangleMeshLightWithNoRepresentation class
public static class TriangleMeshLightWithNoRepresentation extends TriangleMeshLight {
public Instance createInstance() {
return null;
}
}
does not allow to have a wire 3D shape like the SphereLight type.

For comparison, the same light panel with the type

----------------------------------------
EnkoNyito
----------------------------------------
[Edit 1 times, last edit by enkonyito at Apr 25, 2018, 11:17:23 PM]
[Apr 25, 2018, 9:29:31 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: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Is Sunflow limited in Sweet Home 3D?

Did you try to apply some 3D transformations on the vertices?
Studying exportLightSources in PhotoRenderer class might be helpful...
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Apr 29, 2018, 2:05:12 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
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Is Sunflow limited in Sweet Home 3D?

Yes I had tried but not as it should because I had not understood that the position of the light source is a percentage of the width, depth and height.
I applied this methodology to the vertices of my object and it works.

Since taking vertices into account is manual, only one shape is possible.

By generating a transparent or invisible 3D shape, the light panel is rendered opaque when it is turned on.

For the wired 3D shape, I realized that the object had to be already in the .obj file.

The TriangleMeshLightWithNoRepresentation class does not cause the expected effect.

----------------------------------------
EnkoNyito
[May 1, 2018, 4:37:55 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 17   Pages: 2   [ 1 2 | 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