Skip to main content
gamedev.net
🔒 Locked

Heightmap/Normalmap interpolation questions

Started by HexiDave 1 reply 900+ views
Original Post
HexiDave
HexiDave
Alright - the setup: I've got a 65x65 patch of vertices matched to a heightmap and slopemap - I don't have a problem generating a 65x65 normalmap (vertex normals), but for the way my process works I'd like to resample the maps to 512x512 (or 513x513 and I can cut the middle row/column out.) Now, I've tried a few small libraries for resampling with some small success in using a cubic filter (got some weird artifacts) and I don't mind that either the heightmap or slopemap use linear filtering as they're going to get some pre-built noise added to them probably and are just for texture-matching, but I'd like at least for the normals to be re-sampled up to a greater texture size so when I sub-divide the tile I'm on, I can go a few extra levels without generating a new normal map. Also, I'm aware that I can just put the normalmap as RGB and the Heightmap as the alpha channel - I'm just thinking in terms of speed. I'm trying to find some fast methods for cubic resampling of normal maps, either as a texture or as vectors - I tried a library called CImg and it gave me some unusual results, so I'm not sure what happened there. Sorry the question is a bit vague - feel free to ask for clarifications or more info. Thanks for any help you can give - Merry Christmas!
Thr33d
Thr33d
Are you re-normalizing your normals after resampling?

-M
HexiDave
HexiDave
Actually I broke down, learned how the whole thing worked and wrote my own filter - the problem wasn't in the original normals (I tried just using any color images too), just the CImg code spiting me.

While bumbling around the web looking for solutions, I found I can do it on the GPU as well - bonus points!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.