Xaphier Report post Posted September 1, 2005 Ok, next try. This are the things we should save per tile: A height map, VERTEXES_PER_TILExNORMALS_PER_VERTEX items big. Every item is an unsigned short. The first texture coordinates map, VERTEXES_PER_TILE items big. Every item are two floats, u & v. The second texture coordinates map, VERTEXES_PER_TILE items big. Every item are two floats, u & v. The id of the base texture, one int. The id of the first texture, one int. The id of the second texture, one int. The type of the water map, 1 bit. The type of the water, 7 bits. The water map, 1 or VERTEXES_PER_TILE items big. Every item is an unsigned short. If the type of the water map is 0, the size of the map is 1. If the type of the water map is 1, the size is VERTEXES_PER_TILE. Does anybody think we save too much or not enough, please tell me. Share this post Link to post Share on other sites
Entropy Report post Posted September 3, 2005 OK. We could do it like this. #define VERTEXES_PER_TILE 6*6 #define NORMALS_PER_VERTEX 4*4 struct height_map_tile_io { Uint8 (reserved) : 3 /* internal server flags */ Uint8 walkable : 1 Uint8 swimmable : 1 Uint8 flyable : 1 Uint16 height : 10 } struct tile { height_map_tile_io height_map[VERTEXES_PER_TILE*NORMALS_PER_VERTEX]; float u_texture_1[VERTEXES_PER_TILE]; float v_texture_1[VERTEXES_PER_TILE]; float u_texture_2[VERTEXES_PER_TILE]; float v_texture_2[VERTEXES_PER_TILE]; Uint16 water_height; Uint8 base_texture, texture_1, texture_2, water_texture; } With water_height we can make rivers, sees etc. without extra 3D-objects. 192226[/snapback] The height_map_tile_io can't be done, it needs server support for too many stuff, which can't be practically done. And would make the maps much bigger. remember that usually the compiler will make a char to an int, for speed purposes. Share this post Link to post Share on other sites
Entropy Report post Posted September 3, 2005 Ok, next try. This are the things we should save per tile: A height map, VERTEXES_PER_TILExNORMALS_PER_VERTEX items big. Every item is an unsigned short. The first texture coordinates map, VERTEXES_PER_TILE items big. Every item are two floats, u & v. The second texture coordinates map, VERTEXES_PER_TILE items big. Every item are two floats, u & v. The id of the base texture, one int. The id of the first texture, one int. The id of the second texture, one int. The type of the water map, 1 bit. The type of the water, 7 bits. The water map, 1 or VERTEXES_PER_TILE items big. Every item is an unsigned short. If the type of the water map is 0, the size of the map is 1. If the type of the water map is 1, the size is VERTEXES_PER_TILE. Does anybody think we save too much or not enough, please tell me. 192510[/snapback] I don't really understand, please post the data definitions. Share this post Link to post Share on other sites
Xaphier Report post Posted September 3, 2005 (edited) Some definitions: #define VERTEXES_PER_TILE 6*6 #define NORMALS_PER_VERTEX 4*4 struct water_map_id_io { unsigned char water_map_size : 1 unsigned int water_texture_id : 31 } This are the things we should save per tile: unsigned short height_map[VERTEXES_PER_TILE*NORMALS_PER_VERTEX]; // terrain height map float texture_coord_1[VERTEXES_PER_TILE][2]; // u & v coordinates for first extra texture float texture_coord_2[VERTEXES_PER_TILE][2]; // u & v coordinates for second extra texture unsigned int texture_1_id; // first extra texture id unsigned int texture_2_id; // second extra texture id water_map_id_io water_map_id; // water texture id and water map size unsigned short water_height[size]; // terrain water height map. // if (water_map_size == 0) size = 1; // else size = VERTEXES_PER_TILE; // if size is 1, every water vertex has the same height This is just what we should add to the map format. Edited September 3, 2005 by Xaphier Share this post Link to post Share on other sites
Lachesis Report post Posted September 8, 2005 Or just add a flag to 2D objects telling that z coordinates should be ignored and the object projected onto terrain instead. With regards Lachesis Share this post Link to post Share on other sites
JoshuaMckee Report post Posted August 3, 2006 (edited) Since I'm going to take over on bump mapping, I have a few questions. First of all I'm a little confused about what the height map is used for. Is it just to make the terrain look more bumpy and if so then how is this going to affect the collision detection? Is the plan (for terrain) to make the normal map based on the height map? Also is the height map a per tile thing, or is it per a per area thing? Has anyone made height or normal maps, and can I get a copy of them? JOsh Edited August 3, 2006 by Josh Share this post Link to post Share on other sites
JoshuaMckee Report post Posted August 5, 2006 oh well I guess that stuff doesn't really matter. I'll make the bump mapping code and let you guys figure out what you want to do with it I guess. I have another question, ... do you guys want to have an ocean, because I think it would be pretty easy to make a vertex shader that would make waves, ... as long as players won't be able to swim in the ocean. Will players be able to swim in the ocean? Josh Share this post Link to post Share on other sites
Cycloonx Report post Posted August 5, 2006 Roja and Entropy are on a vacation for 2 weeks, so don't expect answers of them very fast. I think you better wait a little then or do what you think is right. Share this post Link to post Share on other sites
emajekral Report post Posted August 7, 2006 I don't know about the ocean, but there is a call for improved water in general. There are several places in the game where players can walk in shallow water. If you were to make vertex shader waves then you need to decide whether the players will interact with the waves when they walk through water. Also I'm pretty sure the reflection scheme will need to be revisited if you take on water. Maybe you could leave the flat reflections and just superimpose specularly lit waves? Or do you have a plan? Share this post Link to post Share on other sites
JoshuaMckee Report post Posted August 7, 2006 I don't know about the ocean, but there is a call for improved water in general. There are several places in the game where players can walk in shallow water. If you were to make vertex shader waves then you need to decide whether the players will interact with the waves when they walk through water. Also I'm pretty sure the reflection scheme will need to be revisited if you take on water. Maybe you could leave the flat reflections and just superimpose specularly lit waves? Or do you have a plan? Now that you say that, I hadn't really thought of the reflections. I would have to research how to do the lookup in the texture. Maybe on second thought I had better leave that to someone else. For the ocean it was just going to be a sin wave that gets bigger as you get further from shore to a fixed maximum wave height and then gets very small as it gets near the coast. For when they step in the water I was going to pass in an array that tells where, and when they stepped in the water, and then it would basically be a dampened sin wave from their feet outward. But I don't want to make it look like crap, so maybe I'd better not do it. Share this post Link to post Share on other sites
emajekral Report post Posted August 8, 2006 (edited) I'm pretty sure reflections are just inverted geometry in the client. There is a fair amount of work to changing them, I think. I've been avoiding looking at them. At the moment I'm putting off using the stencil buffer to do sky reflections. Using the reflection code as is was just ugly. It broke many things in my skybox. Mind you I'm playing with the projection matrix and doing multipass stuff with the depth buffer disabled, so it's probably my fault Edited August 8, 2006 by emajekral Share this post Link to post Share on other sites
Roja Report post Posted August 20, 2006 Since I'm going to take over on bump mapping, I have a few questions. First of all I'm a little confused about what the height map is used for. Bump mapping...can you do Normal Mapping instead? I'd much prefer to go the higher end if possible. Normal mapping does look better than bump. It also has nothing to do with the terrain & height mappings. If you are still working on this project, Josh, please start a new thread entitled Normal Mapping, and we can discuss more in there. I'll provide you with textures/graphics to do tests with. Share this post Link to post Share on other sites