Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: DaBrain on March 22, 2008, 08:20:50 am

Title: Parallax mapping - Height maps and mipmapping?
Post by: DaBrain on March 22, 2008, 08:20:50 am
Does it make sense to create a mipmaps for height maps?


It's a bit hard to for me to see what kind of good/bad results that would have.
Title: Re: Parallax mapping - Height maps and mipmapping?
Post by: Zacam on March 22, 2008, 01:43:31 pm
Does it create unecessary issues or filesize in doing so?

And wouldn't height maps be used only on larger ships anyway? I suppose it becomes a question of visibility range and rendering.

You also don't have to create a full set of mip-maps.
Title: Re: Parallax mapping - Height maps and mipmapping?
Post by: taylor on March 22, 2008, 07:20:39 pm
Does it make sense to create a mipmaps for height maps?
It would affect speed (remember that it if can transfer a smaller mipmap level over the bus then it will be faster than without mipmaps), but it probably won't affect quality all that much.

One possible change is to modify your height map on lower mipmap levels to give you more of an effect so that you can still see it well at a distance.  Whether that would actually be worth the effort would really depend on the specific content though.


You also don't have to create a full set of mip-maps.
Although the code is hacked to allow such a thing, it really is best to always create a full mipmap chain.  About 94% of the memory required for mipmaps is in the first 2 levels, so the full chain really isn't going to hurt memory wise, but it can really help performance wise both for rendering purposes and because the game doesn't have to do anything special so that a partial chain will work.
Title: Re: Parallax mapping - Height maps and mipmapping?
Post by: Zacam on March 23, 2008, 03:40:18 am
So how many levels is considered a "full" set?
Title: Re: Parallax mapping - Height maps and mipmapping?
Post by: DaBrain on March 23, 2008, 05:24:02 am
Does it make sense to create a mipmaps for height maps?
It would affect speed (remember that it if can transfer a smaller mipmap level over the bus then it will be faster than without mipmaps), but it probably won't affect quality all that much.

One possible change is to modify your height map on lower mipmap levels to give you more of an effect so that you can still see it well at a distance.  Whether that would actually be worth the effort would really depend on the specific content though.


Thanks, that clears things up.
Modifying the mipmaps is no problem.
Title: Re: Parallax mapping - Height maps and mipmapping?
Post by: taylor on March 23, 2008, 06:44:19 am
So how many levels is considered a "full" set?
As many levels as it takes to get all the way down to 1x1.
Title: Re: Parallax mapping - Height maps and mipmapping?
Post by: Nuke on March 24, 2008, 08:13:46 pm
il be glad when we have a materials system. it might make since to have different normal maps for different lods whilre retaining a single set of diffuse/glow/shine/env maps for the whole. this way you can make lower lods look better.
Title: Re: Parallax mapping - Height maps and mipmapping?
Post by: DaBrain on March 24, 2008, 08:42:55 pm
In some rare special cases, it might make sense, but for the most part using more maps isn't a good idea.
There is the memory need and the additional lods plopping if you do not only change the geometry but also the maps.

If the player's PC can take a plus of memory usage, it could probably also take slightly higher lod distances, which might help just as well.
(Again, "in most cases"... I know there are some models than be "lodded" extremely well, but would need a normal map to keep the structures. This might apply to some asteroids, I guess.)
Title: Re: Parallax mapping - Height maps and mipmapping?
Post by: lufusol on October 14, 2022, 11:15:57 pm
So how many levels is considered a "full" set?
As many levels as it takes to get all the way down to 1x1.
Mipmaps DO go all the way down to 1x1, but I don't understand why.  Maybe it's just so the GPU can use that pixel if it only needs to fill a single pixel instead of calculating which of the 4 pixels in a texel is best (or which to blend)?  I was under the impression that the smallest texture unit the GPU processes is the texel (a group of 2x2 pixels) and I thought that's why textures always need to be a power of 2 (2x2x 8x8, 4x16, 512x2048, etc)

Anyway, example given, let's say your texture is 512x512 : a full set of mips will look like this:  256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4, 2x2, 1x1 (i guess) so at 512x512, you get a maximum of 9 mipmap levels.  In that case, a full set is 9 mips. 

Now would someone please clarify the texel thing for me, or did I already guess it?
Title: Re: Parallax mapping - Height maps and mipmapping?
Post by: Strygon on October 15, 2022, 04:05:08 am
Holy necropost batman.