Print at Jul 8, 2020, 2:30:54 AM
Posted by Moxi at Nov 18, 2013, 10:28:57 PM
confused   Rendering on Windows Server 2008 Possible?
Hi,

i love to use SH3D, my Problem is that i want to use all of the Xeon CPU Cores on a Windows 2008 Server.

For some stupid reasons this is not possible because Java3d cannot create a RenderInterface for th 3d Hardware accelerated Preview Window.

Is there a Way to run the Raytrace Render without starting the Program itself?

Like Saving the Camera Position and then Starting the Render Process?

I would love to hear an Answer.

Best Regards

Moxi smile

Posted by Puybaret at Nov 19, 2013, 5:57:21 PM
Re: Rendering on Windows Server 2008 Possible?
There's no "stupid reasons" as you say, only kind volunteers who maintain Java 3D as they can, and RenderInterface is probably not on their priority list. sad
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by Moxi at Nov 19, 2013, 7:25:01 PM
Re: Rendering on Windows Server 2008 Possible?
Sorry i think you got this wrong, what i mean with stupid reason is:

SH3d cannot create a Render interface beacause the Server has no Hardwareaccelerated Graphics card -> Ergo the 3d Interface cannot be Created.

Because of that, i want to know if there is a way to Let a Sh3d-map to be rendered from console without starting the Main Program.

This wasnt meant to insult any Java3d Coder =)

Posted by Puybaret at Nov 20, 2013, 11:11:46 AM
Re: Rendering on Windows Server 2008 Possible?
To render a sh3d file from the console, please read this thread.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by Moxi at Nov 21, 2013, 4:28:53 PM
applause   Re: Rendering on Windows Server 2008 Possible?
Oh you are the best smile this is what i was looking for love struck.

There is only one Problem, i dont know how to use it.

I Saved the Script in an File Called ConsolePhotoGenerator.Java and then started it via javac.exe ConsolePhotoGenerator.java

But it then it says package org.sunflow.system.ui does not exist.

Would you please help an neeewbie =)

Posted by Moxi at Nov 21, 2013, 8:15:49 PM
Re: Rendering on Windows Server 2008 Possible?
Hi,

okay i have read something about Java compiling, so i did

javac.exe -cp sunflow-0.07.3h.jar;SweetHome3D.jar ConsolePhotoGenerator.java

javac.exe did create ConsolePhotoGenerator.java

then i tried

Java.exe ConsolePhotoGenerator.java but it says Java can not find the Mainclass for ConsolePhotoGenerator.java.

What can i do?

Posted by Puybaret at Nov 26, 2013, 9:29:40 PM
Re: Rendering on Windows Server 2008 Possible?
javac.exe did create ConsolePhotoGenerator.java
I have some doubts about this. It should have created ConsolePhotoGenerator.class file. To simplify its use, remove the first line package com.eteks.sweethome3d.utilities; from the source code, and compile it again.

The java command is followed by a class name, not a file, i.e. the basic command must be:
java.exe ConsolePhotoGenerator

But you also need to add to the class path all the libraries required to execute that class! If you host the ConsolePhotoGenerator.class file generated by javac in the subdirectory lib of Sweet Home 3D installation directory, then the command should look like this:
java -cp lib;lib/SweetHome3D.jar;lib/Loader3DS1_2u.jar;lib/sunflow-0.07.3h.jar;lib/batik-svgpathparser-1.7.jar;lib/j3dcore.jar;lib/j3dutils.jar;lib/vecmath.jar
-Djava.library.path=lib -Xmx640m ConsolePhotoGenerator
if run from the Sweet Home 3D installation directory. Add at the end of this command the path of the sh3d file and the path where the image should be saved.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by Moxi at Dec 2, 2013, 7:28:26 PM
Re: Rendering on Windows Server 2008 Possible?
Superb,

i will try this as fast as i can and tell you if it worked!

smile

Thank you very much

Posted by Puybaret at Feb 3, 2017, 6:08:47 PM
Re: Rendering on Windows Server 2008 Possible?
Note that Java 3D 1.6 allows also to run ConsolePhotoGenerator on a Linux server with no X11 Display, if you set the j3d.rend system property to noop .
If you use Sweet Home 3D 5.4, please follow the following instructions:
- Install JDK
- Copy / paste ConsolePhotoGenerator class to a file named ConsolePhotoGenerator.java
- Download SweetHome3D-5.4jar, sunflow-0.07.3i.jar, j3dcore.jar, j3dutils.jar, vecmath.jar and batik-svgpathparser-1.7.jar

- Compile ConsolePhotoGenerator.java with the following command:
javac -cp SweetHome3D-5.4.jar:sunflow-0.07.3i.jar -d . ConsolePhotoGenerator.java

- To generate the file photo.png of a home stored in the file home.sh3d , run the command:
java -Dj3d.rend=noop -cp .:SweetHome3D-5.4.jar:sunflow-0.07.3i.jar:j3dcore.jar:vecmath.jar:j3dutils.jar:batik-svgpathparser-1.7.jar com.eteks.sweethome3d.utilities.ConsolePhotoGenerator home.sh3d photo.png

[Updated links on 2020/03/02 after source code moved from CVS to SVN]
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by kareem613 at Feb 8, 2017, 2:10:00 AM
Re: Rendering on Windows Server 2008 Possible?
This is great.
Is there a way to have it render the photos from points of view?
Does the HomeEnvironment object provide that collection?

Posted by kareem613 at Feb 8, 2017, 1:33:14 PM
Re: Rendering on Windows Server 2008 Possible?
hmm. All the jars in place and having compiler errors. It's been a while since dealing with java classpaths. Am I missing something?

