random hemisphere (tlrcam related

Discuss stuff not about Indigo.
User avatar
oodmb
Posts: 271
Joined: Thu Oct 26, 2006 5:39 am
Location: USA
Contact:

random hemisphere (tlrcam related

Post by oodmb » Sun Aug 19, 2007 2:13 pm

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.

Image
a shiny monkey is a happy monkey

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon Aug 20, 2007 4:25 am

hum, VERY strange result...

User avatar
oodmb
Posts: 271
Joined: Thu Oct 26, 2006 5:39 am
Location: USA
Contact:

Post by oodmb » Mon Aug 20, 2007 5:42 am

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.



Image
a shiny monkey is a happy monkey

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Mon Aug 20, 2007 5:44 am

nice work :)

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon Aug 20, 2007 5:46 am

very nice :) - much more usable for noise reduction^^

was the first image the same scene?

what exactly was the problem? :)

User avatar
oodmb
Posts: 271
Joined: Thu Oct 26, 2006 5:39 am
Location: USA
Contact:

Post by oodmb » Mon Aug 20, 2007 7:33 am

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.
a shiny monkey is a happy monkey

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon Aug 20, 2007 7:55 am

I see...
great work :D

User avatar
deltaepsylon
Posts: 417
Joined: Tue Jan 09, 2007 11:50 pm

Post by deltaepsylon » Mon Aug 20, 2007 10:07 am

the render looks great... not because its noiseless or anything, but there's a feel to it that i cant quite grasp... nice work :D

edit: any chance of the complete source? :lol:
-----
P5N32-C Coffee machine overclocked to 4 cups a minute! still not enough...

User avatar
oodmb
Posts: 271
Joined: Thu Oct 26, 2006 5:39 am
Location: USA
Contact:

Post by oodmb » Mon Aug 20, 2007 10:26 am

i might release the source after i apply to college. i am going to use it on my resume.
a shiny monkey is a happy monkey

User avatar
deltaepsylon
Posts: 417
Joined: Tue Jan 09, 2007 11:50 pm

Post by deltaepsylon » Mon Aug 20, 2007 2:55 pm

how soon would that application be?
-----
P5N32-C Coffee machine overclocked to 4 cups a minute! still not enough...

User avatar
oodmb
Posts: 271
Joined: Thu Oct 26, 2006 5:39 am
Location: USA
Contact:

Post by oodmb » Mon Aug 20, 2007 3:10 pm

actually like 15 applications... and after christmass maybe.
a shiny monkey is a happy monkey

User avatar
oodmb
Posts: 271
Joined: Thu Oct 26, 2006 5:39 am
Location: USA
Contact:

Post by oodmb » Tue Aug 21, 2007 12:35 am

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)
Attachments
TLRcam.zip
TLRcam executable
(96.77 KiB) Downloaded 218 times
a shiny monkey is a happy monkey

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Tue Aug 21, 2007 3:11 am

cool! 15 apps?

Besides that renderer, which are the other 14?

User avatar
deltaepsylon
Posts: 417
Joined: Tue Jan 09, 2007 11:50 pm

Post by deltaepsylon » Tue Aug 21, 2007 3:51 am

no, you kram head. Hes gonna use it on 15 applications
-----
P5N32-C Coffee machine overclocked to 4 cups a minute! still not enough...

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Tue Aug 21, 2007 4:34 am

aha?
ok, on which 15 :P

Post Reply
85 posts

Who is online

Users browsing this forum: Andreaskaz and 38 guests