#include "mapblock_mesh.h"#include "CMeshBuffer.h"#include "client.h"#include "mapblock.h"#include "map.h"#include "noise.h"#include "profiler.h"#include "shader.h"#include "mesh.h"#include "minimap.h"#include "content_mapblock.h"#include "util/directiontables.h"#include "util/tracy_wrapper.h"#include "client/meshgen/collector.h"#include "client/renderingengine.h"#include <array>#include <algorithm>#include <cmath>#include "client/texturesource.h"
 Include dependency graph for mapblock_mesh.cpp:Functions | |
| static u8 | getInteriorLight (enum LightBank bank, MapNode n, s32 increment, const NodeDefManager *ndef) | 
| u16 | getInteriorLight (MapNode n, s32 increment, const NodeDefManager *ndef) | 
| static u8 | getFaceLight (enum LightBank bank, MapNode n, MapNode n2, const NodeDefManager *ndef) | 
| u16 | getFaceLight (MapNode n, MapNode n2, const NodeDefManager *ndef) | 
| static u16 | getSmoothLightCombined (const v3s16 &p, const std::array< v3s16, 8 > &dirs, MeshMakeData *data) | 
| u16 | getSmoothLightSolid (const v3s16 &p, const v3s16 &face_dir, const v3s16 &corner, MeshMakeData *data) | 
| u16 | getSmoothLightTransparent (const v3s16 &p, const v3s16 &corner, MeshMakeData *data) | 
| void | get_sunlight_color (video::SColorf *sunlight, u32 daynight_ratio) | 
| void | final_color_blend (video::SColor *result, u16 light, u32 daynight_ratio) | 
| void | final_color_blend (video::SColor *result, const video::SColor &data, const video::SColorf &dayLight) | 
| void | getNodeTileN (MapNode mn, const v3s16 &p, u8 tileindex, MeshMakeData *data, TileSpec &tile) | 
| void | getNodeTile (MapNode mn, const v3s16 &p, const v3s16 &dir, MeshMakeData *data, TileSpec &tile) | 
| static void | applyTileColor (PreMeshBuffer &pmb) | 
| static const MeshTriangle * | findSplitCandidate (const std::vector< s32 > &list, const std::vector< MeshTriangle > &triangles) | 
| Find a candidate plane to split a set of triangles in two.   | |
| video::SColor | encode_light (u16 light, u8 emissive_light) | 
| u8 | get_solid_sides (MeshMakeData *data) | 
| Return bitset of the sides of the mesh that consist of solid nodes only Bits: 0 0 -Z +Z -X +X -Y +Y.   | |
      
  | 
  static | 
References TileLayer::color, PreMeshBuffer::layer, and PreMeshBuffer::vertices.
Referenced by MapBlockMesh::MapBlockMesh().
 Here is the caller graph for this function:| video::SColor encode_light | ( | u16 | light, | 
| u8 | emissive_light ) | 
Encodes light of a node. The result is not the final color, but a half-baked vertex color. You have to multiply the resulting color with the node's color.
| light | the first 8 bits are day light, the last 8 bits are night light | 
| emissive_light | amount of light the surface emits, from 0 to LIGHT_SUN. | 
Referenced by MapblockMeshGenerator::blendLightColor(), MapblockMeshGenerator::blendLightColor(), MapblockMeshGenerator::drawAutoLightedCuboid(), MapblockMeshGenerator::drawNode(), MapblockMeshGenerator::drawPlantlikeRootedNode(), MapblockMeshGenerator::drawSolidNode(), final_color_blend(), MapblockMeshGenerator::prepareLiquidNodeDrawing(), ClientEnvironment::step(), and GenericCAO::updateLight().
 Here is the caller graph for this function:| void final_color_blend | ( | video::SColor * | result, | 
| const video::SColor & | data, | ||
| const video::SColorf & | dayLight ) | 
Gives the final SColor shown on screen.
| result | output color | 
| data | the half-baked vertex color | 
| dayLight | color of the sunlight | 
| void final_color_blend | ( | video::SColor * | result, | 
| u16 | light, | ||
| u32 | daynight_ratio ) | 
Gives the final SColor shown on screen.
| result | output color | 
| light | first 8 bits are day light, second 8 bits are night light | 
References encode_light(), final_color_blend(), and get_sunlight_color().
Referenced by final_color_blend(), ClientEnvironment::step(), and Game::updatePointedThing().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
Find a candidate plane to split a set of triangles in two.
The candidate plane is represented by one of the triangles from the set.
| list | Vector of indexes of the triangles in the set | 
| triangles | Vector of all triangles in the BSP tree | 
References MeshTriangle::areaSQ, and MeshTriangle::centroid.
Referenced by MapBlockBspTree::buildTree().
 Here is the caller graph for this function:| u8 get_solid_sides | ( | MeshMakeData * | data | ) | 
