1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Shadow mapping render pass (#11244)

Co-authored-by: x2048 <codeforsmile@gmail.com>
This commit is contained in:
Liso 2021-06-06 18:51:21 +02:00 committed by GitHub
parent 46f42e15c4
commit c47313db65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 2624 additions and 38 deletions

View file

@ -119,10 +119,14 @@ public:
}
void getBlocksInViewRange(v3s16 cam_pos_nodes,
v3s16 *p_blocks_min, v3s16 *p_blocks_max);
v3s16 *p_blocks_min, v3s16 *p_blocks_max, float range=-1.0f);
void updateDrawList();
void updateDrawListShadow(const v3f &shadow_light_pos, const v3f &shadow_light_dir, float shadow_range);
void renderMap(video::IVideoDriver* driver, s32 pass);
void renderMapShadows(video::IVideoDriver *driver,
const video::SMaterial &material, s32 pass);
int getBackgroundBrightness(float max_d, u32 daylight_factor,
int oldvalue, bool *sunlight_seen_result);
@ -132,9 +136,12 @@ public:
virtual void PrintInfo(std::ostream &out);
const MapDrawControl & getControl() const { return m_control; }
f32 getWantedRange() const { return m_control.wanted_range; }
f32 getCameraFov() const { return m_camera_fov; }
private:
Client *m_client;
RenderingEngine *m_rendering_engine;
aabb3f m_box = aabb3f(-BS * 1000000, -BS * 1000000, -BS * 1000000,
BS * 1000000, BS * 1000000, BS * 1000000);
@ -147,10 +154,12 @@ private:
v3s16 m_camera_offset;
std::map<v3s16, MapBlock*> m_drawlist;
std::map<v3s16, MapBlock*> m_drawlist_shadow;
std::set<v2s16> m_last_drawn_sectors;
bool m_cache_trilinear_filter;
bool m_cache_bilinear_filter;
bool m_cache_anistropic_filter;
bool m_added_to_shadow_renderer{false};
};