Public Group

# Normals and vertexes again

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

## 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 on other sites
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 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 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 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

1. 1
Rutin
36
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633345
• Total Posts
3011439
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!