Return bitset of the sides of the mesh that consist of solid nodes only Bits: 0 0 -Z +Z -X +X -Y +Y.
References VoxelArea::contains(), NodeDefManager::get(), VoxelManipulator::getNodeRefUnsafe(), VoxelManipulator::m_area, MeshMakeData::m_blockpos, MeshMakeData::m_nodedef, MeshMakeData::m_side_length, MeshMakeData::m_vmanip, and MAP_BLOCKSIZE.
Referenced by MeshUpdateWorkerThread::doUpdate().
 Here is the call graph for this function:
 Here is the caller graph for this function:| void get_sunlight_color | ( | video::SColorf * | sunlight, | 
| u32 | daynight_ratio ) | 
Returns the sunlight's color from the current day-night ratio.
Referenced by final_color_blend(), and GameGlobalShaderConstantSetter::onSetConstants().
 Here is the caller graph for this function:
      
  | 
  static | 
References MapNode::getLight(), NodeDefManager::getLightingFlags(), ContentLightingFlags::light_source, and MYMAX.
Referenced by MapblockMeshGenerator::drawSolidNode(), and getFaceLight().
 Here is the call graph for this function:
 Here is the caller graph for this function:| u16 getFaceLight | ( | MapNode | n, | 
| MapNode | n2, | ||
| const NodeDefManager * | ndef ) | 
References getFaceLight(), LIGHTBANK_DAY, and LIGHTBANK_NIGHT.
 Here is the call graph for this function:
      
  | 
  static | 
References MapNode::getLight(), NodeDefManager::getLightingFlags(), LIGHT_SUN, and rangelim.
Referenced by MapblockMeshGenerator::drawNode(), MapblockMeshGenerator::drawPlantlikeRootedNode(), getInteriorLight(), MapblockMeshGenerator::prepareLiquidNodeDrawing(), ClientEnvironment::step(), GenericCAO::updateLight(), and Game::updatePointedThing().
 Here is the call graph for this function:
 Here is the caller graph for this function:| u16 getInteriorLight | ( | MapNode | n, | 
| s32 | increment, | ||
| const NodeDefManager * | ndef ) | 
References getInteriorLight(), LIGHTBANK_DAY, and LIGHTBANK_NIGHT.
 Here is the call graph for this function:| void getNodeTile | ( | MapNode | mn, | 
| const v3s16 & | p, | ||
| const v3s16 & | dir, | ||
| MeshMakeData * | data, | ||
| TileSpec & | tile ) | 
References dir(), MapNode::getFaceDir(), getNodeTileN(), MeshMakeData::m_nodedef, None, p(), R180, R270, R90, TileSpec::rotation, and TileSpec::world_aligned.
Referenced by MapblockMeshGenerator::getTile().
 Here is the call graph for this function:
 Here is the caller graph for this function:| void getNodeTileN | ( | MapNode | mn, | 
| const v3s16 & | p, | ||
| u8 | tileindex, | ||
| MeshMakeData * | data, | ||
| TileSpec & | tile ) | 
References NodeDefManager::get(), MapNode::getColor(), TileSpec::layers, MeshMakeData::m_crack_pos_relative, MeshMakeData::m_nodedef, MATERIAL_FLAG_CRACK, and p().
Referenced by getNodeTile(), and MapblockMeshGenerator::getTile().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
References CONTENT_IGNORE, CPT_LIGHT, g_settings, NodeDefManager::get(), MapNode::getContent(), Settings::getFloat(), MapNode::getLight(), ContentFeatures::getLightingFlags(), VoxelManipulator::getNodeNoExNoEmerge(), ContentFeatures::light_propagates, ContentFeatures::light_source, LIGHT_SUN, LIGHTBANK_DAY, LIGHTBANK_NIGHT, MeshMakeData::m_nodedef, MeshMakeData::m_vmanip, p(), ContentFeatures::param_type, and rangelim.
Referenced by getSmoothLightTransparent().
 Here is the call graph for this function:
 Here is the caller graph for this function:| u16 getSmoothLightSolid | ( | const v3s16 & | p, | 
| const v3s16 & | face_dir, | ||
| const v3s16 & | corner, | ||
| MeshMakeData * | data ) | 
References getSmoothLightTransparent(), and p().
Referenced by MapblockMeshGenerator::drawSolidNode().
 Here is the call graph for this function:
 Here is the caller graph for this function:| u16 getSmoothLightTransparent | ( | const v3s16 & | p, | 
| const v3s16 & | corner, | ||
| MeshMakeData * | data ) | 
References getSmoothLightCombined(), and p().
Referenced by MapblockMeshGenerator::getSmoothLightFrame(), and getSmoothLightSolid().
 Here is the call graph for this function:
 Here is the caller graph for this function: