Home Technical Talk

Scanline render problem

polycounter lvl 10
Offline / Send Message
boyluya polycounter lvl 10
Hey guys, I'm doing this render setup by X-Convict but I'm having some kind of problem and i dunno how to address. Here's my system specs, 32bit xp, a core2duo, 3g of ram. The scene I am rendering consists of 9 million polys when turbosmooth is on. Here's the screenshot of the prob. Thanks.


render_prob.jpg

Replies

  • Mark Dygert
    Options
    Offline / Send Message
    Try turning the number of Rays/Samples down on Render Setup(9) > Advance Lighting Tab.

    On the Render Tab > Memory Management, check on conserve memory.

    On the common tab uncheck Rendered Frame Window. Doing this will save memory. This will still render the image to file and to the preview window. You can launch the window after its done by going to Rendering > Rendered Frame Window.

    If your spotlight is set to shadow map turn down the size in light properties > Shadow Map Params (or Tools > Light Lister). 512 or 256 can probably get the job done, going lower will start to jag the edges of shadows, you can sometimes compensate for the jag by blurring the shadows by turning up the sample range, lower numbers are sharper shadows.

    You can also attempt to set your shadow type to another method but shadow map is about as cheap as it gets.

    You could also try using Radiosity instead of Light Tracer, this calculates a light detailed light map using photons instead which is a little less memory intensive than ray tracing but is a whole new ball game. We can get into that if you decide to use it and if you have trouble... heh
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    First off you get my 2000st post

    In addition to what Vig wrote:
    1. convert your Poly with all the stack elements (i.e turbo smooth,...) to a single mesh before rendering (so its less of a footprint in the memory and fetching process for the renderer). I noticed that with extreme dense scenes converting to meshes gave me somewhat more RAM to render something.
    2. use a split render script that renders multiple smaller sections of your rendering using the blow up parameter in the render settings. This way every sub part requires less ram and all you need to do at the end is to stitch it together using either photoshop or automated using xnView and the contactSheet script.




    Here is a split render script I wrote for a super high res render project (16k x 8k stuff). It splits your total render size into several parts and saves them directly to a drive or folder that you can specify without displaying the frame buffer (which eats another amount of RAM).

    splitrendertool.png

    It will crunch down the width and height value sometimes if it doesn't fit within the split amount. Also you can define a overlapping size in pixels.

    Just save this script as some *.ms script file and run it inside 3dsmax (F11 > maxscript listerner: File > run script > ... select file). Or alternatively just paste the script into a blank maxscript document within the maxscript listener and evaluate it.
    --2009 renderhjs.net
    /*
    I wrote this script for my bachelor project in order to render very high resolotions
    (print stuff) on low memory systems. Feel free to improve or share this script :)
    
    Hendrik-Jan
    */
    SplitRender;
    
    (
    	function update_settings = (
    		
    		local c = SplitRender.splitcount.state;
    		print("c. "+c as string);
    		
    		SplitRender.width.value = floor(renderWidth / c) * c;
    		SplitRender.height.value = floor(renderHeight / c) * c;
    
    		
    		--SplitRender.filename.text ="c:\";
    		(
    			local cam = viewport.getCamera();
    			if (cam != undefined)then(
    				SplitRender.filename.text+=cam.name;
    			)else if(selection.count > 0)then(
    				cam = selection[1];
    				if (((classOf cam) == Targetcamera or (classOf cam) == Freecamera))then(
    					SplitRender.filename.text+=cam.name;
    				)
    			)
    		)
    		
    		
    		local url = (SplitRender.filename.text + 1 as string + 1 as string + SplitRender.extension.text);
    		SplitRender.txt_preview.text ="file names:";
    		
    		
    		local a = SplitRender.splitcount.state;
    		local b = a * a;
    		for i=0 to b-1 do(
    			local row = i / a
    			local col = i - floor(row) * a
    			local url = get_url_path col row;
    			SplitRender.txt_preview.text+="n"+url;
    		)
    	)
    
    	function get_url_path col row = (
    		local url = (SplitRender.filename.text +"_"+ (row as integer+1) as string +"x"+ (col as integer+1) as string+ SplitRender.extension.text);	
    		return url;
    	)
    
    	rollout SplitRender "Split Render Tool" width:250 height:371
    	(
    		radiobuttons splitcount "Pieces to split render into:" pos:[4,2] width:210 height:30 labels:#("1", "4", "9", "16", "25", "36") default:2 columns:6
    		spinner width "Total width:" pos:[18+12,33] width:120 height:16 range:[0,32000,3000] type:#integer
    		spinner height "Total height:" pos:[14+12,50] width:124 height:16 range:[0,32000,2400] type:#integer
    		spinner overlap "Pixel overlap:" pos:[10+12,67] width:128 height:16 type:#integer
    
    		edittext filename "filename" pos:[3,85] width:189 height:17
    		edittext extension ".jpg" pos:[193,85] width:64 height:17 
    		button doRender "Render this Bitch!" pos:[105,316] width:138 height:48
    		edittext txt_preview "" pos:[-1,102] width:248 height:206
    		button btn5 "preview values" pos:[140+12,33] width:108 height:34
    		label lbl1 "renderhjs.net" pos:[7,350] width:96 height:17
    		
    		on splitcount changed val do
    		(
    			update_settings();
    		)
    		on doRender pressed do
    		(
    				a = splitcount.state
    				b = splitcount.state * splitcount.state
    				-- actual render width and height
    				w = width.value  / a;
    				h = height.value / a	;		
    		
    				bm = bitmap w h
    				p = overlap.value - 1
    				
    				for i=0 to b-1 do(
    					row = i / a
    					col = i - floor(row) * a
    					local url = get_url_path col row;
    					print("ulr:t" +url+"n");
    					render renderElements:true renderType:#blowup region:#((w/a)*col,(h/a)*row,w/a*(col+1)+p,(h/a)*(row+1)+p) outputwidth:w outputheight:h outputfile:url vfb:off progressbar:on to:bm
    				)
    				unDisplay bm;
    			)
    		on btn5 pressed do
    		(
    				---make a preview rendering on a tiny size
    			splitcount.state = 1;
    			
    			
    			SplitRender.filename.text ="c:\prv\";
    			
    			local w = 320;
    			local h = (w as float / width.value as float * height.value as float) as integer;
    			
    			width.value = w;
    			height.value = h;
    			
    			
    			print("res: "+w as string+" / "+h as string);
    			update_settings();
    					
    					
    		)
    	)
    )
    -- create the rollout window and add the  rollout
    try(
    	destroyDialog SplitRender;
    )catch();
    
    --rf = newRolloutFloater "Cam switch (2009 renderhjs)" 286 400
    createDialog SplitRender 264 370
    SplitRender.overlap.value = 0;
    SplitRender.extension.text =".png";
    SplitRender.filename.text ="c:\";
    SplitRender.splitcount.state =4;
    update_settings();
    
  • boyluya
    Options
    Offline / Send Message
    boyluya polycounter lvl 10
    @Vig: Thanks man, appreciate it. I tried lowering the resolution of the shadow and the iterations of my turbosmooth and they did work. Thank you.

    @renderhjs: Thanks for sharing the script man. But I can't use it cause I'm having this error when I run it. This is what it says. I'm using max2009.

    [IMG][/img]script_prob.jpg


    Plus, is there a setting or maybe a script that will tell max or scanline on how much RAM can it use for rendering? I have a feeling that max isn't using most of the available memory. Thank you.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    fixed it:
    --2009 renderhjs.net
    /*
    I wrote this script for my bachelor project in order to render very high resolotions
    (print stuff) on low memory systems. Feel free to improve or share this script :)
    
    Hendrik-Jan
    */
    SplitRender;
    
    (
    	function update_settings = (		
    		local c = SplitRender.splitcount.state;
    		SplitRender.width.value = floor(renderWidth / c) * c;
    		SplitRender.height.value = floor(renderHeight / c) * c;
    		(
    			local cam = viewport.getCamera();
    			if (cam != undefined)then(
    				SplitRender.filename.text+=cam.name;
    			)else if(selection.count > 0)then(
    				cam = selection[1];
    				if (((classOf cam) == Targetcamera or (classOf cam) == Freecamera))then(
    					SplitRender.filename.text+=cam.name;
    				)
    			)
    		)
    		
    		
    		local url = (SplitRender.filename.text + 1 as string + 1 as string + SplitRender.extension.text);
    		SplitRender.txt_preview.text ="file names:";
    		
    		
    		local a = SplitRender.splitcount.state;
    		local b = a * a;
    		for i=0 to b-1 do(
    			local row = i / a
    			local col = i - floor(row) * a
    			local url = get_url_path col row;
    			SplitRender.txt_preview.text+="n"+url;
    		)
    	)
    
    	function get_url_path col row = (
    		local url = (SplitRender.filename.text +"_"+ (row as integer+1) as string +"x"+ (col as integer+1) as string+ SplitRender.extension.text);	
    		return url;
    	)
    
    	rollout SplitRender "Split Render Tool" width:250 height:371
    	(
    		radiobuttons splitcount "Pieces to split render into:" pos:[4,2] width:210 height:30 labels:#("1", "4", "9", "16", "25", "36") default:2 columns:6
    		spinner width "Total width:" pos:[18+12,33] width:120 height:16 range:[0,32000,3000] type:#integer
    		spinner height "Total height:" pos:[14+12,50] width:124 height:16 range:[0,32000,2400] type:#integer
    		spinner overlap "Pixel overlap:" pos:[10+12,67] width:128 height:16 type:#integer
    
    		edittext filename "filename" pos:[3,85] width:189 height:17
    		edittext extension ".jpg" pos:[193,85] width:64 height:17 
    		button doRender "Render this Bitch!" pos:[105,316] width:138 height:48
    		edittext txt_preview "" pos:[-1,102] width:248 height:206
    		button btn5 "preview values" pos:[140+12,33] width:108 height:34
    		label lbl1 "renderhjs.net" pos:[7,350] width:96 height:17
    		
    		on splitcount changed val do
    		(
    			update_settings();
    		)
    		on doRender pressed do
    		(
    				a = splitcount.state
    				b = splitcount.state * splitcount.state
    				-- actual render width and height
    				w = width.value  / a;
    				h = height.value / a	;		
    		
    				bm = bitmap w h
    				p = overlap.value - 1
    				
    				for i=0 to b-1 do(
    					row = i / a
    					col = i - floor(row) * a
    					local url = get_url_path col row;
    					print("ulr:t" +url+"n");
    					render renderElements:true renderType:#blowup region:#((w/a)*col,(h/a)*row,w/a*(col+1)+p,(h/a)*(row+1)+p) outputwidth:w outputheight:h outputfile:url vfb:off progressbar:on to:bm
    				)
    				unDisplay bm;
    			)
    		on btn5 pressed do
    		(
    			splitcount.state = 1;
    			SplitRender.filename.text ="c:\prv\";
    			
    			local w = 320;
    			local h = (w as float / width.value as float * height.value as float) as integer;
    			
    			width.value = w;
    			height.value = h;
    			update_settings();		
    		)
    	)
    )
    try(
    	destroyDialog SplitRender;
    )catch();
    createDialog SplitRender 264 370
    SplitRender.overlap.value = 0;
    SplitRender.extension.text =".png";
    SplitRender.filename.text ="c:\";
    SplitRender.splitcount.state =4;
    update_settings();
    
  • boyluya
    Options
    Offline / Send Message
    boyluya polycounter lvl 10
    Ok I tried the new one, but still got some error.

    [IMG][/img]script_prob2.jpg
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    ok I figured out what it is, the builltin board here rapes my script and changes some \ \ characters to just single \ which causes some string escape errors. Just download it here in its original form:
    www.renderhjs.net/bbs/polycount/tips/split_render_01_renderhjs.ms
    (fucking BB)
    edit: updated script again
  • boyluya
    Options
    Offline / Send Message
    boyluya polycounter lvl 10
    Wow thanks a lot man! This is a great script! Already got it working. Though I have one more problem. When I'm about to stitch them in photoshop, I noticed that the split images don't match each other. There are tiny parts missing in the area where the splits are. I feel it's caused by the settings. Can you please show me how to do it right? Thank you man, I owe you a lot.


    Edit: Plus it only renders a few parts of the render elements(alpha, zdepth) that I added.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    use the pixelOverlap value to add more padding to the rendering so they share more pixels - and it should be easier for you to stitch it together in PS.
    As for the element stuff yes thats true - I just stripped that script out of a more complex one that rendered zDepth and other passes for me, so its kind of focused on that right now.
    but if you change the line:
    render renderElements:true renderType:#blowup region:#((w/a)*col,(h/a)*row,w/a*(col+1)+p,(h/a)*(row+1)+p) outputwidth:w outputheight:h outputfile:url vfb:off progressbar:on to:bm
    
    to:
    render renderType:#blowup region:#((w/a)*col,(h/a)*row,w/a*(col+1)+p,(h/a)*(row+1)+p) outputwidth:w outputheight:h outputfile:url vfb:off progressbar:on to:bm
    
    (removed "renderElements:true") and then it should render the regular way.
  • boyluya
    Options
    Offline / Send Message
    boyluya polycounter lvl 10
    Big thanks man!
  • arrangemonk
    Options
    Offline / Send Message
    arrangemonk polycounter lvl 15
    does this script work with brazil rio? :D
Sign In or Register to comment.