The commands recognized by mental ray are :
version fb_list fb_list_name stream_begin ... stream_end help stop
The commands initiate the following actions in mental ray.
version
version: protocol, ray, date, type
version: 2, 3.8.0.30, Jan 1 2010, Windows NT 5.2, x86-64, 64bit
fb_list
fb_list: id, type typename, x y, ncomp bpc, stereo
fb_list: 0, 0 +rgba, 320 240, 4 8, 0 fb_list: 1, 0 +rgba, 320 240, 4 8, 0
fb_list_name
fb_list_name: id, type typename, x y, fbname, ncomp bpc, stereo
fb_list_name: 0, 0 +rgba, 320 240, 4 8, "userbuffer", 0, 0 fb_list_name: 1, 0 +rgba, 320 240, 4 8, "maincolor", 0, 0
stream_begin
idint [,
idint … ]stream_end
help
stop
The stream_begin
command is special since it starts the delivery
of frame buffer content as rectangular tiles. The data returned by mental ray
roughly follows the idea of the tile
protocol, by sending data for a rendered frame encapsulated within
frame messages marking begin and end, which contain
several rect messages for the individual tiles.
A typical sequence of returned packets will look like this :
frame_begin ... rect_begin ... rect_data ... rect_end ... rect_begin ... rect_data ... rect_end ... ... frame_endA valid data block returned by mental ray ends with a newline character. The order of the tiles is determined by mental ray task order setting. If multiple frame buffers have been requested for streaming the tiles of the different buffers are returned interspersed, in no particular order. Receiving applications should be prepared to accept tiles of any buffer at any location in the final image of the current frame. On the other hand, frames are delivered in consecutive order.
The tile stream data is delivered according to the following format.
frame_begin
frame_begin: frame xres yres, type
frame_begin: 0 1024 768, 0
rect_begin
rect_begin: xl xh yl yh, eye
rect_begin: 0 63 128 191, 1
rect_data
rect_data: bytes, xl yl xh yh, id type, width height ncomp bpc, eye\n raw_data ...
rect_data: 16384, 0 128 63 191, 0 0, 4096 192 4 8, 1 §§§§...
rect_end
rect_end: xl xh yl yh, eye
rect_end: 0 63 128 191, 1
frame_end
frame_end:
It is possible to use applications like telnet to talk to a running mental ray using the talk protocol. Here is an example session connecting to a mental ray running on the local machine. The talk port is determined by inspecting the stub file. Directly entered commands are printed as red text.
> more outputimage.png ray3.6,320,240,vibrant,49337,1.000000,17736,49338 > telnet localhost 49338 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. version version: 2, 3.8.0.30, Jan 1 2010, Windows NT 5.2, x86-64, 64bit fb_list_name fb_list_name: 0, 0 +rgba, 1024 768, 4 8, "userbuffer", 0, 0 fb_list_name: 1, 0 +rgba, 1024 768, 4 8, "maincolor", 0, 0 stream_begin 1 frame_begin: 0 1024 768, 0 rect_begin: 0 63 128 191, 1 rect_data: 16384, 0 128 63 191, 0 0, 4096 192 4 8, 1 §§§§ rect_end: 0 63 128 191, 1 rect_begin: 0 63 192 255, 1 rect_data: 16384, 0 192 63 255, 0 0, 4096 192 4 8, 1 §§§§ rect_end: 0 63 192 255, 1 rect_begin: 0 63 256 319, 1 rect_data: 16384, 0 256 63 319, 0 0, 4096 192 4 8, 1 §§§§ stream_end ^] telnet> quit >Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.