PDA

View Full Version : Granting normals to voxels.


rouncer
02-15-2009, 02:45 AM
Im thinking about putting together a voxel model editor, but there seems to be a problem, how do you get a light to light them up when they have no normals?
You can give them a texture, but how do you make them diffuse light?

I was thinking maybe you give them floating positions inside the voxel compartment - and you use this to develop a smooth surface but is there a better way than this?

thanks for any replies...

Rubicon
02-15-2009, 03:03 AM
Make some using a sobel filter ?

kusma
02-15-2009, 03:09 AM
rouncer: I did a voxel-renderer with a friend that did something like that. We took the gradient over a large area, with gaussian weighting. It worked out quite well, but there were quite some banding in the normals for almost-axis-aligned slopes.

rouncer
02-15-2009, 10:13 AM
rouncer: I did a voxel-renderer with a friend that did something like that. We took the gradient over a large area, with gaussian weighting. It worked out quite well, but there were quite some banding in the normals for almost-axis-aligned slopes.

Wouldnt that destroy high frequencies tho?

Rubicon
02-15-2009, 10:19 AM
Seeing as I seem to be invisible, here it is from someone else (http://www.gamedev.net/community/forums/topic.asp?topic_id=370902)

rouncer
02-15-2009, 09:27 PM
Sorry Rubicon, so Its similar to converting a heightmap to a normal map.
Can you still use a 3x3 kernel and it would work?

I doubt it, because heightmaps have 256 positions and voxels only displace from each other in units, it would produce harsh angles.

Rubicon
02-16-2009, 01:40 AM
Yes, you can use it in any dimension.

Your're right about it not being mega smooth, but that's not a voxel speciality

rouncer
02-16-2009, 04:30 AM
the only way would be to increase the kernal size and lose hi frequency components.

kusma
02-16-2009, 06:51 AM
rouncer: No, high frequencies worked out quite OK. It's a matter of tweaking the filter, though.

rouncer
02-16-2009, 03:37 PM
Ok, thanksalot for the input.