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.
- I added text, converted to curve, bevelled, and converted to mesh.
- Added a plane, two spotlights on the left of the text.
- Set world light option.
- 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)