summaryrefslogtreecommitdiffstats
path: root/scene/3d/gi_probe.cpp
diff options
context:
space:
mode:
authorreduz <juan@okamstudio.com>2016-12-30 08:35:54 -0300
committerreduz <juan@okamstudio.com>2016-12-30 08:35:54 -0300
commitf4a56e7782526e5e20a4351c4c293a7b4f020acd (patch)
tree8a08474f43dbd7e2204bc9688619f27532056339 /scene/3d/gi_probe.cpp
parent289bc881aaec35cc127256137abc7dcf116afd48 (diff)
downloadredot-engine-f4a56e7782526e5e20a4351c4c293a7b4f020acd.tar.gz
begin work on new particle system
Diffstat (limited to 'scene/3d/gi_probe.cpp')
-rw-r--r--scene/3d/gi_probe.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 24ed12027e..de2d9c1b98 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -620,8 +620,10 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V
if (p_baker->bake_cells[p_idx].childs[i]==Baker::CHILD_EMPTY) {
//sub cell must be created
- p_baker->bake_cells[p_idx].childs[i]=p_baker->bake_cells.size();
+ uint32_t child_idx = p_baker->bake_cells.size();
+ p_baker->bake_cells[p_idx].childs[i]=child_idx;
p_baker->bake_cells.resize( p_baker->bake_cells.size() + 1);
+ p_baker->bake_cells[child_idx].level=p_level+1;
}
@@ -1124,7 +1126,12 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){
w32[ofs++]=norm;
}
- w32[ofs++]=uint32_t(baker.bake_cells[i].alpha*65535.0);
+ {
+ uint16_t alpha = CLAMP(uint32_t(baker.bake_cells[i].alpha*65535.0),0,65535);
+ uint16_t level = baker.bake_cells[i].level;
+
+ w32[ofs++] = (uint32_t(level)<<16)|uint32_t(alpha);
+ }
}