Question about terrain normal mapping?

Started by
12 comments, last by swiftcoder 10 years, 8 months ago

Hmm yes that makes sense. What i'm doing so far is using VTF in the PS (not VS) to obtain normals. I think i might move this to VS or simply send in normals with vertex lke you said. Then i use an alphamap with 3 values (2 texture IDs and 1 weight) for the splatting, as apposed to the usual 4 splat weights channel. This gives me more textures to work with but limits me to 2 textures per vertex, which isn't a problem really. I also use detail maps.

Anyway, for the tangents and bitangents, is it better to send them in with the vertex or generate on the GPU? By better i mean performance wise.

@Scouting Ninja, thanks for the visual aid :)

"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
Advertisement

Calculating TBN for a heightfield is less "involved" than for an arbitrary mesh as the UV coordinates are basically the vertex positioning equally spaced along the X/Z plane. You could calculate the normal from the heightfield using a cross filter a la Frostbite and from this derive your Tangent and BiNormal vectors for your TBN matrix. Will this be faster? Well, that depends on your hardware and requirements but it would be a lot less geometry to be sending to the GPU as the terrain vector field would consist of just two UV components. Just to clarify in case there's any confusion: normal maps do not replace normals, they are used in conjunction with one and other (except in a few simplistic cases).

Alright thanks i'll keep that in mind.

"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "


Extracting a normal (and by extension the whole TBN frame) is still not as straightforward as one might think.

You can cheat your way out of needing a TBN frame if you perform your lighting in object space.

In object space, your terrain is always a regular grid, and the (approximate) tangents and bitangents lie along the grid axes.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement