Skip to content

Commit

Permalink
Added undo/redo after calculating lightmaps.
Browse files Browse the repository at this point in the history
Changed default colormap option to smooth.
Optimized the lightmap calculations, expected to be 10~20 times faster.
Changed the shadow calculation from an additive model to a negative model (can be changed, by default it will use the previous formula to avoid compatibily issues).
Changed the default light settings:
 - The falloff style was changed to a new function 'S Curve' instead of linear. This produces better result to official lights (still not 100% accurate though).
Added a new 'Light Edit' menu for the Edit Mode.
Fixed Magic falloff style formula.
Fixed the sun direction if matching the RSW settings.
When moving a light, it will now keep its current height relative to the ground rather than sticking to the ground.
Added a 'Quick preview' option when selecting a light. This option renders the light (except the sun) using the shader for instant result. It's not perfect, but it can be a big help when picking a light setting.
  • Loading branch information
Tokeiburu committed Dec 7, 2024
1 parent d2ca54c commit aceb051
Show file tree
Hide file tree
Showing 29 changed files with 1,101 additions and 162 deletions.
2 changes: 2 additions & 0 deletions BrowEdit3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<ClCompile Include="browedit\actions\GndTextureActions.cpp" />
<ClCompile Include="browedit\actions\GndVersionChangeAction.cpp" />
<ClCompile Include="browedit\actions\GroupAction.cpp" />
<ClCompile Include="browedit\actions\LightmapChangeAction.cpp" />
<ClCompile Include="browedit\actions\LightmapNewAction.cpp" />
<ClCompile Include="browedit\actions\LubChangeTextureAction.cpp" />
<ClCompile Include="browedit\actions\ModelChangeAction.cpp" />
Expand Down Expand Up @@ -144,6 +145,7 @@
<ClInclude Include="browedit\actions\GndTextureActions.h" />
<ClInclude Include="browedit\actions\GndVersionChangeAction.h" />
<ClInclude Include="browedit\actions\GroupAction.h" />
<ClInclude Include="browedit\actions\LightmapChangeAction.h" />
<ClInclude Include="browedit\actions\LightmapNewAction.h" />
<ClInclude Include="browedit\actions\LubChangeTextureAction.h" />
<ClInclude Include="browedit\actions\ModelChangeAction.h" />
Expand Down
6 changes: 6 additions & 0 deletions BrowEdit3.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@
<ClCompile Include="browedit\actions\LubChangeTextureAction.cpp">
<Filter>browedit\actions</Filter>
</ClCompile>
<ClCompile Include="browedit\actions\LightmapChangeAction.cpp">
<Filter>browedit\actions</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="lib\imgui\imgui.h">
Expand Down Expand Up @@ -741,6 +744,9 @@
<ClInclude Include="browedit\actions\LubChangeTextureAction.h">
<Filter>browedit\actions</Filter>
</ClInclude>
<ClInclude Include="browedit\actions\LightmapChangeAction.h">
<Filter>browedit\actions</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="BrowEdit3.rc">
Expand Down
8 changes: 6 additions & 2 deletions browedit/BrowEdit.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class BrowEdit
} textureBrushMode = TextureBrushMode::Stamp;
TextureBrushMode brushModeBeforeDropper;

bool heightDoodle = true;
bool heightDoodle = false;

std::map<std::string, std::vector<std::string>> tagList; // tag -> [ file ], utf8
std::map<std::string, std::vector<std::string>> tagListReverse; // file -> [ tag ], kr
Expand All @@ -258,7 +258,11 @@ class BrowEdit
Config config;
std::vector<std::pair<Node*, glm::vec3>> newNodes;
glm::vec3 newNodesCenter;
bool newNodeHeight = false;
enum {
Ground, // The new node will be relative to the ground
Absolute, // The new node position will be determined by newNodesCenter
Relative // The new node will be relative to the ground + newNodesCenter
} newNodePlacement = Ground;
std::vector<CopyCube*> newCubes;
std::vector<CopyCubeGat*> newGatCubes;
int pasteOptions = -1;
Expand Down
2 changes: 1 addition & 1 deletion browedit/HotkeyActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void BrowEdit::registerActions()
else if (editMode == EditMode::Gat && !heightDoodle)
pasteGat();
}, hasActiveMapView);
HotkeyRegistry::registerAction(HotkeyAction::Global_PasteChangeHeight, [this]() { if (editMode == EditMode::Object) { newNodeHeight = !newNodeHeight; } }, hasActiveMapView);
HotkeyRegistry::registerAction(HotkeyAction::Global_PasteChangeHeight, [this]() { if (editMode == EditMode::Object) { newNodePlacement = newNodePlacement == BrowEdit::Absolute ? BrowEdit::Ground : BrowEdit::Absolute; } }, hasActiveMapView);

HotkeyRegistry::registerAction(HotkeyAction::Global_ClearZeroHeightWalls, [this]() { activeMapView->map->rootNode->getComponent<Gnd>()->removeZeroHeightWalls(); }, hasActiveMapView);
HotkeyRegistry::registerAction(HotkeyAction::Global_CalculateQuadtree, [this]() { activeMapView->map->recalculateQuadTree(this); }, hasActiveMapView);
Expand Down
Loading

0 comments on commit aceb051

Please sign in to comment.