Directory: C:\data\basement\app


Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2017-02-07 9:12 PM 40506 batik-svgpathparser-1.7.jar
-a---- 2017-02-07 9:30 PM 2309 ConsolePhotoGenerator.java
-a---- 2017-02-07 9:12 PM 2847226 j3dcore.jar
-a---- 2017-02-07 9:12 PM 1675815 j3dutils.jar
-a---- 2017-02-07 9:12 PM 348010 sunflow-0.07.3i.jar
-a---- 2017-02-07 9:14 PM 25917844 SweetHome3D-5.4.jar
-a---- 2017-02-07 9:12 PM 314362 vecmath.jar


C:\data\basement\app> javac -cp SweetHome3D-5.4.jar:sunflow-0.07.3i.jar -d . ConsolePhotoGenerator.java
ConsolePhotoGenerator.java:26: error: package org.sunflow.system does not exist
import org.sunflow.system.UI;
^
ConsolePhotoGenerator.java:27: error: package org.sunflow.system.ui does not exist
import org.sunflow.system.ui.ConsoleInterface;
^

Posted by Puybaret at Feb 8, 2017, 3:05:28 PM
Re: Rendering on Windows Server 2008 Possible?
Under Windows, you must replace : separators by ;

About rendering photos at the stored points of view returned by the method getStoredCameras in Home class, you could replace the following two lines in ConsolePhotoGenerator.java:

renderer.render(image, home.getCamera(), null);
ImageIO.write(image, homePhoto.substring(homePhoto.lastIndexOf('.') + 1), new File(homePhoto));

by:

for (Camera camera : home.getStoredCameras()) {
renderer.render(image, camera, null);
int dotIndex = homePhoto.lastIndexOf('.');
String cameraPhoto = homePhoto.substring(0, dotIndex) + "-"
+ camera.getName().replaceAll("/|\\\\|:|;", "-").replace(File.pathSeparatorChar, '-').replace(File.separatorChar, '-')
+ homePhoto.substring(dotIndex);
ImageIO.write(image, homePhoto.substring(dotIndex + 1), new File(cameraPhoto));
}

and you should import com.eteks.sweethome3d.model.Camera class.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by brute4c at Feb 27, 2020, 9:36:07 AM
Re: Rendering on Windows Server 2008 Possible?
Hello,
in he first place I want to thank You for developing such a nice tool.

I'm also trying to run the render in headless mode with SW3D 6.2 on a linux machine. I have fallowed You guide, but unfortunately I'm getting
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:294)
error when trying to run it on a server. I have found Your post on jogamp about editing VirtualUniverse.java class, but I'm afraid it's to difficult for me. Are You able to provide modified version of j3dcore.jar just to make it more available to use it by broader group of people?

Posted by Puybaret at Feb 27, 2020, 3:01:27 PM
Re: Rendering on Windows Server 2008 Possible?
Are you sure you added the -Dj3d.rend=noop option, as explained in my post of February 3rd, 2017?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by brute4c at Feb 27, 2020, 4:17:22 PM
Re: Rendering on Windows Server 2008 Possible?
Yes I did. I had to edit j3dcore.jar and I was able to successfully render photos with default values. After setting property
-Dcom.eteks.sweethome3d.j3d.PhotoRenderer.highQuality.globalIllumination=path
console is flooded with warnings:
LIGHT warn : NaN shading sample!

so I'm not sure if it's actually rendering anything. Is there a way to resolve this issue or at least disable the warning?

Posted by brute4c at Mar 2, 2020, 4:39:36 PM
Re: Rendering on Windows Server 2008 Possible?
Just for the record, I have fallowed those steps to edit class in j3dcore.jar https://stackoverflow.com/a/14069149/9931119
and replaced the if statement according to Your instructions: http://forum.jogamp.org/template/NamlServlet....ser_nodes&user=495956

This allowed me to run sh3d render with the -Dj3d.rend=noop option. Unfortunately it's only working for the AO + Photon Mapping, when trying to render with Path option I'm getting a lot of warnings and in the end the output image is just black.

I would also like to use a option from PVR 1.9 to enable sky light but I don't have an idea how I can use the plugin in headless mode. Is there any way to do it?

Posted by Puybaret at Mar 2, 2020, 6:11:15 PM
Re: Rendering on Windows Server 2008 Possible?
You shouldn’t have to recompile Java 3D jars if you use the ones available here (actually, I just discovered that the links in my post of February 2017 have been out of date, since SourceForge.net forced me to move from CVS to SVN, but I just updated them).

I never tried to render an image with a plugin on a server but don’t see a reason why it couldn’t run. Did you try to render your image with the GUI first? And did you try with Sweet Home 3D 6.2 Jar?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by Gian1 at Apr 13, 2020, 3:57:36 PM
Re: Rendering on Windows Server 2008 Possible?
Greetings. I'd like to present a wish list, ordered by importance:

  • incremental output image name in case of homonymy to avoid overwriting existing images, and/or automatic output folder creation for each rendered .sh3d file;
  • rendering queue composed of a list of .sh3d files;
  • ability to use rendering engines other than the default Sunflow, and to change the engine;
  • ability to change rendering settings, including time of the day, lens type, and ceiling lights.

Much obliged.

Posted by Puybaret at Apr 28, 2020, 4:34:35 PM
Re: Rendering on Windows Server 2008 Possible?
Gian1, Sweet Home 3D API will let you make these changes. Feel free to contribute to ConsolePhotoGenerator improvements.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer