|
|
Heres my experiment with Radiosity. I've been trying to make the LEDs
brighter so that they give off more light but I must be missing a trick 'cos
as I try to brighten them ( by upping the ambient) they start getting
artifacts or artificial shadows on the lit up LEDs. The source is below and
an image attached. If you can give me a pointer on how to get brighter
reflection of the LEDs on the tabletop i would appreciate it. The code for
the LED is in the LED Macro.
BTW if anyone has any ideas on how to represent an "M" in a 3x5 grid,
suggestions welcome.
#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "stones.inc"
#include "metals.inc"
global_settings {
radiosity {
pretrace_start 0.08 // start pretrace at this size
pretrace_end 0.04 // end pretrace at this size
count 35 // higher -> higher quality (1..1600) [35]
nearest_count 5 // higher -> higher quality (1..10) [5]
error_bound 1.8 // higher -> smoother, less accurate [1.8]
recursion_limit 10 // how much interreflections are
calculated (1..5+) [3]
low_error_factor .5 // reduce error_bound during last pretrace
step
gray_threshold 0.0 // increase for weakening colors (0..1)
[0]
minimum_reuse 0.015 // reuse of old radiosity samples [0.015]
brightness 5 // brightness of radiosity effects (0..1)
[1]
adc_bailout 0.01/2
normal on // take surface normals into account [off]
media on // take media into account [off]
//save_file "file_name" // save radiosity data
//load_file "file_name" // load saved radiosity data
//always_sample off // turn sampling in final trace off [on]
//max_sample 1.0 // maximum brightness of samples
}
}
#declare SnakeWood =
texture { /* Bottom wood-grain layer */
pigment {
wood
turbulence 0.05
color_map {
[0.00 rgb <0.58, 0.45, 0.23>]
[0.34 rgb <0.65, 0.45, 0.25>]
[0.40 rgb <0.33, 0.23, 0.13>]
[0.47 rgb <0.60, 0.40, 0.20>]
[1.00 rgb <0.25, 0.15, 0.05>]
}
}
finish {
crand 0.02
//ambient 0.32
diffuse 0.63
phong 0.2
phong_size 10
}
normal { bumps 0.05 }
}
texture { /* top layer, adds small dark spots */
pigment {
bozo
color_map {
[0.0 rgbt <1.00, 1.00, 1.00, 1.00>]
[0.8 rgbt <1.00, 0.90, 0.80, 0.80>]
[1.0 rgbt <0.30, 0.20, 0.10, 0.40>]
}
scale 0.25
}
}
#macro LED(TurnedOn)
merge {
cylinder {
<0,0,0>,
<0,.3,0>,
1
}
cylinder {
<0,0,0>,
<0,1.5,0>,
0.9
}
sphere {
<0,1.5,0>,
0.9
}
texture {
pigment {
Red*0.7
}
finish {
reflection { 0.1,0.7 }
specular 0.5
#if(TurnedOn=1)
ambient 1
#else
ambient 0
#end
diffuse 1
}
}
}
#end
#macro getLEDRow(theValue)
#if(theValue = 0)
union {
object { LED(0) }
object { LED(0) translate <2.1,0,0>}
object { LED(0) translate <4.2,0,0>}
}
#end
#if(theValue = 1)
union {
object { LED(1) }
object { LED(0) translate <2.1,0,0>}
object { LED(0) translate <4.2,0,0>}
}
#end
#if(theValue = 2)
union {
object { LED(0) }
object { LED(1) translate <2.1,0,0>}
object { LED(0) translate <4.2,0,0>}
}
#end
#if(theValue = 3)
union {
object { LED(1) }
object { LED(1) translate <2.1,0,0>}
object { LED(0) translate <4.2,0,0>}
}
#end
#if(theValue = 4)
union {
object { LED(0) }
object { LED(0) translate <2.1,0,0>}
object { LED(1) translate <4.2,0,0>}
}
#end
#if(theValue = 5)
union {
object { LED(1) }
object { LED(0) translate <2.1,0,0>}
object { LED(1) translate <4.2,0,0>}
}
#end
#if(theValue = 6)
union {
object { LED(0) }
object { LED(1) translate <2.1,0,0>}
object { LED(1) translate <4.2,0,0>}
}
#end
#if(theValue = 7)
union {
object { LED(1) }
object { LED(1) translate <2.1,0,0>}
object { LED(1) translate <4.2,0,0>}
}
#end
#end
#macro getLEDLetter(theLetter)
union {
#if(theLetter = 0)
object { getLEDRow(0) }
object { getLEDRow(0) translate <0,0,-2.1>}
object { getLEDRow(0) translate <0,0,-4.2>}
object { getLEDRow(0) translate <0,0,-6.3>}
object { getLEDRow(0) translate <0,0,-8.4>}
#end
#if(theLetter = 1)
object { getLEDRow(2) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(7) translate <0,0,-4.2>}
object { getLEDRow(5) translate <0,0,-6.3>}
object { getLEDRow(5) translate <0,0,-8.4>}
#end
#if(theLetter = 4)
object { getLEDRow(3) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(5) translate <0,0,-4.2>}
object { getLEDRow(5) translate <0,0,-6.3>}
object { getLEDRow(3) translate <0,0,-8.4>}
#end
#if(theLetter = 5)
object { getLEDRow(7) }
object { getLEDRow(1) translate <0,0,-2.1>}
object { getLEDRow(3) translate <0,0,-4.2>}
object { getLEDRow(1) translate <0,0,-6.3>}
object { getLEDRow(7) translate <0,0,-8.4>}
#end
#if(theLetter = 6)
object { getLEDRow(7) }
object { getLEDRow(1) translate <0,0,-2.1>}
object { getLEDRow(3) translate <0,0,-4.2>}
object { getLEDRow(1) translate <0,0,-6.3>}
object { getLEDRow(1) translate <0,0,-8.4>}
#end
#if(theLetter = 8)
object { getLEDRow(5) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(7) translate <0,0,-4.2>}
object { getLEDRow(5) translate <0,0,-6.3>}
object { getLEDRow(5) translate <0,0,-8.4>}
#end
#if(theLetter = 12)
object { getLEDRow(1) }
object { getLEDRow(1) translate <0,0,-2.1>}
object { getLEDRow(1) translate <0,0,-4.2>}
object { getLEDRow(1) translate <0,0,-6.3>}
object { getLEDRow(7) translate <0,0,-8.4>}
#end
#if(theLetter = 14)
object { getLEDRow(7) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(5) translate <0,0,-4.2>}
object { getLEDRow(5) translate <0,0,-6.3>}
object { getLEDRow(5) translate <0,0,-8.4>}
#end
#if(theLetter = 15)
object { getLEDRow(7) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(5) translate <0,0,-4.2>}
object { getLEDRow(5) translate <0,0,-6.3>}
object { getLEDRow(7) translate <0,0,-8.4>}
#end
#if(theLetter = 16)
object { getLEDRow(7) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(7) translate <0,0,-4.2>}
object { getLEDRow(1) translate <0,0,-6.3>}
object { getLEDRow(1) translate <0,0,-8.4>}
#end
#if(theLetter = 18)
object { getLEDRow(7) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(7) translate <0,0,-4.2>}
object { getLEDRow(3) translate <0,0,-6.3>}
object { getLEDRow(5) translate <0,0,-8.4>}
#end
#if(theLetter = 19)
object { getLEDRow(7) }
object { getLEDRow(1) translate <0,0,-2.1>}
object { getLEDRow(7) translate <0,0,-4.2>}
object { getLEDRow(4) translate <0,0,-6.3>}
object { getLEDRow(7) translate <0,0,-8.4>}
#end
#if(theLetter = 20)
object { getLEDRow(7) }
object { getLEDRow(2) translate <0,0,-2.1>}
object { getLEDRow(2) translate <0,0,-4.2>}
object { getLEDRow(2) translate <0,0,-6.3>}
object { getLEDRow(2) translate <0,0,-8.4>}
#end
#if(theLetter = 21)
object { getLEDRow(5) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(5) translate <0,0,-4.2>}
object { getLEDRow(5) translate <0,0,-6.3>}
object { getLEDRow(7) translate <0,0,-8.4>}
#end
#if(theLetter = 22)
object { getLEDRow(5) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(5) translate <0,0,-4.2>}
object { getLEDRow(5) translate <0,0,-6.3>}
object { getLEDRow(2) translate <0,0,-8.4>}
#end
#if(theLetter = 25)
object { getLEDRow(5) }
object { getLEDRow(5) translate <0,0,-2.1>}
object { getLEDRow(2) translate <0,0,-4.2>}
object { getLEDRow(2) translate <0,0,-6.3>}
object { getLEDRow(2) translate <0,0,-8.4>}
#end
#if(theLetter = 27)
object { getLEDRow(0) }
object { getLEDRow(0) translate <0,0,-2.1>}
object { getLEDRow(7) translate <0,0,-4.2>}
object { getLEDRow(0) translate <0,0,-6.3>}
object { getLEDRow(0) translate <0,0,-8.4>}
#end
}
#end
#macro getLEDStream(one, two, three, four, five, six, seven,eight)
union {
object { getLEDLetter(one) }
object { getLEDLetter(two) translate <8,0,0>}
object { getLEDLetter(three) translate <16,0,0>}
object { getLEDLetter(four) translate <24,0,0>}
object { getLEDLetter(five) translate <32,0,0>}
object { getLEDLetter(six) translate <40,0,0>}
object { getLEDLetter(seven) translate <48,0,0>}
object { getLEDLetter(eight) translate <56,0,0>}
}
#end
#macro LEDBox() union {
difference {
object {
Round_Box(<-35,5,3>, < 35, 0, -13>, 1, no)
texture {
pigment {
Black
}
finish {
ambient 0
specular 0.5
roughness .002
reflection { 0.1,.5 }
diffuse 0.8
}
normal {
bumps .3
scale 0.1
}
}
}
box {
<-32.99999,6,.99999>,
<32.99999,0.99,-10.99999>
texture { T_Chrome_3B //1A
finish {
ambient 0
diffuse 0.8
}
}
}
}
box {
<-33,5,1>,
<33,4.5,-11>
texture {
pigment {
Clear
}
finish {
reflection { 0.1,1 }
specular 0.5
diffuse 0.1
ambient 0
}
}
hollow
interior {
ior 1.5
}
}
object { getLEDStream(16,15,22,27,18,1,25,0) translate
<-30,1.1,-.6>}
cylinder {
<-35,2.5,0>,
<-35.3,2.5,0>
1.5
texture {
pigment { Black }
finish {
reflection { 0,.7 }
specular 0.7
diffuse 0.1
ambient 0
}
}
}
sphere_sweep {
cubic_spline
5,
<-32,2.5,0>,0.8,
<-35,2.5,0>,0.8,
<-50,2.5,0>,0.8,
<-75,-12.5,0>,0.8
<-95,-18.5,0>,0.8
texture {
pigment { Black }
finish {
reflection { 0.1,1 }
specular 0.1
diffuse 0.6
ambient 0
}
}
}
}
#end
/*
plane { <0, 1, 0>, -0.0001
texture { SnakeWood
finish {
reflection {0.1,0.3}
specular 0.5
ambient 0
}
rotate <0,34,0>
}
}
*/
// atmospheric media can be generated by adding a media statement
// to the scene not attached to any specific object
/*
media { // atmospheric media sample
intervals 10
scattering { 1, rgb 0.03 }
samples 1, 10
confidence 0.9999
variance 1/1000
ratio 0.9
}
*/
camera { location <-30,75,-35> look_at <-5,5,0> }
background { color Black }
object { LEDBox() }
object { Round_Box(<-42,0,-17>,<100,-5,1000>,0.2,no)
texture {
SnakeWood scale 1
finish {
ambient 0
}
rotate <0,5,0>
}
texture {
pigment { color rgbf< 0.7, 0.8, 0.98,1> }
finish {
reflection {0.1,0.2}
specular 0.5
ambient 0
diffuse 0.7
}
}
}
light_source {
<40,70,-50>
colour White
spotlight point_at <-55,0,0>
tightness 50
radius 7
falloff 10
photons {
reflection on
refraction on
}
}
//cylinder { <40,70,-50>,<-55,0,0>,1 texture { pigment { Red } } }
//light_source { <0, 20, -50> color rgb <0.2, 0.25, 0.3> shadowless }
//light_source { <-70, 40, -10> color White photons { refraction on
reflection on } }
//light_source { <-70, 20, 0> color White photons { refraction on reflection
on } }
//light_source { <-35,14,3> color White photons { refraction on reflection
on } }
Post a reply to this message
Attachments:
Download 'LEDPanel2.jpg' (49 KB)
Preview of image 'LEDPanel2.jpg'
|
|