Projet server.

This commit is contained in:
MarcEricMartel
2023-09-18 15:56:17 -04:00
parent cf75843117
commit c3058070e5
25 changed files with 4600 additions and 37 deletions

View File

@@ -223,7 +223,7 @@ void World::RenderWorld(int& rendercount, Player& player, Transformation& world,
direct.Normalize();
pos.y = 1;
static Vector3<unsigned int> renderManifest[VIEW_DISTANCE * 4]; // Nombre de Chunks maximal <20> <20>tre rendus.
static Vector3<unsigned int> renderManifest[VIEW_DISTANCE * 8]; // Nombre de Chunks maximal <20> <20>tre rendus.
//for (int dist = VIEW_DISTANCE; dist >= 0; dist -= CHUNK_SIZE_X) {
for (int dist = 0; dist <= VIEW_DISTANCE; dist += CHUNK_SIZE_X) {
@@ -231,26 +231,26 @@ void World::RenderWorld(int& rendercount, Player& player, Transformation& world,
float sinus, cosinus;
int echantillons;
if (dist > VIEW_DISTANCE * .5f) {
if (dist > VIEW_DISTANCE * .1f) {
sinus = .00872653549f; // sin(1/2 degr<67>)
cosinus = .99996192306; // cos(1/2 degr<67>)
echantillons = 180;
}
else if (dist > VIEW_DISTANCE * .4f) {
sinus = .01151891831f; // sin(2/3 degr<67>)
cosinus = .99993365506; // cos(2/3 degr<67>)
echantillons = 120;
}
else if (dist > VIEW_DISTANCE * .3f) {
sinus = .01745240643; // sin(1 degr<67>)
cosinus = .99984769515; // cos(1 degr<67>)
echantillons = 90;
}
else if (dist > VIEW_DISTANCE * .2f) {
sinus = .0261769483;
cosinus = .99965732497;
echantillons = 60;
}
//else if (dist > VIEW_DISTANCE * .3f) {
// sinus = .01151891831f; // sin(2/3 degr<67>)
// cosinus = .99993365506; // cos(2/3 degr<67>)
// echantillons = 120;
//}
//else if (dist > VIEW_DISTANCE * .2f) {
// sinus = .01745240643; // sin(1 degr<67>)
// cosinus = .99984769515; // cos(1 degr<67>)
// echantillons = 90;
//}
//else if (dist > VIEW_DISTANCE * .1f) {
// sinus = .0261769483;
// cosinus = .99965732497;
// echantillons = 60;
//}
else {
sinus = .0348994967;
cosinus = .99939082701;
@@ -293,7 +293,7 @@ void World::RenderWorld(int& rendercount, Player& player, Transformation& world,
world.ApplyTranslation(chx, 0, chy);
world.Use();
float blcolor = renderManifest[index].y / (VIEW_DISTANCE * 1000.f);
float blcolor = renderManifest[index].y / (VIEW_DISTANCE / 50.f);
glBlendColor(blcolor, blcolor, blcolor, 1.f);
ChunkAt(chx, 1, chy)->Render();
world.ApplyTranslation(-chx, 0, -chy);