Page 1 of 6
random hemisphere (tlrcam related
Posted: Sun Aug 19, 2007 2:13 pm
by oodmb
so i got the algorithm working for my unbiased renderer, but it seems as though my phong material is overly reflective in the perpendicular direction. i think this is an issue relating to my random hemisphere code-
Code: Select all
public static final Vector3 randomDisk(Vector3 a){
Vector3 b=random();
Vector3 c=a.normalized().cross(b).normalized();
return c.scale(RandMath.randomDouble());
}
public static final Vector3 randomCircle(Vector3 a){
Vector3 b=random();
Vector3 c=a.normalized().cross(b).normalized();
return c;
}
public static final Vector3 randomHemisphere(Vector3 a){
Vector3 ondisk=randomCircle(a).scale(RandMath.randomDouble());
Vector3 randp=a.scale(Math.random());
return ondisk.add(randp).normalized();
}
an example:
the odd boxes have to do with me taking the save in the middle of two passes.

Posted: Mon Aug 20, 2007 4:25 am
by Kram1032
hum, VERY strange result...
Posted: Mon Aug 20, 2007 5:42 am
by oodmb
ok, fixed it... it had to do with random hemisphere like i thaught it did. this time i adapted some stuff from sunflow which worked much better: updated image:
this image uses a phong material for the ball and diffuse materials for the walls. it was rendered for about 7 hours dual core (although i'm still working out the bugs on multithreading speed) and it completed 116 mutations per pixel.

Posted: Mon Aug 20, 2007 5:44 am
by OnoSendai
nice work

Posted: Mon Aug 20, 2007 5:46 am
by Kram1032
very nice

- much more usable for noise reduction^^
was the first image the same scene?
what exactly was the problem?

Posted: Mon Aug 20, 2007 7:33 am
by oodmb
yah, its of the same scene. the only difference is that i added the sphere after i got it working.
the problem i had was that i was assuming that my method for producing random points would produce a uniform distribution across the surface of the hemisphere.
just a note:
i had to write the scene by hand because i still dont have a sceneloader. i attempted writing one but it didnt work to well. currently i'm going to wait till i finish up the handling of uv coordinates.
Posted: Mon Aug 20, 2007 7:55 am
by Kram1032
I see...
great work

Posted: Mon Aug 20, 2007 10:07 am
by deltaepsylon
the render looks great... not because its noiseless or anything, but there's a
feel to it that i cant quite grasp... nice work
edit: any chance of the complete source?

Posted: Mon Aug 20, 2007 10:26 am
by oodmb
i might release the source after i apply to college. i am going to use it on my resume.
Posted: Mon Aug 20, 2007 2:55 pm
by deltaepsylon
how soon would that application be?
Posted: Mon Aug 20, 2007 3:10 pm
by oodmb
actually like 15 applications... and after christmass maybe.
Posted: Tue Aug 21, 2007 12:35 am
by oodmb
Well i finally wrote a working scene loader!!! its based off of the .obj format. here's an example:
Code: Select all
# Blender3D v244 OBJ File:
# www.blender3d.org
camera
3.0000 0.00000 0.0000
0.0000 0.00000 0.0000
-0.1000 0.0000 1.0000
30
m
white
diff
.9 0.9 0.9
m
red
diff
1.0 0.0 0.0
m
blue
diff
0.0 0.0 1.0
m
glow
emit
0.95 0.99 0.98
4
m
gold
phong
1 .58 0.068
10
o sphere
gold
.5
-2.5 -1 0
o mesh
v -1.968028 1.782439 -0.859092
v -1.968028 1.782439 0.649258
v -3.384994 1.782439 0.649258
v -3.384994 1.782439 -0.859092
v 3.988001 -1.701115 -1.855010
v 3.988001 -1.701115 1.790176
v -3.993612 -1.701115 1.790175
v -3.993610 -1.701115 -1.855011
v 3.988003 1.815896 -1.855009
v 3.987998 1.815896 1.790176
v -3.993613 1.815896 1.790175
v -3.993612 1.815896 -1.855010
vn -1.000000 0.000000 0.000000
vn -1.000000 0.000000 -0.000001
vn 1.000000 -0.000001 0.000000
vn 1.000000 0.000001 0.000001
vn 0.000000 1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 -1.000000
mat white
f 7 // 1 11 // 1 12 // 1
f 7 // 2 12 // 2 8 // 2
f 5 // 3 9 // 3 6 // 3
f 9 // 4 10 // 4 6 // 4
f 9 // 5 12 // 5 10 // 5
f 12 // 5 11 // 5 10 // 5
f 5 // 6 6 // 6 8 // 6
f 6 // 6 7 // 6 8 // 6
mat red
f 6 // 7 10 // 7 7 // 7
f 10 // 7 11 // 7 7 // 7
mat blue
f 9 // 8 5 // 8 12 // 8
f 5 // 8 8 // 8 12 // 8
mat glow
f 1 // 5 4 // 5 3 // 5
f 1 // 5 3 // 5 2 // 5
}
the only difference between this and the one in the picture is that the sphere is a different color.
currently there are only two types of objects: sphere objects which are limited in the data input, and mesh objects which can have as many virts as you need them to. because of this, there is an ending bracket when the mesh object is over to signify it is over, however it does not have a starting braket. in my actual program right now meshes are just transformed into individual triangles, because my mesh object is too slow. the camera is specified by point- point- up vector- appature. there is something wrong currently with how i set up the camera, so only use a square picture at the moment and crop it later. i might work on a python exporter now, even though i don't know python or python in blender. if anybody wants to help, i would highly appreciate it.
attached is .jar executable for the first version 0.1 Betta 1 of TLRcam. its simple enough to use so i wont explain it. only think i must say is use the buttons, not the drop down menus.
oh, and TLR stands for thin lens reflex (as opposed to single lens reflex)
Posted: Tue Aug 21, 2007 3:11 am
by Kram1032
cool! 15 apps?
Besides that renderer, which are the other 14?
Posted: Tue Aug 21, 2007 3:51 am
by deltaepsylon
no, you kram head. Hes gonna use it on 15 applications
Posted: Tue Aug 21, 2007 4:34 am
by Kram1032
aha?
ok, on which 15
