## My Fluid Simulator + LuxRender --> possible?

General discussion regarding exporter development in general.

Moderators: Ratow, coordinators

### My Fluid Simulator + LuxRender --> possible?

Hello everyone,

I'm currently writing my first fluid simulation program and I'd like to use LuxRender so I can get realistic rendering results.

Basically, I'd like to do the following:

-Have my program do all the calculations regarding the motion of the fluid [e.g. water, smoke, etc].
-The data calculated is fed into LuxRender for rendering purposes.
-The process is repeated for every frame.

Note that the final result would be a video which shows the movement of the fluid in question.

But, I need help on doing so. Can this be done?

I've looked around the documentation and there weren't a lot of info regarding something like this. The closest I've found was the LuxRender file format and the mention of some API function, but no docs on them.

Your help will be greatly appreciated

P.S. Hope I got the right section to post my question! This one seemed the most appropriate and technically speaking, it is a Exporter

P.S.S. Also, I'm pretty new to LuxRender. I just found out about it a few hours ago, so please take that into consideration when answering
--
Lulzy
Lulzy

Posts: 3
Joined: Sat May 01, 2010 1:30 am

### Re: My Fluid Simulator + LuxRender --> possible?

Export the fluid mesh on each frame to a separate file, then use LuxRender to render these files one at a time. There is nothing complicated here. The same thing is possible with Blender's fluidsim.

If you need to know the exported format, you can find Lux Scene Documentation Language reference here. And you could use LuxBlend exporter as a further reference.
Linux builds packager

SATtva

Posts: 5498
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

### Re: My Fluid Simulator + LuxRender --> possible?

The documentation for LuxRender's python bindings pylux are here: http://www.luxrender.net/static/pylux/
I hope to add more method descriptions etc over the weekend.

Even though this describes Lux's API in python terms, the C API operates in much the same way, as pylux is a boost::python wrapper around the C API. If you prefer to work in C, looking at python/bindings.cpp in the Lux source tree would probably give you some hints.

dougal2

Posts: 3074
Joined: Mon Jan 14, 2008 7:21 am

### Re: My Fluid Simulator + LuxRender --> possible?

Thank you for your quick replies.

If I was to first create all the LuxRender files containing information for each frame, is there the possibility of LuxRender to take all the files and create a video? I know that LuxRender can render every file individually, but since there are going to be a number of files, it would be nice if it just merged them all together.

Also, are some template scene files available? My scene is suppose to be simple, just containing a few boxes and the fluid mesh. This would be a huge thing for me, as I start working with LuxRender quickly

Regarding the API functions: I'm working in C/C++. I've checked out the link you've provided and it contains descriptions of a number of classes, functions, etc. But, are there any simple tutorials for beginners? The documentation seems fine, but it's a big encyclopedia I'm not sure where to start.
Lulzy

Posts: 3
Joined: Sat May 01, 2010 1:30 am

### Re: My Fluid Simulator + LuxRender --> possible?

Lulzy wrote:If I was to first create all the LuxRender files containing information for each frame, is there the possibility of LuxRender to take all the files and create a video?

No, it's not a task for the renderer. A renderer just takes a scene file and spits out an image file when it's done. To convert all image files into a video, there is nothing fancy with a number of tools available. I personally prefer mencoder:

Code: Select all
mencoder "mf://*.png" -mf fps=30 -o video.avi -ovc lavc -lavcopts vcodec=ffvhuff
Linux builds packager

SATtva

Posts: 5498
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

### Re: My Fluid Simulator + LuxRender --> possible?

Thanks for the reply, SATtva. It appears that mencoder will be useful

Since LuxRender cannot create a video, can LuxRender pick up all the text files from a folder and render them, without me manually having to click on every file? I'm asking because if I make my program to create a file for each frame of the simulation and my simulation run on e.g. 30 frame per second, even a minute of the simulation would have 1800 files, which are unpractical to select each one manually. And that's only one minute. If i create longer simulation, the problems also grows.

Just to add, the question of some sample scenes is still a question It would be a great help if I could find such, since my scene is simple, just a few boxes in the room plus the fluid mesh that I would generate.

The API question [see my previous post] also remains a mystery
Lulzy

Posts: 3
Joined: Sat May 01, 2010 1:30 am

### Re: My Fluid Simulator + LuxRender --> possible?

I'm afraid there isn't much API documentation at all. The only thing I can say is that the API is somewhat similar to RiSpec. Reading the official RiSpec document should help you understand some of the functions, however Lux has many that are not found in RiSpec.

https://renderman.pixar.com/products/ri ... pec3_2.pdf

With regards to rendering multiple files; I'm sure if you can code a fluid sim, that you can come up with a .bat file or shell script

dougal2

Posts: 3074
Joined: Mon Jan 14, 2008 7:21 am