Lightflow Gi test/problem


(hannibar) #1

http://users.pandora.be/willem.packet1/lfgi.html

As you can see there are black spots on the mesh. What could be the problem?

This is what I did.

  1. I added text, converted to curve, bevelled, and converted to mesh.
  2. Added a plane, two spotlights on the left of the text.
  3. Set world light option.
  4. Adjusted the radiosity settings (see code)

Nothing is wrong with the normals.

from lightflowPM import *

s = scene()

s.newInterface( 'default', [
		 'displacement', 0, 'shadows', 1, 'volumes', 0,
		 'trace-depth', 1,
		 'radiosity-depth', 1, 0,
		 'radiosity-samples', 100,
		 'radiosity-threshold', 0.100000,
		 'radiosity-reuse-distance', 0.020000, 0.004000, 0.001000,
		 'radiosity-sampling', 'stratified',
		 'lighting-accuracy', 0.980000,
		 'lighting-count', 1,
		 'lighting-depth', 5,
		 'lighting-threshold', 0.050000,
		 'photon-count', 300000,
		 'photon-clustering-count', 2000, 100
	 ] )

s.lightOn(s.newLight('soft-conic', [
		 'position', vector3(-20.272980, -14.195292, 24.748739),
		 'direction', vector3(0.579228, 0.405580, -0.707107),
		 'color', vector3(800.000000, 550.649357, 436.363649), 'radius', 0.045000,
		 'angle', 0.363247, 0.392699
	 ] ) )

s.lightOn(s.newLight('soft-conic', [
		 'position', vector3(-24.748737, 0.000000, 24.748739),
		 'direction', vector3(0.707107, 0.000000, -0.707107),
		 'color', vector3(1200.000000, 1168.831158, 950.649333), 'radius', 0.045000,
		 'angle', 0.363247, 0.392699
	 ] ) )

WORLD_LIGHT = s.newMaterial( 'standard', [ 'ka', vector3(1.100000, 0.900000, 0.800000), 'kc', vector3(0.0, 0.0, 0.0), 'kd', 0.0, 'shadowing', 0.0 ] )

Plane = s.newMaterial( 'standard', [ 'kc', vector3(0.800000011921, 0.800000011921, 0.800000011921), 'kd', 0.750000, 'ksg', 0.250000, 'km', 0.335213, 'radiosity', 1 ] )

Bol = s.newMaterial( 'standard', [ 'kc', vector3(1.0, 1.0, 1.0), 'kd', 0.750000, 'ksg', 0.250000, 'km', 0.335213, 'radiosity', 1 ] )

s.materialBegin(WORLD_LIGHT)
s.addObject( s.newObject( 'sphere', [ 'radius', 50.000000 ] ) )
s.materialEnd()


#### START MESH: Plane
s.transformBegin(transform().translation( vector3(0.000000, 0.000000, 0.000000) ))
s.transformBegin(transform().rotationAroundZ( 0.000000 ) )
s.transformBegin(transform().rotationAroundY( 0.000000 ) )
s.transformBegin(transform().rotationAroundX( 0.000000 ) )
s.transformBegin(transform().scaling( vector3(56.454304, 56.454304, 56.454304) ))

s.materialBegin(Plane)
s.addObject( s.newObject( 'mesh', [ 'file', 'Plane.mesh', 0] ) )
s.materialEnd()

s.transformEnd()
s.transformEnd()
s.transformEnd()
s.transformEnd()
s.transformEnd()
### END MESH: Plane


#### START MESH: Text
s.transformBegin(transform().translation( vector3(0.000000, 0.000000, 0.000000) ))
s.transformBegin(transform().rotationAroundZ( 0.000000 ) )
s.transformBegin(transform().rotationAroundY( 0.000000 ) )
s.transformBegin(transform().rotationAroundX( 1.570796 ) )
s.transformBegin(transform().scaling( vector3(4.200322, 4.200322, 4.200322) ))

s.materialBegin(Bol)
s.addObject( s.newObject( 'mesh', [ 'file', 'Text.mesh', 0] ) )
s.materialEnd()

s.transformEnd()
s.transformEnd()
s.transformEnd()
s.transformEnd()
s.transformEnd()
### END MESH: Text


saver = s.newImager('tga-saver', [ 'file', 'radio_lf_0001.tga', 'alpha', 0, 'depth', 0])

s.imagerBegin( saver )

camera = s.newCamera( 'pinhole', [
		 'eye', vector3(-4.806194, -6.937747, 6.721327),
		 'aim', vector3(-4.396618, -6.228340, 6.147751),
		 'up', vector3(0.286788, 0.496732, 0.819152),
		 'aa-samples', 2, 4, 'aa-threshold', 0.250000, 'aa-jitter', 0.500000,
		 'fov', 0.660595
	 ] )

s.imagerEnd()

s.radiosity()
s.render(camera, 640, 480)

(S68) #2

Weird, never got such artifacts

radiosity depth 1,0 is low, eeshlo suggest 4,4, I go with 6,6

have tried?

Stefano


(hannibar) #3

yea, I tried that, but it doesn’t give a difference.


(eeshlo) #4

You probably have to adjust the autosmooth value. It looks typical of an object without autosmooth applied or with a too high autosmooth setting.


(hannibar) #5

I’ll try that. You’ll see the result in an hour :smiley:

thanks


(eeshlo) #6

Just render at a smaller resolution without radiosity, if it is autosmooth which is the problem, you should still see the same effect.


(hannibar) #7

I did a small test render (took about 5 minutes with radiosity), and it’s much better now, no artifacts anymore.

Thanks


(hannibar) #8

Update :

http://users.pandora.be/willem.packet1/lfgi.html

Much better now.


(fullback) #9

You need to increase the autosmooth on the “S” character. Otherwise, fantastic job Hans.


(hannibar) #10

Otherwise, fantastic job Hans.

Hey, you know my name! :smiley:

Thats not really a fantastic job imo. I just love GI renders, and I wondered how it would look with my name. Thanks anyway :slight_smile:


(gargola) #11

hey! i agree ,great job there! :smiley: