Jump to content
  • Advertisement
Sign in to follow this  
meekman

Normals and vertexes again

This topic is 4267 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello people! I couldnt find information about normal's creation for landscapes. So once the map is created i have to light it. But! I need normal for every vertex, but vertex have one possible normal only. So the only way is to increase the count of the same vertexes to make for each of them own normal??? Or there is some other way to light the map? Please, give me some help!

Share this post


Link to post
Share on other sites
Advertisement
thnx for info.

In that article author says that i should average normals in every vertex, but there is one more problem - texturing.

I have to lay the texture on the every quad, so i have to define tu\tv coords for every quad, for every vertex. But every vertex have the only one tu,tv coords. SO what do i do to solve this?

Share this post


Link to post
Share on other sites
Go higher than 1.0 for your coordinates.

For example....

Vertex at 0,0 = tex coord 0,0, vertex at 1,0 = tex coord 1,0
vertex at 1,0 = tex coord 1,0, vertex at 1,1 = tex coord 1,1
vertex at 2,0 = tex coord 2,0, vertex at 2,1 = tex coord 2,1

I had this same problem. That or you could use an alternative method of texturing, like laying a big texture over your terrain, or your heightmap so you know where to texture what if you're texturing based on height. Of course for the second two you'll need shaders.

Share this post


Link to post
Share on other sites
lets say this is a very small portion of your terrain/landscape from a top down view:

v1v2v3
|\ |\ |
| \| \|
v4v5v6

this is possible as long as your texture will be mirrored along v2 and v5 (v1 and v3 will have same texcoords)....if you want the EXACT same texture applied to both quads then you are FORCED to do this:

v1v2v3v4
|\ | |\ |
| \| | \|
v5v6v7v8

get what i'm saying? v2 can have one texture coordinate, if you want the texture to repeat EXACLTY as it is on the first quad then you need to make new vertices (v1 and v3 will have same tex coords)

Share this post


Link to post
Share on other sites
Yea, i got this. I have to increase the count of vertexes to be loaded. My algorithms mustbe remade, thats bad :(
Shit, i wish i have a few good free books where they say not only about how to create vertex buffer, but about real practice of game programming!

Thnx for all help


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!