PDA

View Full Version : changing output format from .bmp to .exr


pd
12-02-2007, 10:17 AM
Hi,

I'm using a script to split a high resolution render in smaller chunks, so that I don't run out of memory. It works quite well, but it saves only to .bmp. What would be really nice is, if I could change this to .exr. I've tried replacing everything 'bmp' with 'exr' but it didn't work, so I guess it takes something more to do this.


-------------------------------------
--- BIGRENDER ---
-------------------------------------
-- Make a "infinite" render without--
-- memory problems and compose it --
-- after rendering. --
-------------------------------------
-- Author : Tomas Cayuela --
-- August 2003 --
-- tomasc@salleurl.edu --
-------------------------------------

plugin RenderEffect BIGRend
name:"BIGRender"
classID:#(6545,456581)
version:1
(
rollout params "BIGRender Parameters" (
group "Output Size" (
spinner tamH "Width: " align:#left range:[0,99999,5000] type:#integer fieldWidth:50
spinner tamV "Height:" align:#left range:[0,99999,5000] type:#integer fieldWidth:50
)
group "Subdivision"(
spinner subdivH "Subdivide Horizontal by: " align:#left range:[1,20,20] type:#integer fieldWidth:40
spinner subdivV "Subdivide Vertical by: " align:#left range:[1,20,20] type:#integer fieldWidth:40
)
group "Render"(
button filsav "Save as..."
checkbox vf "Display Renders" checked:false
edittext akita "" enabled:false
button rend "RENDER" enabled:false
label tantode "0/0" align:#left
progressBar barra
)
group "About"(
label sobre "BIGRender"
label sobre1 "Tomas Cayuela Caudevilla"
label sobre3 "Discreet Training Instructor"
label sobre2 "tomasc@salleurl.edu"
label sobre4 "This Plugin is FREEWARE"
)
on filsav pressed do(
filenam=getSaveFileName caption:"Save as:" types:"OpenEXR Image File(*.exr)|*.exr|"
akita.text=filenam
rend.enabled=true
)
on rend pressed do(
barra.value=0
prog=0
rend.enabled=false
sH=tamH.value/subdivH.value
sV=tamV.value/subdivV.value
for j=1 to subdivV.value do(
for i=1 to subdivH.value do (
if keyboard.escPressed then exit
a=(j-1)*sV
b=(i-1)*sH
c=j*sV
d=i*sH
indexH=i-1
indexV=j-1
arx_nom=getfilenameFile akita.text
arx_path=getfilenamePath akita.text
arxiu = arx_path + arx_nom + indexV as string + "_" + indexH as string + ".exr"
render vfb:vf.checked outputfile:arxiu outputwidth:tamH.value outputheight:tamV.value renderType:#crop region:#(b,a,d,c)
barra.value=barra.value+(100.0/(subdivH.value*subdivV.value))
prog=prog+1
prog2=subdivH.value*subdivV.value
progf=prog as string + "/" + prog2 as string
tantode.text=progf
)
barra.value=barra.value+(100.0/(subdivH.value*subdivV.value))
)
barra.value=100
)
)
)


Any kind of help or any pointer in the right direction is much appreciated. Thanks in advance!


edit: I'm using R9 by the way and I'm aware that I could also contact the author of this script. However, I'm not sure if he provides support for this, because he now sells a newer version of this script, which is obviously no longer freeware.

Jsnyder
12-03-2007, 06:40 PM
Hmmm i'm not sure what problem you're having, but i just copied and pasted what you have there, ran it in max 9 and 2008 and both saved my images out as .exr files and opened each image in photoshop just fine.

Have you made sure the script isn't loaded in max with the old version? Try changing the name to bigrender2 so it creates a new effect in your render effects, and isn't just trying to over right the old one but failing.

pd
12-03-2007, 07:13 PM
Thanks a lot for your input!

I should have stated what exactly isn't working, sorry. While I got the script to save as an .exr it somehow wasn't really an .exr. It opened fine in photoshop, but the file size was smaller than, when I would save it by myself using the vfb. As a result the image didn't have the value range it should have. For example, I have tested this with a simple scene, which has an area that is over exposed. With the version I saved out myself, I can easily turn down the exposure and everything looks as expected. With the version, saved by the script the same process will show a flat looking area. Please see the attached pictures.

pd
12-03-2007, 07:22 PM
I've just isolated the problem somewhat. I was using VRays vfb to save this .exr(the first row, the one that worked fine). When using Bigrender, I've disabled it and rendered without a vfb at all.

Now, if I'm using Max's native vfb to save out the render I get the same problem. The resulting image simple doesn't have a HDR.

edit: Having VRays vfb activated and using Bigrender to save the .exr still does not work. So the problem is either Max's vfb itself or VRay not 'translating' its output to the Max vfb correctly.

Bobo
12-03-2007, 08:43 PM
Now we are talking :)

The script uses the render() method which calls the renderer and gets the resulting portional bitmap back from it. By default, MAXScript gets these bitmaps as 8bpc images, so each color is in the range from 0 to 255.



To get the render() method to work with 32bit floating point data, you have to add the switch:

[ outputHDRbitmap:<boolean> ]

When set to true, the new 32 bit floating-point frame buffer will be used. When set to false or not supplied, the standard frame buffer will be used. Available in 3ds Max 8 and higher.




So try changing the line

render vfb:vf.checked outputfile:arxiu outputwidth:tamH.value outputheight:tamV.value renderType:#crop region:#(b,a,d,c)


to

render vfb:vf.checked outputfile:arxiu outputwidth:tamH.value outputheight:tamV.value renderType:#crop region:#(b,a,d,c) outputHDRbitmap:true

pd
12-03-2007, 10:27 PM
Thanks for jumping in Bobo :)

It works like a charm now. It would have taken me ages to figure this out by myself, if I would have been able to figure it out at all. So thanks again. I hope being able to return the favor one day.

Jsnyder: Thanks again for your effort as well.

CGTalk Moderation
12-03-2007, 10:27 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.