LWJGL - 3D Tiled Terrain

Hello!

Does anyone know a method of setting the uv for textures using shared vertices and properly binding?

Is there an efficient way to get the “2D tiled” look in 3D? Thats pretty much what I’m going for.

I have this so far however since the vertices are shared the texture flips every other row:


UPDATE: There are now 23% more vertices.

I believe that there is no way to get the same vertex to share two different texture coordinates. Each vertex must have it’s own set of texture coordinates. So, there will have to be 4 vertices that have the same position, but have different texture coordinates.

You can check out my code to see how I accomplished it in my 3d world (though be warned that the code is not pretty.)

I figured so much. So I will have to place use an array of quads?

-going to look at your world now-

Yeah that’s the idea. The class that I believe you should look at is src/smplx/world/Chunk.java

I believe that you can also use a triangle strip, but you will still have some overlapping vertices.

So using indices only really decreases 2 vertices per quad. Will it even be worth using indices anymore?

(Trying to get this efficient)

Right now, I believe that it is personal opinion for you. If you get to a state where you need to optimize your terrain, then you can consider how much you’re saving (or losing) by using indices.

I would say to still use indices, but that is just my opinion.

Thanks brotato. You’ve been a great help.

Brotato… That’s a new one :wink:

Updated. However there is a slight performance hit.

Ultimately I’m divide into chunks.

Good idea?

If you’re going to be generating a very large map, then chunks are the way to go.

Any good resources on shadow mapping?

I can’t find any that look promising.