Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual texture painting #824

Merged
merged 12 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 88 additions & 1 deletion Editor/Editor_SOURCE.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,50 @@
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\bricks.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\bricks_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\darkrock.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\darkrock_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\foil.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\foil_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\grassparticle.dds">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\ground.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\ground2.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\ground2_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\ground_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\high_altitude.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
Expand All @@ -244,6 +284,18 @@
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\lava.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\lava_emi.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\lava_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\low_altitude.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
Expand All @@ -252,6 +304,30 @@
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\metalplate.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\metalplate_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\pavingstone.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\pavingstone_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\rock.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\rock_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\slope.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
Expand All @@ -260,6 +336,14 @@
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\tactilepaving.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\tactilepaving_nor.jpg">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Image>
</ItemGroup>
<ItemGroup>
<Text Include="$(MSBuildThisFileDirectory)fonts\readme.txt">
Expand All @@ -270,7 +354,10 @@
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Text>
<Text Include="$(MSBuildThisFileDirectory)terrain\licenses.txt" />
<Text Include="$(MSBuildThisFileDirectory)terrain\licenses.txt">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</Text>
</ItemGroup>
<ItemGroup>
<Xml Include="$(MSBuildThisFileDirectory)languages\Magyar.xml">
Expand Down
63 changes: 63 additions & 0 deletions Editor/Editor_SOURCE.vcxitems.filters
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,69 @@
<Image Include="$(MSBuildThisFileDirectory)terrain\grassparticle.dds">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\bricks.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\bricks_nor.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\darkrock.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\darkrock_nor.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\foil.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\foil_nor.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\ground.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\ground_nor.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\ground2.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\ground2_nor.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\lava.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\lava_emi.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\lava_nor.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\metalplate.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\metalplate_nor.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\pavingstone.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\pavingstone_nor.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\rock.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\rock_nor.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\tactilepaving.jpg">
<Filter>terrain</Filter>
</Image>
<Image Include="$(MSBuildThisFileDirectory)terrain\tactilepaving_nor.jpg">
<Filter>terrain</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<Text Include="$(MSBuildThisFileDirectory)terrain\licenses.txt">
Expand Down
18 changes: 17 additions & 1 deletion Editor/MaterialWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void MaterialWindow::Create(EditorComponent* _editor)
{
editor = _editor;
wi::gui::Window::Create(ICON_MATERIAL " Material", wi::gui::Window::WindowControls::COLLAPSE | wi::gui::Window::WindowControls::CLOSE);
SetSize(XMFLOAT2(300, 1360));
SetSize(XMFLOAT2(300, 1380));

closeButton.SetTooltip("Delete MaterialComponent");
OnClose([=](wi::gui::EventArgs args) {
Expand Down Expand Up @@ -476,6 +476,19 @@ void MaterialWindow::Create(EditorComponent* _editor)
});
AddWidget(&clearcoatRoughnessSlider);

blendTerrainSlider.Create(0, 2, 0, 1000, "Blend with terrain: ");
blendTerrainSlider.SetTooltip("Blend with terrain height.");
blendTerrainSlider.SetSize(XMFLOAT2(wid, hei));
blendTerrainSlider.SetPos(XMFLOAT2(x, y += step));
blendTerrainSlider.OnSlide([&](wi::gui::EventArgs args) {
MaterialComponent* material = editor->GetCurrentScene().materials.GetComponent(entity);
if (material != nullptr)
{
material->blend_with_terrain_height = args.fValue;
}
});
AddWidget(&blendTerrainSlider);


//
hei = 20;
Expand Down Expand Up @@ -822,6 +835,7 @@ void MaterialWindow::SetEntity(Entity entity)
shaderTypeComboBox.AddItem("Cloth", MaterialComponent::SHADERTYPE_PBR_CLOTH);
shaderTypeComboBox.AddItem("Clear coat", MaterialComponent::SHADERTYPE_PBR_CLEARCOAT);
shaderTypeComboBox.AddItem("Cloth + Clear coat", MaterialComponent::SHADERTYPE_PBR_CLOTH_CLEARCOAT);
shaderTypeComboBox.AddItem("Terrain blended", MaterialComponent::SHADERTYPE_PBR_TERRAINBLENDED);
shaderTypeComboBox.AddItem("Water", MaterialComponent::SHADERTYPE_WATER);
shaderTypeComboBox.AddItem("Cartoon", MaterialComponent::SHADERTYPE_CARTOON);
shaderTypeComboBox.AddItem("Unlit", MaterialComponent::SHADERTYPE_UNLIT);
Expand Down Expand Up @@ -883,6 +897,7 @@ void MaterialWindow::SetEntity(Entity entity)
sheenRoughnessSlider.SetValue(material->sheenRoughness);
clearcoatSlider.SetValue(material->clearcoat);
clearcoatRoughnessSlider.SetValue(material->clearcoatRoughness);
blendTerrainSlider.SetValue(material->blend_with_terrain_height);

shadingRateComboBox.SetEnabled(wi::graphics::GetDevice()->CheckCapability(GraphicsDeviceCapability::VARIABLE_RATE_SHADING));

Expand Down Expand Up @@ -989,6 +1004,7 @@ void MaterialWindow::ResizeLayout()
add(sheenRoughnessSlider);
add(clearcoatSlider);
add(clearcoatRoughnessSlider);
add(blendTerrainSlider);
add(colorComboBox);
add_fullwidth(colorPicker);
add(textureSlotComboBox);
Expand Down
1 change: 1 addition & 0 deletions Editor/MaterialWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class MaterialWindow : public wi::gui::Window
wi::gui::Slider sheenRoughnessSlider;
wi::gui::Slider clearcoatSlider;
wi::gui::Slider clearcoatRoughnessSlider;
wi::gui::Slider blendTerrainSlider;

wi::gui::ComboBox colorComboBox;
wi::gui::ColorPicker colorPicker;
Expand Down
Loading
Loading