diff options
Diffstat (limited to 'scene/3d/gi_probe.h')
-rw-r--r-- | scene/3d/gi_probe.h | 80 |
1 files changed, 7 insertions, 73 deletions
diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index 324ff8e917..0858af0001 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -100,67 +100,6 @@ public: typedef void (*BakeEndFunc)(); private: - //stuff used for bake - struct Baker { - - enum { - CHILD_EMPTY = 0xFFFFFFFF - }; - struct Cell { - - uint32_t childs[8]; - float albedo[3]; //albedo in RGB24 - float emission[3]; //accumulated light in 16:16 fixed point (needs to be integer for moving lights fast) - float normal[3]; - uint32_t used_sides; - float alpha; //used for upsampling - int level; - - Cell() { - for (int i = 0; i < 8; i++) { - childs[i] = CHILD_EMPTY; - } - - for (int i = 0; i < 3; i++) { - emission[i] = 0; - albedo[i] = 0; - normal[i] = 0; - } - alpha = 0; - used_sides = 0; - level = 0; - } - }; - - Vector<Cell> bake_cells; - int cell_subdiv; - - struct MaterialCache { - //128x128 textures - Vector<Color> albedo; - Vector<Color> emission; - }; - - Vector<Color> _get_bake_texture(Ref<Image> p_image, const Color &p_color); - Map<Ref<Material>, MaterialCache> material_cache; - MaterialCache _get_material_cache(Ref<Material> p_material); - int leaf_voxel_count; - - AABB po2_bounds; - int axis_cell_size[3]; - - struct PlotMesh { - Ref<Material> override_material; - Vector<Ref<Material> > instance_materials; - Ref<Mesh> mesh; - Transform local_xform; - }; - - Transform to_cell_space; - - List<PlotMesh> mesh_list; - }; - Ref<GIProbeData> probe_data; RID gi_probe; @@ -175,19 +114,14 @@ private: bool interior; bool compress; - int color_scan_cell_width; - int bake_texture_size; - - Vector<Color> _get_bake_texture(Ref<Image> p_image, const Color &p_color_mul, const Color &p_color_add); - Baker::MaterialCache _get_material_cache(Ref<Material> p_material, Baker *p_baker); - void _plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, const Vector3 *p_vtx, const Vector2 *p_uv, const Baker::MaterialCache &p_material, const AABB &p_aabb, Baker *p_baker); - void _plot_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh, Baker *p_baker, const Vector<Ref<Material> > &p_materials, const Ref<Material> &p_override_material); - void _find_meshes(Node *p_at_node, Baker *p_baker); - void _fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z, Baker *p_baker); - - void _debug_mesh(int p_idx, int p_level, const AABB &p_aabb, Ref<MultiMesh> &p_multimesh, int &idx, Baker *p_baker); - void _create_debug_mesh(Baker *p_baker); + struct PlotMesh { + Ref<Material> override_material; + Vector<Ref<Material> > instance_materials; + Ref<Mesh> mesh; + Transform local_xform; + }; + void _find_meshes(Node *p_at_node, List<PlotMesh> &plot_meshes); void _debug_bake(); protected: |