7052ccfa52
* Terrain feature processor improvements regarding material, mesh, and lod - Now using a material with pbr lighting for terrain. Removed some of the old shader code that wasn't needed anymore - Move heightmap image declaration to the material so it's not needed in the object SRG anymore - Added prototype code (commented out) for smoothing the terrain with a b-spline weighting function - Mesh data is all made with a proper mesh asset now. - Added basic LOD support (no continuous LOD yet, but it does pop between lod levels) - Moved RenderCommon to be accessible publicly. It contains stencil refs that should be public. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Adding more material options to terrain shader Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Fixing terrain's per object srg because of changes in the default per object srg. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Added more features to the terrain material. Shader & Material reloads are now handled. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Added stub for terrain render max area setting in the renderer component. Added detail texture tiling setable from the material Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Missing change to material type from last commit Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Adding macro material in material type and support detail roughness. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Fixing merge issues in terrain material type Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Adding more features to the terrain material - Macro color and normals - Detail layer fade out - Reoriented detail normals Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Remove line that unintentionally was added back during a rebase & merge. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Fixing previously deleted unused static that came back after a merge. Fixed an issue with macro normals in the terrain shader. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>
57 lines
1.9 KiB
C++
57 lines
1.9 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
|
|
#include <EditorComponents/EditorTerrainWorldRendererComponent.h>
|
|
#include <AzCore/Serialization/SerializeContext.h>
|
|
#include <AzCore/Serialization/EditContext.h>
|
|
|
|
namespace Terrain
|
|
{
|
|
void EditorTerrainWorldRendererComponent::Reflect(AZ::ReflectContext* context)
|
|
{
|
|
BaseClassType::Reflect(context);
|
|
|
|
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
|
|
|
|
if (serializeContext)
|
|
{
|
|
serializeContext->Class<EditorTerrainWorldRendererComponent, BaseClassType>()
|
|
->Version(0)
|
|
;
|
|
|
|
if (auto editContext = serializeContext->GetEditContext())
|
|
{
|
|
editContext->Class<EditorTerrainWorldRendererComponent>(
|
|
"Terrain World Renderer", "")
|
|
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
|
->Attribute(AZ::Edit::Attributes::Category, "Terrain")
|
|
->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/Components/TerrainWorldRenderer.svg")
|
|
->Attribute(AZ::Edit::Attributes::ViewportIcon, "Editor/Icons/Components/Viewport/TerrainWorldRenderer.svg")
|
|
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZStd::vector<AZ::Crc32>({ AZ_CRC_CE("Level") }))
|
|
;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void EditorTerrainWorldRendererComponent::Init()
|
|
{
|
|
BaseClassType::Init();
|
|
}
|
|
|
|
void EditorTerrainWorldRendererComponent::Activate()
|
|
{
|
|
BaseClassType::Activate();
|
|
}
|
|
|
|
AZ::u32 EditorTerrainWorldRendererComponent::ConfigurationChanged()
|
|
{
|
|
return BaseClassType::ConfigurationChanged();
|
|
}
|
|
}
|