Merge remote-tracking branch 'upstream/main' into Atom/olexl/ATOM-15376

This commit is contained in:
Aristo7
2021-05-11 15:19:17 -05:00
1038 changed files with 27130 additions and 108174 deletions
@@ -506,9 +506,10 @@ namespace AZ::AtomBridge
{
if (m_auxGeomPtr)
{
AZStd::vector<AZ::Vector3> transformedVertices = ToWorldSpacePosition(vertices);
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
drawArgs.m_verts = vertices.data();
drawArgs.m_vertCount = aznumeric_cast<uint32_t>(vertices.size());
drawArgs.m_verts = transformedVertices.data();
drawArgs.m_vertCount = aznumeric_cast<uint32_t>(transformedVertices.size());
drawArgs.m_colors = &color;
drawArgs.m_colorCount = 1;
drawArgs.m_opacityType = m_rendState.m_opacityType;
@@ -526,9 +527,10 @@ namespace AZ::AtomBridge
{
if (m_auxGeomPtr)
{
AZStd::vector<AZ::Vector3> transformedVertices = ToWorldSpacePosition(vertices);
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments drawArgs;
drawArgs.m_verts = vertices.data();
drawArgs.m_vertCount = aznumeric_cast<uint32_t>(vertices.size());
drawArgs.m_verts = transformedVertices.data();
drawArgs.m_vertCount = aznumeric_cast<uint32_t>(transformedVertices.size());
drawArgs.m_indices = indices.data();
drawArgs.m_indexCount = aznumeric_cast<uint32_t>(indices.size());
drawArgs.m_colors = &color;
@@ -659,9 +661,10 @@ namespace AZ::AtomBridge
{
if (m_auxGeomPtr)
{
AZStd::vector<AZ::Vector3> transformedLines = ToWorldSpacePosition(lines);
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
drawArgs.m_verts = lines.data();
drawArgs.m_vertCount = aznumeric_cast<uint32_t>(lines.size());
drawArgs.m_verts = transformedLines.data();
drawArgs.m_vertCount = aznumeric_cast<uint32_t>(transformedLines.size());
drawArgs.m_colors = &color;
drawArgs.m_colorCount = 1;
drawArgs.m_size = m_rendState.m_lineWidth;
@@ -928,13 +931,14 @@ namespace AZ::AtomBridge
{
if (m_auxGeomPtr)
{
const float scale = GetCurrentTransform().RetrieveScale().GetMaxElement();
const AZ::Vector3 worldCenter = ToWorldSpacePosition(center);
const AZ::Vector3 worldAxis = ToWorldSpaceVector(axis);
m_auxGeomPtr->DrawCylinder(
worldCenter,
worldAxis,
radius,
height,
scale * radius,
scale * height,
m_rendState.m_color,
AZ::RPI::AuxGeomDraw::DrawStyle::Line,
m_rendState.m_depthTest,
@@ -954,13 +958,14 @@ namespace AZ::AtomBridge
{
if (m_auxGeomPtr)
{
const float scale = GetCurrentTransform().RetrieveScale().GetMaxElement();
const AZ::Vector3 worldCenter = ToWorldSpacePosition(center);
const AZ::Vector3 worldAxis = ToWorldSpaceVector(axis);
m_auxGeomPtr->DrawCylinder(
worldCenter,
worldAxis,
radius,
height,
scale * radius,
scale * height,
m_rendState.m_color,
drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid,
m_rendState.m_depthTest,
@@ -1064,10 +1069,10 @@ namespace AZ::AtomBridge
{
if (m_auxGeomPtr)
{
const float scale = GetCurrentTransform().RetrieveScale().GetMaxElement();
m_auxGeomPtr->DrawSphere(
ToWorldSpacePosition(pos),
radius,
scale * radius,
m_rendState.m_color,
AZ::RPI::AuxGeomDraw::DrawStyle::Line,
m_rendState.m_depthTest,
@@ -1158,12 +1163,13 @@ namespace AZ::AtomBridge
{
if (m_auxGeomPtr)
{
const float scale = GetCurrentTransform().RetrieveScale().GetMaxElement();
const AZ::Vector3 worldPos = ToWorldSpacePosition(pos);
const AZ::Vector3 worldDir = ToWorldSpaceVector(dir);
m_auxGeomPtr->DrawDisk(
worldPos,
worldDir,
radius,
scale * radius,
m_rendState.m_color,
AZ::RPI::AuxGeomDraw::DrawStyle::Shaded,
m_rendState.m_depthTest,
@@ -1513,6 +1519,26 @@ namespace AZ::AtomBridge
return m_rendState.m_transformStack[m_rendState.m_currentTransform];
}
AZStd::vector<AZ::Vector3> AtomDebugDisplayViewportInterface::ToWorldSpacePosition(const AZStd::vector<AZ::Vector3>& positions) const
{
AZStd::vector<AZ::Vector3> transformedPositions;
transformedPositions.resize_no_construct(positions.size());
AZStd::transform(positions.begin(), positions.end(), transformedPositions.begin(), [this](const AZ::Vector3& position) {
return ToWorldSpacePosition(position);
});
return transformedPositions;
}
AZStd::vector<AZ::Vector3> AtomDebugDisplayViewportInterface::ToWorldSpaceVector(const AZStd::vector<AZ::Vector3>& vectors) const
{
AZStd::vector<AZ::Vector3> transformedVectors;
transformedVectors.resize_no_construct(vectors.size());
AZStd::transform(vectors.begin(), vectors.end(), transformedVectors.begin(), [this](const AZ::Vector3& vector) {
return ToWorldSpaceVector(vector);
});
return transformedVectors;
}
AZ::RPI::ViewportContextPtr AtomDebugDisplayViewportInterface::GetViewportContext() const
{
auto viewContextManager = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
@@ -249,6 +249,12 @@ namespace AZ::AtomBridge
//! Convert direction to world space (translation is not considered)
AZ::Vector3 ToWorldSpaceVector(const AZ::Vector3& v) const { return m_rendState.m_transformStack[m_rendState.m_currentTransform].Multiply3x3(v); }
//! Convert positions to world space.
AZStd::vector<AZ::Vector3> ToWorldSpacePosition(const AZStd::vector<AZ::Vector3>& positions) const;
//! Convert directions to world space (translation is not considered)
AZStd::vector<AZ::Vector3> ToWorldSpaceVector(const AZStd::vector<AZ::Vector3>& vectors) const;
void CalcBasisVectors(const AZ::Vector3& n, AZ::Vector3& b1, AZ::Vector3& b2) const;
const AZ::Matrix3x4& GetCurrentTransform() const;
+1 -1
View File
@@ -1,5 +1,5 @@
{
"gem_name": "AtomLyIntegration_AtomFont",
"gem_name": "AtomFont",
"Dependencies": [
],
"GemFormatVersion": 4,
@@ -112,7 +112,7 @@ namespace AZ
bool AreaLightComponentConfig::SupportsShadows() const
{
return m_shapeType == AZ_CRC_CE("DiskShape");
return m_lightType == LightType::SpotDisk || m_lightType == LightType::Sphere;
}
bool AreaLightComponentConfig::ShadowsDisabled() const
@@ -101,6 +101,7 @@ namespace AZ
template <typename FeatureProcessorType>
void LightDelegateBase<FeatureProcessorType>::OnShapeChanged(ShapeChangeReasons changeReason)
{
AZ_Assert(m_shapeBus, "OnShapeChanged called without a shape bus present.");
if (changeReason == ShapeChangeReasons::TransformChanged)
{
AZ::Aabb aabb; // unused, but required for GetTransformAndLocalBounds()
@@ -133,7 +134,11 @@ namespace AZ
{
// now visible, acquire light handle and update values.
m_lightHandle = m_featureProcessor->AcquireLight();
OnShapeChanged(ShapeChangeReasons::TransformChanged);
if (m_shapeBus)
{
// For lights that get their transform from the shape bus, force an OnShapeChanged to update the transform.
OnShapeChanged(ShapeChangeReasons::TransformChanged);
}
}
}
@@ -63,5 +63,64 @@ namespace AZ
debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity));
}
}
void SphereLightDelegate::SetEnableShadow(bool enabled)
{
Base::SetEnableShadow(enabled);
if (GetLightHandle().IsValid())
{
GetFeatureProcessor()->SetShadowsEnabled(GetLightHandle(), enabled);
}
}
void SphereLightDelegate::SetShadowmapMaxSize(ShadowmapSize size)
{
if (GetShadowsEnabled() && GetLightHandle().IsValid())
{
GetFeatureProcessor()->SetShadowmapMaxResolution(GetLightHandle(), size);
}
}
void SphereLightDelegate::SetShadowFilterMethod(ShadowFilterMethod method)
{
if (GetShadowsEnabled() && GetLightHandle().IsValid())
{
GetFeatureProcessor()->SetShadowFilterMethod(GetLightHandle(), method);
}
}
void SphereLightDelegate::SetSofteningBoundaryWidthAngle(float widthInDegrees)
{
if (GetShadowsEnabled() && GetLightHandle().IsValid())
{
GetFeatureProcessor()->SetSofteningBoundaryWidthAngle(GetLightHandle(), DegToRad(widthInDegrees));
}
}
void SphereLightDelegate::SetPredictionSampleCount(uint32_t count)
{
if (GetShadowsEnabled() && GetLightHandle().IsValid())
{
GetFeatureProcessor()->SetPredictionSampleCount(GetLightHandle(), count);
}
}
void SphereLightDelegate::SetFilteringSampleCount(uint32_t count)
{
if (GetShadowsEnabled() && GetLightHandle().IsValid())
{
GetFeatureProcessor()->SetFilteringSampleCount(GetLightHandle(), count);
}
}
void SphereLightDelegate::SetPcfMethod(PcfMethod method)
{
if (GetShadowsEnabled() && GetLightHandle().IsValid())
{
GetFeatureProcessor()->SetPcfMethod(GetLightHandle(), method);
}
}
} // namespace Render
} // namespace AZ
@@ -24,6 +24,8 @@ namespace AZ
class SphereLightDelegate final
: public LightDelegateBase<PointLightFeatureProcessorInterface>
{
using Base = LightDelegateBase<PointLightFeatureProcessorInterface>;
public:
SphereLightDelegate(LmbrCentral::SphereShapeComponentRequests* shapeBus, EntityId entityId, bool isVisible);
@@ -32,6 +34,13 @@ namespace AZ
void DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const override;
float GetSurfaceArea() const override;
float GetEffectiveSolidAngle() const override { return PhotometricValue::OmnidirectionalSteradians; }
void SetEnableShadow(bool enabled) override;
void SetShadowmapMaxSize(ShadowmapSize size) override;
void SetShadowFilterMethod(ShadowFilterMethod method) override;
void SetSofteningBoundaryWidthAngle(float widthInDegrees) override;
void SetPredictionSampleCount(uint32_t count) override;
void SetFilteringSampleCount(uint32_t count) override;
void SetPcfMethod(PcfMethod method) override;
private:
@@ -213,7 +213,11 @@ namespace AZ
}
// Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties
auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget(&group, &group, group.TYPEINFO_Uuid(), this, this,
const AZ::Crc32 saveStateKey(AZStd::string::format(
"MaterialPropertyInspector::PropertyGroup::%s::%s", m_materialAssetId.ToString<AZStd::string>().c_str(),
groupNameId.c_str()));
auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget(
&group, &group, group.TYPEINFO_Uuid(), this, this, saveStateKey,
[this](const AzToolsFramework::InstanceDataNode* source, const AzToolsFramework::InstanceDataNode* target) {
AZ_UNUSED(source);
const AtomToolsFramework::DynamicProperty* property = AtomToolsFramework::FindDynamicPropertyForInstanceDataNode(target);
@@ -262,7 +266,11 @@ namespace AZ
}
// Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties
auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget(&group, &group, group.TYPEINFO_Uuid(), this, this,
const AZ::Crc32 saveStateKey(AZStd::string::format(
"MaterialPropertyInspector::PropertyGroup::%s::%s", m_materialAssetId.ToString<AZStd::string>().c_str(),
groupNameId.c_str()));
auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget(
&group, &group, group.TYPEINFO_Uuid(), this, this, saveStateKey,
[this](const AzToolsFramework::InstanceDataNode* source, const AzToolsFramework::InstanceDataNode* target) {
AZ_UNUSED(source);
const AtomToolsFramework::DynamicProperty* property = AtomToolsFramework::FindDynamicPropertyForInstanceDataNode(target);
@@ -296,8 +296,7 @@ namespace AZ
m_configuration.m_modelAsset = modelAsset;
MeshComponentNotificationBus::Event(m_entityId, &MeshComponentNotificationBus::Events::OnModelReady, m_configuration.m_modelAsset, model);
MaterialReceiverNotificationBus::Event(m_entityId, &MaterialReceiverNotificationBus::Events::OnMaterialAssignmentsChanged);
AzFramework::EntityBoundsUnionRequestBus::Broadcast(
&AzFramework::EntityBoundsUnionRequestBus::Events::RefreshEntityLocalBoundsUnion, m_entityId);
AZ::Interface<AzFramework::IEntityBoundsUnion>::Get()->RefreshEntityLocalBoundsUnion(m_entityId);
}
}
@@ -253,8 +253,7 @@ namespace AZ
m_configuration.m_outerLength = dimensions.GetY();
m_configuration.m_outerHeight = dimensions.GetZ();
AzFramework::EntityBoundsUnionRequestBus::Broadcast(
&AzFramework::EntityBoundsUnionRequestBus::Events::RefreshEntityLocalBoundsUnion, m_entityId);
AZ::Interface<AzFramework::IEntityBoundsUnion>::Get()->RefreshEntityLocalBoundsUnion(m_entityId);
// clamp the inner extents to the outer extents
m_configuration.m_innerWidth = AZStd::min(m_configuration.m_innerWidth, m_configuration.m_outerWidth);
@@ -82,8 +82,7 @@ namespace AZ
// Update RenderActorInstance local bounding box
m_localAABB = AZ::Aabb::CreateFromMinMax(m_actorInstance->GetStaticBasedAABB().GetMin(), m_actorInstance->GetStaticBasedAABB().GetMax());
AzFramework::EntityBoundsUnionRequestBus::Broadcast(
&AzFramework::EntityBoundsUnionRequestBus::Events::RefreshEntityLocalBoundsUnion, m_entityId);
AZ::Interface<AzFramework::IEntityBoundsUnion>::Get()->RefreshEntityLocalBoundsUnion(m_entityId);
}
AZ::Aabb AtomActorInstance:: GetWorldBounds()
@@ -16,7 +16,7 @@ with Lumberyard. Note: this boostrap is only designed fo be py3 compatible.
If you need DCCsi access in py27 (Autodesk Maya for instance) you may need
to implement your own boostrapper module. Currently this is boostrapped
from add_dccsi.py, as a temporty measure related to this Jira:
https://jira.agscollab.com/browse/SPEC-2581"""
SPEC-2581"""
# standard imports
import sys
import os
@@ -25,7 +25,7 @@ the provided env and launcher bat files.
If you are developing for the DCCsi you can use this launcher to start Maya:
DccScriptingInterface\Launchers\Windows\Launch_Maya_2020.bat"
To Do: https://jira.agscollab.com/browse/ATOM-5861
To Do: ATOM-5861
"""
__project__ = 'DccScriptingInterface'
@@ -43,7 +43,7 @@ Note: to get this to work unfortunatley each user must configure the wingide pre
(there is no shared project / data-driven way that I know of to set this up otherwise)
Note: lumberyard is not currently generating __init__.pyi files in that package structure:
https://jira.agscollab.com/browse/SPEC-3315
SPEC-3315
The workaround is to create them yourself (they can be empty) and needs to be in the root of each package folder, like this:
dev\Cache\AtomTechArt\pc\user\python_symbols\azlmbr\__init__.pyi
@@ -63,4 +63,4 @@ You might need to reboot wing. Then you should have auto-complete for the lumbe
Note: the entirety of azlmbr api does not generate .pyi files currently,
all of the "Behaviour Context" based classes do
non-BC modules such as azlmbr.paths currently do not
https://jira.agscollab.com/browse/SPEC-3316
SPEC-3316
@@ -40,7 +40,7 @@ Module Documentation:
<to do: further document this module>
To Do:
https://jira.agscollab.com/browse/ATOM-5859
ATOM-5859
'''
# -------------------------------------------------------------------------
@@ -22,7 +22,7 @@ Module: <DCCsi>\azpy\shared\common\config_utils.py
<to do: further document this module>
To Do:
https://jira.agscollab.com/browse/ATOM-5859
ATOM-5859
'''
# -------------------------------------------------------------------------