RE: [Algorithms] normal map mipmaps
Brought to you by:
vexxed72
From: Tom F. <to...@mu...> - 2002-02-13 20:18:28
|
Oh, yes - bigger kernels are better. I was just throwing that one into = code because it's quick to type :-) It's not actually very good because it = gives an off-by-half error. I usually use this one: > 0 -1 0 > 0 0 0 > 0 1 0 ...and the corresponding one. I have thought about using other kernels, because this one is a bit = harsh, and is very sensitive to the fact that there are usually only 8 bits of precision in the bumpmap, but never got around to experimenting with = any. I might give your other two a go - they look promising. Tom Forsyth - purely hypothetical Muckyfoot bloke. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Evan Hart [mailto:eh...@at...] > Sent: 13 February 2002 20:07 > To: Algorithms > Subject: RE: [Algorithms] normal map mipmaps >=20 >=20 >=20 > Actually, this brings up another good question of what is the=20 > best way to > compute the normals from the bumpmap?=20 >=20 > I notice that you are only using 3 height map texels to=20 > compute a normal. I > typically use 4 or 8. What are the tradeoffs of the=20 > different filters, and > do they effect how it mipmaps? >=20 > Here are your filter kernels: >=20 > X: > 0 -1 0 > 0 1 0 > 0 0 0 >=20 > Y: > 0 0 0 > 0 1 -1 > 0 0 0 >=20 > The ones I typically use are: >=20 > X: > 0 -1 0 > 0 0 0 > 0 1 0 > or > -1 -2 -1 > 0 0 0 > 1 2 1 >=20 > Y: > 0 0 0 > 1 0 -1 > 0 0 0 > or > 1 0 -1 > 2 0 -2 > 1 0 -1 >=20 >=20 >=20 > -----Original Message----- > From: Tom Forsyth [mailto:to...@mu...] > Sent: Wednesday, February 13, 2002 1:09 PM > To: Ignacio Casta=F1o; Algorithms > Subject: RE: [Algorithms] normal map mipmaps >=20 >=20 > There is no "right" way as far as I know. It's a big research=20 > topic. If you > find a solution, could you let the DX9 chaps know - it's incredibly > important for displacement mapping :-) >=20 > You're calculating the normal mipmaps wrong. Remember that=20 > lower levels not > only have fewer pixels, but they are _further apart_. So on=20 > the top level > you would do this: >=20 > Vec3 norm; > norm.x =3D height[x][y] - height[x][y+1]; > norm.y =3D height[x][y] - height[x+1][y]; > norm.z =3D z_scale; > norm =3D norm.Normalise(); >=20 >=20 > But on the next level down, you need to do: >=20 >=20 > Vec3 norm; > norm.x =3D height[x][y] - height[x][y+1]; > norm.y =3D height[x][y] - height[x+1][y]; > norm.z =3D z_scale * 2.0f; > norm =3D norm.Normalise(); >=20 >=20 > Otherwise you will get images that are far too crisp. >=20 >=20 > Tom Forsyth - purely hypothetical Muckyfoot bloke. >=20 > This email is the product of your deranged imagination, > and does not in any way imply existence of the author. >=20 >=20 >=20 > > -----Original Message----- > > From: Ignacio Casta=F1o [mailto:cas...@ya...] > > Sent: 13 February 2002 17:57 > > To: Algorithms > > Subject: [Algorithms] normal map mipmaps > >=20 > >=20 > > Hi, > > which is the way of correctly calculating normal maps=20 > > mipmaps? I've been > > doing that by turning the bumpmap into a normalmap,=20 > > calculating the mipmaps > > and renormalizing them. That worked pretty well, but someone=20 > > mentioned that > > instead of that you should calculate the mipmaps of the=20 > > bumpmap and then > > turn them into normalmaps, and that doesn't look very good,=20 > > the normal maps > > of the mipmap chain are very differnt, smaller mipmaps look=20 > > sharper and > > that's very noticeable. Does somebody have any suggestion? > >=20 > > Thanks in advance, > >=20 > > Ignacio Casta=F1o > > ca...@as... > >=20 > >=20 > >=20 > > _________________________________________________________ > > Do You Yahoo!? > > Get your free @yahoo.com address at http://mail.yahoo.com > >=20 > >=20 > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 > >=20 >=20 > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_ida88 >=20 > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_ida88 >=20 |