From 44712cd74909e637098a049e09b4b01eb92b365f Mon Sep 17 00:00:00 2001 From: Monsterovich Date: Mon, 28 Sep 2015 16:28:58 +0200 Subject: [PATCH 1/2] Added basic level fog preview --- src/MapRenderer3D.cpp | 82 +++++++++++++++++++++------------ src/MapRenderer3D.h | 4 +- src/MapSector.cpp | 25 ++++++++++ src/MapSector.h | 1 + src/MapSpecials.cpp | 104 ++++++++++++++++++++++++++++++++++++++---- src/MapSpecials.h | 4 ++ src/SLADEMap.cpp | 1 - 7 files changed, 181 insertions(+), 40 deletions(-) diff --git a/src/MapRenderer3D.cpp b/src/MapRenderer3D.cpp index 866589373..32b7a354e 100644 --- a/src/MapRenderer3D.cpp +++ b/src/MapRenderer3D.cpp @@ -55,6 +55,7 @@ CVAR(Int, render_3d_things, 1, CVAR_SAVE) CVAR(Int, render_3d_things_style, 1, CVAR_SAVE) CVAR(Int, render_3d_hilight, 1, CVAR_SAVE) CVAR(Float, render_3d_brightness, 1, CVAR_SAVE) +CVAR(Float, render_fog_distance, 1000, CVAR_SAVE) /******************************************************************* @@ -84,7 +85,6 @@ MapRenderer3D::MapRenderer3D(SLADEMap* map) this->skytex1 = "SKY1"; this->quads = NULL; this->flats = NULL; - this->last_light = 255; this->tex_last = NULL; this->n_quads = 0; this->n_flats = 0; @@ -450,7 +450,7 @@ void MapRenderer3D::setupView(int width, int height) } /* MapRenderer3D::setLight - * Sets the OpenGL colour+fog for rendering an object using [colour] + * Sets the OpenGL colour for rendering an object using [colour] * and [light] level *******************************************************************/ void MapRenderer3D::setLight(rgba_t& colour, uint8_t light, float alpha) @@ -462,21 +462,6 @@ void MapRenderer3D::setLight(rgba_t& colour, uint8_t light, float alpha) // Apply brightness light = MathStuff::clamp(light * render_3d_brightness, 0, 255); - // Setup fog - if (fog && light != last_light) - { - if (light >= 240) - glDisable(GL_FOG); - else - { - glEnable(GL_FOG); - float lm = light/170.0f; - glFogf(GL_FOG_END, (lm * lm * 3000.0f)); - } - - last_light = light; - } - // If we have a non-coloured light, darken it a bit to // closer resemble the software renderer light level float mult = (float)light / 255.0f; @@ -484,6 +469,30 @@ void MapRenderer3D::setLight(rgba_t& colour, uint8_t light, float alpha) glColor4f(colour.fr()*mult, colour.fg()*mult, colour.fb()*mult, colour.fa()*alpha); } +/* MapRenderer3D::setFog + * Sets the OpenGL fog for rendering an object using [fogcol] + *******************************************************************/ +void MapRenderer3D::setFog(rgba_t &fogcol) +{ + if (!fog) + return; + + GLfloat fogColor[3]= {fogcol.fr(), fogcol.fg(), fogcol.fb()}; + + glEnable(GL_FOG); + + glFogfv(GL_FOG_COLOR, fogColor); + glFogi(GL_FOG_MODE, GL_LINEAR); + glFogf(GL_FOG_DENSITY, 1.0f); + glFogf(GL_FOG_START, 0.0f); + + glFogf(GL_FOG_END, render_fog_distance); + if (render_fog_quality) + glHint(GL_FOG_HINT, GL_NICEST); + else + glHint(GL_FOG_HINT, GL_FASTEST); +} + /* MapRenderer3D::renderMap * Renders the map in 3d *******************************************************************/ @@ -497,20 +506,7 @@ void MapRenderer3D::renderMap() glDepthMask(GL_TRUE); glAlphaFunc(GL_GREATER, 0.0f); - // Setup fog - GLfloat fogColor[4]= {0.0f, 0.0f, 0.0f, 0.6f}; - glFogi(GL_FOG_MODE, GL_LINEAR); - glFogfv(GL_FOG_COLOR, fogColor); - glFogf(GL_FOG_DENSITY, 2.0f); - glFogf(GL_FOG_START, 0.0f); - glFogf(GL_FOG_END, 3000.0f); - if (render_fog_quality) - glHint(GL_FOG_HINT, GL_NICEST); - else - glHint(GL_FOG_HINT, GL_FASTEST); - // Init - last_light = -1; tex_last = NULL; // Init VBO stuff @@ -818,6 +814,7 @@ void MapRenderer3D::updateSector(unsigned index) floors[index].sector = sector; floors[index].texture = theMapEditor->textureManager().getFlat(sector->getFloorTex(), theGameConfiguration->mixTexFlats()); floors[index].colour = sector->getColour(1, true); + floors[index].fogcolour = sector->getFogColour(); floors[index].light = sector->getLight(1); floors[index].flags = 0; floors[index].plane = sector->getFloorPlane(); @@ -838,6 +835,7 @@ void MapRenderer3D::updateSector(unsigned index) ceilings[index].sector = sector; ceilings[index].texture = theMapEditor->textureManager().getFlat(sector->getCeilingTex(), theGameConfiguration->mixTexFlats()); ceilings[index].colour = sector->getColour(2, true); + ceilings[index].fogcolour = sector->getFogColour(); ceilings[index].light = sector->getLight(2); ceilings[index].flags = CEIL; ceilings[index].plane = sector->getCeilingPlane(); @@ -884,6 +882,9 @@ void MapRenderer3D::renderFlat(flat_3d_t* flat) // Setup colour/light setLight(flat->colour, flat->light, alpha); + // Setup fog colour + setFog(flat->fogcolour); + // Render flat if (OpenGL::vboSupport() && flats_use_vbo) { @@ -1167,6 +1168,7 @@ void MapRenderer3D::updateLine(unsigned index) plane_t fp1 = line->frontSector()->getFloorPlane(); plane_t cp1 = line->frontSector()->getCeilingPlane(); rgba_t colour1 = line->frontSector()->getColour(0, true); + rgba_t fogcolour1 = line->frontSector()->getFogColour(); int light1 = line->frontSector()->getLight(); int xoff1 = line->s1()->getOffsetX(); int yoff1 = line->s1()->getOffsetY(); @@ -1203,6 +1205,7 @@ void MapRenderer3D::updateLine(unsigned index) // Create quad setupQuad(&quad, line->x1(), line->y1(), line->x2(), line->y2(), cp1, fp1); quad.colour = colour1; + quad.fogcolour = fogcolour1; quad.light = light1; quad.texture = theMapEditor->textureManager().getTexture(line->s1()->getTexMiddle(), mixed); setupQuadTexCoords(&quad, length, xoff, yoff, ceiling1, floor1, lpeg, sx, sy); @@ -1221,6 +1224,7 @@ void MapRenderer3D::updateLine(unsigned index) plane_t fp2 = line->backSector()->getFloorPlane(); plane_t cp2 = line->backSector()->getCeilingPlane(); rgba_t colour2 = line->backSector()->getColour(0, true); + rgba_t fogcolour2 = line->backSector()->getFogColour(); int light2 = line->backSector()->getLight(); int xoff2 = line->s2()->getOffsetX(); int yoff2 = line->s2()->getOffsetY(); @@ -1273,6 +1277,7 @@ void MapRenderer3D::updateLine(unsigned index) // Create quad setupQuad(&quad, line->x1(), line->y1(), line->x2(), line->y2(), fp2, fp1); quad.colour = colour1; + quad.fogcolour = fogcolour1; quad.light = light1; quad.texture = theMapEditor->textureManager().getTexture(line->s1()->getTexLower(), mixed); setupQuadTexCoords(&quad, length, xoff, yoff, floor2, floor1, false, sx, sy); @@ -1351,6 +1356,7 @@ void MapRenderer3D::updateLine(unsigned index) // Create quad setupQuad(&quad, line->x1(), line->y1(), line->x2(), line->y2(), top, bottom); quad.colour = colour1.ampf(1.0f, 1.0f, 1.0f, alpha); + quad.fogcolour = fogcolour1; quad.light = light1; setupQuadTexCoords(&quad, length, xoff, ytex, top, bottom, false, sx, sy); quad.flags |= MIDTEX; @@ -1393,6 +1399,7 @@ void MapRenderer3D::updateLine(unsigned index) // Create quad setupQuad(&quad, line->x1(), line->y1(), line->x2(), line->y2(), cp1, cp2); quad.colour = colour1; + quad.fogcolour = fogcolour1; quad.light = light1; quad.texture = theMapEditor->textureManager().getTexture(line->s1()->getTexUpper(), mixed); setupQuadTexCoords(&quad, length, xoff, yoff, ceiling1, ceiling2, !upeg, sx, sy); @@ -1438,6 +1445,7 @@ void MapRenderer3D::updateLine(unsigned index) // Create quad setupQuad(&quad, line->x2(), line->y2(), line->x1(), line->y1(), fp1, fp2); quad.colour = colour2; + quad.fogcolour = fogcolour2; quad.light = light2; quad.texture = theMapEditor->textureManager().getTexture(line->s2()->getTexLower(), mixed); setupQuadTexCoords(&quad, length, xoff, yoff, floor1, floor2, false, sx, sy); @@ -1516,6 +1524,7 @@ void MapRenderer3D::updateLine(unsigned index) // Create quad setupQuad(&quad, line->x2(), line->y2(), line->x1(), line->y1(), top, bottom); quad.colour = colour2.ampf(1.0f, 1.0f, 1.0f, alpha); + quad.fogcolour = fogcolour2; quad.light = light2; setupQuadTexCoords(&quad, length, xoff, ytex, top, bottom, false, sx, sy); quad.flags |= BACK; @@ -1559,6 +1568,7 @@ void MapRenderer3D::updateLine(unsigned index) // Create quad setupQuad(&quad, line->x2(), line->y2(), line->x1(), line->y1(), cp2, cp1); quad.colour = colour2; + quad.fogcolour = fogcolour2; quad.light = light2; quad.texture = theMapEditor->textureManager().getTexture(line->s2()->getTexUpper(), mixed); setupQuadTexCoords(&quad, length, xoff, yoff, ceiling2, ceiling1, !upeg, sx, sy); @@ -1601,6 +1611,9 @@ void MapRenderer3D::renderQuad(MapRenderer3D::quad_3d_t* quad, float alpha) // Setup colour/light setLight(quad->colour, quad->light, alpha); + // Setup fog + setFog(quad->fogcolour); + // Draw quad glBegin(GL_QUADS); glTexCoord2f(quad->points[0].tx, quad->points[0].ty); glVertex3f(quad->points[0].x, quad->points[0].y, quad->points[0].z); @@ -1962,6 +1975,8 @@ void MapRenderer3D::renderThings() col.set(things[a].sector->getColour(0, true)); } setLight(col, light, calcDistFade(dist, mdist)); + rgba_t fogcol = things[a].sector->getFogColour(); + setFog(fogcol); // Draw thing glBegin(GL_QUADS); @@ -2001,6 +2016,8 @@ void MapRenderer3D::renderThings() // Fill glColor4f(col.fr(), col.fg(), col.fb(), 0.21f); + rgba_t fogcol2 = things[a].sector->getFogColour(); + setFog(fogcol2); glBegin(GL_QUADS); // Bottom glVertex3f(thing->xPos() - radius, thing->yPos() - radius, bottom); @@ -2453,8 +2470,13 @@ void MapRenderer3D::checkVisibleFlats() // Update sector info if needed if (floors[a].updated_time < sector->modifiedTime() || floors[a].updated_time < sector->geometryUpdatedTime()) + { updateSector(a); + // update sector lines + sector->setModified(); + } + // Set distance fade alpha if (render_max_dist > 0) alpha = calcDistFade(dist_sectors[a], render_max_dist); diff --git a/src/MapRenderer3D.h b/src/MapRenderer3D.h index 9fb3697e5..2580ece4d 100644 --- a/src/MapRenderer3D.h +++ b/src/MapRenderer3D.h @@ -42,6 +42,7 @@ class MapRenderer3D : public Listener { gl_vertex_t points[4]; rgba_t colour; + rgba_t fogcolour; uint8_t light; GLTexture* texture; uint8_t flags; @@ -88,6 +89,7 @@ class MapRenderer3D : public Listener uint8_t flags; uint8_t light; rgba_t colour; + rgba_t fogcolour; GLTexture* texture; plane_t plane; float alpha; @@ -141,6 +143,7 @@ class MapRenderer3D : public Listener // -- Rendering -- void setupView(int width, int height); void setLight(rgba_t& colour, uint8_t light, float alpha = 1.0f); + void setFog(rgba_t &fogcol); void renderMap(); void renderSkySlice(float top, float bottom, float atop, float abottom, float size, float tx = 0.125f, float ty = 2.0f); void renderSky(); @@ -189,7 +192,6 @@ class MapRenderer3D : public Listener bool udmf_zdoom; bool fullbright; bool fog; - int last_light; GLTexture* tex_last; unsigned n_quads; unsigned n_flats; diff --git a/src/MapSector.cpp b/src/MapSector.cpp index bab99ba5a..a1c51be58 100644 --- a/src/MapSector.cpp +++ b/src/MapSector.cpp @@ -656,6 +656,31 @@ rgba_t MapSector::getColour(int where, bool fullbright) } } +/* MapSector::getColour + * Returns the fog colour of the sector + *******************************************************************/ +rgba_t MapSector::getFogColour() +{ + rgba_t color(0, 0, 0, 0); + + // map specials/scripts + if (parent_map->mapSpecials()->tagFadeColoursSet()) + { + if (parent_map->mapSpecials()->getTagFadeColour(tag, &color)) + return color; + } + + // udmf + if (parent_map->currentFormat() == MAP_UDMF && S_CMPNOCASE(parent_map->udmfNamespace(), "zdoom")) + { + int intcol = MapObject::intProperty("fadecolor"); + + wxColour wxcol(intcol); + color = rgba_t(wxcol.Blue(), wxcol.Green(), wxcol.Red(), 0); + } + return color; +} + /* MapSector::connectSide * Adds [side] to the list of 'connected sides' (sides that are part * of this sector) diff --git a/src/MapSector.h b/src/MapSector.h index fd5084773..85984318c 100644 --- a/src/MapSector.h +++ b/src/MapSector.h @@ -122,6 +122,7 @@ class MapSector : public MapObject uint8_t getLight(int where = 0); void changeLight(int amount, int where = 0); rgba_t getColour(int where = 0, bool fullbright = false); + rgba_t getFogColour(); long geometryUpdatedTime() { return geometry_updated; } void connectSide(MapSide* side); diff --git a/src/MapSpecials.cpp b/src/MapSpecials.cpp index e4fadebd4..9ca21300e 100644 --- a/src/MapSpecials.cpp +++ b/src/MapSpecials.cpp @@ -53,6 +53,7 @@ const double TAU = PI * 2; void MapSpecials::reset() { sector_colours.clear(); + sector_fadecolours.clear(); } /* MapSpecials::processMapSpecials @@ -80,7 +81,9 @@ void MapSpecials::processLineSpecial(MapLine* line) *******************************************************************/ bool MapSpecials::getTagColour(int tag, rgba_t* colour) { - for (unsigned a = 0; a < sector_colours.size(); a++) + unsigned a; + // scripts + for (a = 0; a < sector_colours.size(); a++) { if (sector_colours[a].tag == tag) { @@ -95,6 +98,29 @@ bool MapSpecials::getTagColour(int tag, rgba_t* colour) return false; } +/* MapSpecials::getTagFadeColour + * Sets [colour] to the parsed fade colour for [tag]. Returns true if the + * tag has a colour, false otherwise + *******************************************************************/ +bool MapSpecials::getTagFadeColour(int tag, rgba_t *colour) +{ + unsigned a; + // scripts + for (a = 0; a < sector_fadecolours.size(); a++) + { + if (sector_fadecolours[a].tag == tag) + { + colour->r = sector_fadecolours[a].colour.r; + colour->g = sector_fadecolours[a].colour.g; + colour->b = sector_fadecolours[a].colour.b; + colour->a = 0; + return true; + } + } + + return false; +} + /* MapSpecials::tagColoursSet * Returns true if any sector tags should be coloured *******************************************************************/ @@ -103,19 +129,38 @@ bool MapSpecials::tagColoursSet() return !(sector_colours.empty()); } +/* MapSpecials::tagFadeColoursSet + * Returns true if any sector tags should be coloured by fog + *******************************************************************/ +bool MapSpecials::tagFadeColoursSet() +{ + return !(sector_fadecolours.empty()); +} + +/* MapSpecials::setModified + * Modify sector with [tag] + *******************************************************************/ +void MapSpecials::setModified(SLADEMap *map, int tag) +{ + vector tagged; + map->getSectorsByTag(tag, tagged); + for (unsigned s = 0; s < tagged.size(); s++) + tagged[s]->setModified(); +} + /* MapSpecials::updateTaggedSecors * Updates any sectors with tags that are affected by any processed * specials/scripts *******************************************************************/ void MapSpecials::updateTaggedSectors(SLADEMap* map) { - for (unsigned a = 0; a < sector_colours.size(); a++) - { - vector tagged; - map->getSectorsByTag(sector_colours[a].tag, tagged); - for (unsigned s = 0; s < tagged.size(); s++) - tagged[s]->setModified(); - } + // scripts + unsigned a; + for (a = 0; a < sector_colours.size(); a++) + setModified(map, sector_colours[a].tag); + + for (a = 0; a < sector_fadecolours.size(); a++) + setModified(map, sector_fadecolours[a].tag); } /* MapSpecials::processZDoomMapSpecials @@ -182,6 +227,7 @@ void MapSpecials::processZDoomLineSpecial(MapLine* line) void MapSpecials::processACSScripts(ArchiveEntry* entry) { sector_colours.clear(); + sector_fadecolours.clear(); if (!entry || entry->getSize() == 0) return; @@ -255,6 +301,48 @@ void MapSpecials::processACSScripts(ArchiveEntry* entry) sector_colours.push_back(sc); } } + // --- Sector_SetFade --- + else if (S_CMPNOCASE(token, "Sector_SetFade")) + { + // Get parameters + vector parameters; + tz.getTokensUntil(parameters, ")"); + + // Parse parameters + long val; + int tag = -1; + int r = -1; + int g = -1; + int b = -1; + for (unsigned a = 0; a < parameters.size(); a++) + { + if (parameters[a].ToLong(&val)) + { + if (tag < 0) + tag = val; + else if (r < 0) + r = val; + else if (g < 0) + g = val; + else if (b < 0) + b = val; + } + } + + // Check everything is set + if (b < 0) + { + LOG_MESSAGE(2, "Invalid Sector_SetFade parameters"); + } + else + { + sector_colour_t sc; + sc.tag = tag; + sc.colour.set(r, g, b, 0); + LOG_MESSAGE(3, "Sector tag %d, fade colour %d,%d,%d", tag, r, g, b); + sector_fadecolours.push_back(sc); + } + } tz.getToken(&token); } diff --git a/src/MapSpecials.h b/src/MapSpecials.h index 148dd7334..7cabdc4d1 100644 --- a/src/MapSpecials.h +++ b/src/MapSpecials.h @@ -20,6 +20,7 @@ class MapSpecials }; vector sector_colours; + vector sector_fadecolours; void processZDoomSlopes(SLADEMap* map); template @@ -40,7 +41,9 @@ class MapSpecials void processLineSpecial(MapLine* line); bool getTagColour(int tag, rgba_t* colour); + bool getTagFadeColour(int tag, rgba_t *colour); bool tagColoursSet(); + bool tagFadeColoursSet(); void updateTaggedSectors(SLADEMap* map); // ZDoom @@ -48,6 +51,7 @@ class MapSpecials void processZDoomLineSpecial(MapLine* line); void updateZDoomSector(MapSector* line); void processACSScripts(ArchiveEntry* entry); + void setModified(SLADEMap *map, int tag); }; #endif//__MAP_SPECIALS_H__ diff --git a/src/SLADEMap.cpp b/src/SLADEMap.cpp index 977b21731..01e566311 100644 --- a/src/SLADEMap.cpp +++ b/src/SLADEMap.cpp @@ -4045,7 +4045,6 @@ bool SLADEMap::modifiedSince(long since, int type) *******************************************************************/ void SLADEMap::recomputeSpecials() { - map_specials.reset(); map_specials.processMapSpecials(this); } From 6064054005a81b709f7608e86be4b3b8ded54504 Mon Sep 17 00:00:00 2001 From: Monsterovich Date: Tue, 29 Sep 2015 20:26:18 +0200 Subject: [PATCH 2/2] Some fog preview fixes - Fixed possible bug that can crash the editor if thing is outside the map. - Changed render_fog_distance default from 1000 to 1500. IMO it looks better. - Added new CVAR render_fog_new_formula: if it's true, then slade will use the new formula for custom fog that doesn't have sector light calculations and it has custom distance (I mean render_fog_distance) if it's false, then slade will use the old formula. slade is always using the old formula when the fog color is default --- src/MapRenderer3D.cpp | 36 +++++++++++++++++++++++++++--------- src/MapRenderer3D.h | 2 +- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/MapRenderer3D.cpp b/src/MapRenderer3D.cpp index 32b7a354e..411dee5f9 100644 --- a/src/MapRenderer3D.cpp +++ b/src/MapRenderer3D.cpp @@ -55,7 +55,8 @@ CVAR(Int, render_3d_things, 1, CVAR_SAVE) CVAR(Int, render_3d_things_style, 1, CVAR_SAVE) CVAR(Int, render_3d_hilight, 1, CVAR_SAVE) CVAR(Float, render_3d_brightness, 1, CVAR_SAVE) -CVAR(Float, render_fog_distance, 1000, CVAR_SAVE) +CVAR(Float, render_fog_distance, 1500, CVAR_SAVE) +CVAR(Bool, render_fog_new_formula, true, CVAR_SAVE) /******************************************************************* @@ -472,7 +473,7 @@ void MapRenderer3D::setLight(rgba_t& colour, uint8_t light, float alpha) /* MapRenderer3D::setFog * Sets the OpenGL fog for rendering an object using [fogcol] *******************************************************************/ -void MapRenderer3D::setFog(rgba_t &fogcol) +void MapRenderer3D::setFog(rgba_t &fogcol, uint8_t light) { if (!fog) return; @@ -486,7 +487,15 @@ void MapRenderer3D::setFog(rgba_t &fogcol) glFogf(GL_FOG_DENSITY, 1.0f); glFogf(GL_FOG_START, 0.0f); - glFogf(GL_FOG_END, render_fog_distance); + // check if fog color is default + if ((fogColor[0] == 0 && fogColor[1] == 0 && fogColor[2] == 0) || !render_fog_new_formula) + { + float lm = light/170.0f; + glFogf(GL_FOG_END, (lm * lm * 3000.0f)); + } + else + glFogf(GL_FOG_END, render_fog_distance); + if (render_fog_quality) glHint(GL_FOG_HINT, GL_NICEST); else @@ -883,7 +892,7 @@ void MapRenderer3D::renderFlat(flat_3d_t* flat) setLight(flat->colour, flat->light, alpha); // Setup fog colour - setFog(flat->fogcolour); + setFog(flat->fogcolour, flat->light); // Render flat if (OpenGL::vboSupport() && flats_use_vbo) @@ -1612,7 +1621,7 @@ void MapRenderer3D::renderQuad(MapRenderer3D::quad_3d_t* quad, float alpha) setLight(quad->colour, quad->light, alpha); // Setup fog - setFog(quad->fogcolour); + setFog(quad->fogcolour, quad->light); // Draw quad glBegin(GL_QUADS); @@ -1975,8 +1984,11 @@ void MapRenderer3D::renderThings() col.set(things[a].sector->getColour(0, true)); } setLight(col, light, calcDistFade(dist, mdist)); - rgba_t fogcol = things[a].sector->getFogColour(); - setFog(fogcol); + rgba_t fogcol = rgba_t(0, 0, 0, 0); + if (things[a].sector) + fogcol = things[a].sector->getFogColour(); + + setFog(fogcol, light); // Draw thing glBegin(GL_QUADS); @@ -2016,8 +2028,14 @@ void MapRenderer3D::renderThings() // Fill glColor4f(col.fr(), col.fg(), col.fb(), 0.21f); - rgba_t fogcol2 = things[a].sector->getFogColour(); - setFog(fogcol2); + uint8_t light2 = 255; + rgba_t fogcol2 = rgba_t(0, 0, 0, 0); + if (things[a].sector) + { + light2 = things[a].sector->getLight(); + fogcol2 = things[a].sector->getFogColour(); + } + setFog(fogcol2, light2); glBegin(GL_QUADS); // Bottom glVertex3f(thing->xPos() - radius, thing->yPos() - radius, bottom); diff --git a/src/MapRenderer3D.h b/src/MapRenderer3D.h index 2580ece4d..886c29cc0 100644 --- a/src/MapRenderer3D.h +++ b/src/MapRenderer3D.h @@ -143,7 +143,7 @@ class MapRenderer3D : public Listener // -- Rendering -- void setupView(int width, int height); void setLight(rgba_t& colour, uint8_t light, float alpha = 1.0f); - void setFog(rgba_t &fogcol); + void setFog(rgba_t &fogcol, uint8_t light); void renderMap(); void renderSkySlice(float top, float bottom, float atop, float abottom, float size, float tx = 0.125f, float ty = 2.0f); void renderSky();