|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi!
I'll have to render like 100 images using povray from inside a c++ program.
Ideally, I would like to get raw data in a buffer (instead of a png file.
Maybe get the png file in memory and not in a file, so that I don't have to
waste time reading the file) but I don't know if it's possible. If not, no
big deal, but I don't know how to find out when the rendering is over, so I
can start the next rendering.
Anyone could help me or point me to a tutorial or something on the subject?
Thanks,
Cesar
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Sun, 27 Mar 2005 17:09:04 -0500, Cesar wrote:
> I'll have to render like 100 images using povray from inside a c++ program.
> Ideally, I would like to get raw data in a buffer (instead of a png file.
> Maybe get the png file in memory and not in a file, so that I don't have to
> waste time reading the file) but I don't know if it's possible. If not, no
> big deal, but I don't know how to find out when the rendering is over, so I
> can start the next rendering.
I had to do the same once. Here is how it works, in my case :
_ i create 2 pipes : 1 for povray text output ( to catch error messages,
stats etc... ) and 1 for image raw data.
_ i launch povray with +GApipe1 +Opipe2 +FP
_ i also launch 2 threads to read each pipe
You know render is over when you got all image data, but you have to
relaunch povray for each image ( you can use the same pipes i think ). I
guess you can do without threads if you don't need to catch error message,
cancel render etc... it would be really more simple :)
Bye.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I had to do the same once. Here is how it works, in my case :
> _ i create 2 pipes : 1 for povray text output ( to catch error messages,
> stats etc... ) and 1 for image raw data.
> _ i launch povray with +GApipe1 +Opipe2 +FP
> _ i also launch 2 threads to read each pipe
>
> You know render is over when you got all image data, but you have to
> relaunch povray for each image ( you can use the same pipes i think ). I
> guess you can do without threads if you don't need to catch error message,
> cancel render etc... it would be really more simple :)
Tks for answering. I don't get it. What do you mean by 2 pipes? How do I
separate text output from the data (if I understood correctly)? At first I
won't need to catch error msgs, so I can use the "really more simple"
version, but I'm interested in the more complex one too. :o)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 28 Mar 2005 07:53:34 -0500, Cesar wrote:
> Tks for answering. I don't get it. What do you mean by 2 pipes? How do I
> separate text output from the data (if I understood correctly)? At first I
> won't need to catch error msgs, so I can use the "really more simple"
> version, but I'm interested in the more complex one too. :o)
Pipes are special files created by mkfifo function ( and some others ones ).
They are used to communicate between two programs. The first one ( pov )
writes to the pipe, the second one read in ( your program ). So you invoke
pov with '+GApipe1 +Opipe2 +FP' and pov writes all text stuff ( stats,
errors, warnings... ) to pipe1 and image data ( here ppm data ) to pipe2.
Then you have 2 threads, each of them reading a pipe. Not really easy, and
certainly the simplest solution, but it works !
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Ok. I now create the pipe and set it as the povray output. In my program,
after I create the pipe I fork() and run povray in the child, while in the
parent I read the pipe. But now I get the following error:
Possible Rendering Error: Got 1 SIGPIPE.
I presume it has something to do with the synchronization between reading
from and writing to the pipe, but I can't figure out what's wrong. Can you
help me with that?
Thanks
Vincent LE PRINCE <vin### [at] nospamwanadoofr> wrote:
> On Mon, 28 Mar 2005 07:53:34 -0500, Cesar wrote:
>
> > Tks for answering. I don't get it. What do you mean by 2 pipes? How do I
> > separate text output from the data (if I understood correctly)? At first I
> > won't need to catch error msgs, so I can use the "really more simple"
> > version, but I'm interested in the more complex one too. :o)
>
> Pipes are special files created by mkfifo function ( and some others ones ).
> They are used to communicate between two programs. The first one ( pov )
> writes to the pipe, the second one read in ( your program ). So you invoke
> pov with '+GApipe1 +Opipe2 +FP' and pov writes all text stuff ( stats,
> errors, warnings... ) to pipe1 and image data ( here ppm data ) to pipe2.
> Then you have 2 threads, each of them reading a pipe. Not really easy, and
> certainly the simplest solution, but it works !
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Cesar <ces### [at] terracombr> wrote:
> Possible Rendering Error: Got 1 SIGPIPE.
The SIGPIPE signal is thrown when a process writes to a pipe but
there's no process reading it (ie. there's no process which has that
pipe open in read mode). This can only happen if the reader process
closes the pipe (or is killed or whatever) because the pipe cannot
be opened in write mode unless it's already opened in read mode by
something else.
--
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 30 Mar 2005 15:42:58 -0500, Warp wrote:
> The SIGPIPE signal is thrown when a process writes to a pipe but
> there's no process reading it (ie. there's no process which has that
> pipe open in read mode). This can only happen if the reader process
> closes the pipe (or is killed or whatever) because the pipe cannot
> be opened in write mode unless it's already opened in read mode by
> something else.
That's right. You have to create/open the pipe before launching pov. You
can also receive a sigpipe if pipe buffers are full, i.e if the read
process don't read it.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|