
'
' Test of render settings
'


'
' Get the current lightmap renderer
'
Local r:TLightmapRenderer = LightmapRenderer()


'
' Set a few different options
'

r.SetDirectMultiply( 1.0 )
r.SetAntiAliasEnabled( True )


'
' Get the current GI Renderer, and display the settings
'

Local g:TGIRenderer = r.GetGIRenderer()

If g = Null

	Print "No GI renderer"

ElseIf TAmbOccRenderer(g)<>Null

	Print "Ambient Occlusion"

	Local a:TAmbOccRenderer = TAmbOccRenderer(g)
	
	Print "Ignore Textures    = "+a.GetIgnoreTextures()
	Print "Ray Distance       = "+a.GetRayDistance()
	Print "Rays Per Sample    = "+a.GetRaysPerSample()
	Print "Use Ambient Lights = "+a.GetUseAmbientLights()


ElseIf TPathTraceRenderer(g)<>Null

	Print "Path Tracer"

	Local p:TPathTraceRenderer = TPathTraceRenderer(g)

	Print "Ignore Textures = "+p.GetIgnoreTextures()	
	Print "Light Bounces   = "+p.GetLightBounces()
	Print "Rays Per Sample = "+p.GetRaysPerSample()

EndIf


'
' Set the current GI renderer to the Path Tracer
'

r.SetGIRenderer( new TPathTraceRenderer )

'
' Set the parameters for the Adaptive Sub Division 
'
r.SetAdaptiveSubDivEnabled(True)
r.SetSubDivContrast(0.05) ' = 5%
r.SetMaxSubDiv(16)
r.SetMinSubDiv(4)


'
' And finally render the scene
'
' Lightmaps that need packing are automatically packed
'

Print "Now rendering..."

r.Render()

Print "Done!"



'
' You can pack a ligthmap manually.. If you do this
'
' lightmap.SetPackAgain(True)
' PackLightmap( lightmap )
'

