Skip to content

Commit

Permalink
Release v23.07 (#139)
Browse files Browse the repository at this point in the history
* OGSMOD-2545: Port latest Platform code to Aurora (#76)

* OGSMOD-2545: Port latest Oxide code to hdAurora (#77)

* OGSMOD-3172: Implement image processing via custom resolver (#78)

* OGSMOD-3264: Ensure image nodes are parsed correctly (#79)

* OGSMOD-3171: Set camera projection in render pass (#81)

* OGSMOD-3281: Aurora build failed to find Boost (if USD does not build with Python) and miniz (case issue on Linux)

* OGSMOD-3294: Fixed the Linux build

* OGSMOD-3048: fix Inventor crash when switching to RRR (#89)

* OGSMOD-3171: Support Linerization of LDR images (#91)

* OGSMOD-2529: Speed up compile times (#84)

* OGSMOD-3343: Add normal to BSDF inputs (#92)

* OGSMOD-3324: Add version numbers for DLLs (#90)

* OGSMOD-1391: Support multiple distant lights (#93)

* OGSMOD-3410: Support half float input in ImageProcessingResolver (#94)

* OGSMOD-3406: fix performance regression caused by bug in resource tracker (#97)

* OGSMOD-3406: fix performance regression caused by building TLAS every frame

* OGSMOD-3405: Fix crash on material changes (#98)

* Add debug normals test

* OGSMOD-3414: Rename the DLLs to match USD case conventions (#96)

* OGSMOD-3434: Avoid empty bounds in HdAurora (#104)

* OGSMOD-3435: Accept vec3 opacity from Hydra UsdPreviewSurface (#105)

* OGSMOD-3436: Disable tangents in HdAurora (#107)
* OGSMOD-3451 Fixed the broken debug build of OpenImageIO and USD
* OGSMOD-3444: Use transfer buffers for CPU-GPU transfers (#108)

* OGSMOD-3528: Don't use transfer buffers for Alias Maps (#112)

* OGSMOD-3539: Use D3D12_RESOURCE_STATE_COPY_DEST for transfer buffers (#115)

* OGSMOD-3579: Implement material emission specified with a color (#118)

* OGSMOD-3340: Ensure right toolset is used for VS2022 (#121)

* OGSMOD-3580: Implement material emission specified with an image (#119)

* OGSMOD-3696: Add clang-format pre-commit hook to Aurora (#124)

* OGSMOD-3340: Update build instructions to mention Visual Studio 2022 (#122)

* OGSMOD-3581: Implement material emission with denoising enabled (#125)

* OGSMOD-3301: Generate material accessors + struct in test (#128)

* OGSMOD-3301: Fix HGI backend (#130)

* OGSMOD-3531: Ensure tangent actually disabled in all cases (#131)
  • Loading branch information
gareth-morgan-autodesk committed Jul 20, 2023
1 parent 5ad8c8a commit dbb7199
Show file tree
Hide file tree
Showing 237 changed files with 11,083 additions and 3,835 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Ignore build directories.
Build/
Build.*/
_build/
Externals/
_externals/

# Ignore script generated files
Scripts/cmake/externalsConfig.cmake

__pycache__

# Ignore IDE cache folders
.vs/
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# clang-format pre-commit hook configuration file.
# Should be activated before commiting code to the Aurora repository, see Doc\CodingStandards.md for more details.
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
- id: clang-format
exclude: Source/DirectX/DirectXHeaders/d3dx12.h

2 changes: 1 addition & 1 deletion Applications/Plasma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ add_executable(${PROJECT_NAME}
"SceneContents.h"
)

# Set custom ouput properties.
# Set custom output properties.
set_target_properties(${PROJECT_NAME} PROPERTIES
FOLDER "Applications"
RUNTIME_OUTPUT_DIRECTORY "${RUNTIME_OUTPUT_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion Applications/Plasma/Camera.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Applications/Plasma/Camera.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Applications/Plasma/Libraries.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Applications/Plasma/Loaders.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
102 changes: 85 additions & 17 deletions Applications/Plasma/OBJLoader.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -13,11 +13,14 @@
// limitations under the License.
#include "pch.h"

#include "Aurora/Foundation/Geometry.h"
#include "Loaders.h"
#include "SceneContents.h"

uint32_t ImageCache::whitePixels[1] = { 0xFFFFFFFF };

#define PLASMA_HAS_TANGENTS 0

// A simple structure describing an OBJ index, which has sub-indices for vertex channels: position,
// normal, and texture coordinates.
struct OBJIndex
Expand Down Expand Up @@ -120,7 +123,8 @@ bool loadOBJFile(Aurora::IRenderer* /*pRenderer*/, Aurora::IScene* pScene, const
{
transmissionColor = vec3(1.0f);
}
vec3 opacity = vec3(1.0f); // objMaterial.dissolve (see NOTE above)
vec3 emissionColor = ::sRGBToLinear(make_vec3(objMaterial.emission));
vec3 opacity = vec3(1.0f); // objMaterial.dissolve (see NOTE above)

// Load the base color image file from the "map_Kd" file path.
// NOTE: Set the linearize flag, as these images typically use the sRGB color space.
Expand All @@ -132,6 +136,11 @@ bool loadOBJFile(Aurora::IRenderer* /*pRenderer*/, Aurora::IScene* pScene, const
Aurora::Path specularRoughnessImage =
imageCache.getImage(objMaterial.roughness_texname, pScene, false);

// Load the emission color image file from the "map_Ke" file path.
// NOTE: Set the linearize flag, as these images typically use the sRGB color space.
Aurora::Path emissionColorImage =
imageCache.getImage(objMaterial.emissive_texname, pScene, true);

// Load the opacity image file from the "map_d" file path.
// NOTE: Don't set the linearize flag, as these images typically use the linear color space.
Aurora::Path opacityImage = imageCache.getImage(objMaterial.alpha_texname, pScene, false);
Expand All @@ -144,17 +153,33 @@ bool loadOBJFile(Aurora::IRenderer* /*pRenderer*/, Aurora::IScene* pScene, const
: objMaterial.normal_texname;
Aurora::Path normalImage = imageCache.getImage(normalFilePath, pScene, false);

Aurora::Path materialPath = filePath + ":OBJFileMaterial-" + to_string(mtlCount++);
// Set emission (the actual light emitted) to 1.0 if there is an emission color image or the
// emission color has any positive components.
float emission = (!emissionColorImage.empty() || emissionColor.length()) ? 1.0f : 0.0f;

// Create an Aurora material, assign the properties, and add the material to the list.
pScene->setMaterialProperties(materialPath,
{ { "base_color", (baseColor) }, { "metalness", metalness },
{ "specular_color", (specularColor) }, { "specular_roughness", specularRoughness },
{ "specular_IOR", specularIOR }, { "transmission", transmission },
{ "transmission_color", (transmissionColor) }, { "opacity", (opacity) },
{ "base_color_image", baseColorImage },
{ "specular_roughness_image", specularRoughnessImage },
{ "opacity_image", opacityImage }, { "normal_image", normalImage } });
// clang-format off
Aurora::Properties properties =
{
{ "base_color", baseColor },
{ "metalness", metalness },
{ "specular_color", specularColor },
{ "specular_roughness", specularRoughness },
{ "specular_IOR", specularIOR },
{ "transmission", transmission },
{ "transmission_color", transmissionColor },
{ "emission", emission },
{ "emission_color", emissionColor },
{ "opacity", opacity },
{ "base_color_image", baseColorImage },
{ "specular_roughness_image", specularRoughnessImage },
{ "emission_color_image", emissionColorImage },
{ "opacity_image", opacityImage },
{ "normal_image", normalImage }
};
// clang-format on
Aurora::Path materialPath = filePath + ":OBJFileMaterial-" + to_string(mtlCount++);
pScene->setMaterialProperties(materialPath, properties);
lstMaterials.push_back(materialPath);
};

Expand All @@ -178,8 +203,10 @@ bool loadOBJFile(Aurora::IRenderer* /*pRenderer*/, Aurora::IScene* pScene, const
}
hasMesh = true;

Aurora::Path sceneInstancePath = filePath + ":OBJFileInstance-" + to_string(objectCount);
Aurora::Path geomPath = filePath + ":OBJFileGeom-" + to_string(objectCount);
Aurora::Path sceneInstancePath =
filePath + "-" + shape.name + ":OBJFileInstance-" + to_string(objectCount);
Aurora::Path geomPath =
filePath + "-" + shape.name + ":OBJFileGeom-" + to_string(objectCount);
objectCount++;

SceneGeometryData& geometryData = sceneContents.addGeometry(geomPath);
Expand Down Expand Up @@ -247,6 +274,32 @@ bool loadOBJFile(Aurora::IRenderer* /*pRenderer*/, Aurora::IScene* pScene, const
}
}

// Calculate the vertex count.
uint32_t vertexCount = static_cast<uint32_t>(positions.size()) / 3;

// Do we have tangents ? Default to false.
bool bHasTangents = false;

// Create normals if they are not available.
if (!bHasNormals)
{
normals.resize(positions.size());
Foundation::calculateNormals(
vertexCount, positions.data(), indexCount / 3, indices.data(), normals.data());
}

// Create tangents if texture coordinates are available.
#if PLASMA_HAS_TANGENTS
auto& tangents = geometryData.tangents;
if (bHasTexCoords)
{
tangents.resize(normals.size());
Foundation::calculateTangents(vertexCount, positions.data(), normals.data(),
tex_coords.data(), indexCount / 3, indices.data(), tangents.data());
bHasTangents = true;
}
#endif

Aurora::GeometryDescriptor& geomDesc = geometryData.descriptor;
geomDesc.type = Aurora::PrimitiveType::Triangles;
geomDesc.vertexDesc.attributes[Aurora::Names::VertexAttributes::kPosition] =
Expand All @@ -255,11 +308,15 @@ bool loadOBJFile(Aurora::IRenderer* /*pRenderer*/, Aurora::IScene* pScene, const
Aurora::AttributeFormat::Float3;
geomDesc.vertexDesc.attributes[Aurora::Names::VertexAttributes::kTexCoord0] =
Aurora::AttributeFormat::Float2;
geomDesc.vertexDesc.count = static_cast<uint32_t>(positions.size()) / 3;
if (bHasTangents)
geomDesc.vertexDesc.attributes[Aurora::Names::VertexAttributes::kTangent] =
Aurora::AttributeFormat::Float3;
geomDesc.vertexDesc.count = vertexCount;
geomDesc.indexCount = indexCount;
geomDesc.getAttributeData = [geomPath, &sceneContents](Aurora::AttributeDataMap& buffers,
size_t /* firstVertex*/, size_t /* vertexCount*/,
size_t /* firstIndex*/, size_t /* indexCount*/) {
geomDesc.getAttributeData = [geomPath, bHasTangents, &sceneContents](
Aurora::AttributeDataMap& buffers, size_t /* firstVertex*/,
size_t /* vertexCount*/, size_t /* firstIndex*/,
size_t /* indexCount*/) {
SceneGeometryData& geometryData = sceneContents.geometry[geomPath];

buffers[Aurora::Names::VertexAttributes::kPosition].address =
Expand All @@ -276,6 +333,17 @@ bool loadOBJFile(Aurora::IRenderer* /*pRenderer*/, Aurora::IScene* pScene, const
buffers[Aurora::Names::VertexAttributes::kTexCoord0].size =
geometryData.texCoords.size() * sizeof(float);
buffers[Aurora::Names::VertexAttributes::kTexCoord0].stride = sizeof(vec2);

// Fill in the tangent data, if we have them.
if (bHasTangents)
{
buffers[Aurora::Names::VertexAttributes::kTangent].address =
geometryData.tangents.data();
buffers[Aurora::Names::VertexAttributes::kTangent].size =
geometryData.tangents.size() * sizeof(float);
buffers[Aurora::Names::VertexAttributes::kTangent].stride = sizeof(vec3);
}

buffers[Aurora::Names::VertexAttributes::kIndices].address =
geometryData.indices.data();
buffers[Aurora::Names::VertexAttributes::kIndices].size =
Expand Down
2 changes: 1 addition & 1 deletion Applications/Plasma/PerformanceMonitor.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
14 changes: 10 additions & 4 deletions Applications/Plasma/Plasma.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -64,7 +64,7 @@ Plasma::Plasma(HINSTANCE hInstance, unsigned int width, unsigned int height)
::SetWindowTextW(_hwnd, Foundation::s2w(report.str()).c_str());
});
}
#else //! INTERACTIVE_PLASMA
#else //! INTERACTIVE_PLASMA
// Application constructor.
Plasma::Plasma(unsigned int width, unsigned int height)
{
Expand Down Expand Up @@ -554,6 +554,8 @@ bool Plasma::initialize()
_camera.fit(_sceneContents.bounds, kDefaultDirection);
}

_pDistantLight = _pScene->addLightPointer(Aurora::Names::LightTypes::kDistantLight);

// Get the environment map file path from the env argument.
if (arguments.count("env"))
{
Expand Down Expand Up @@ -753,7 +755,11 @@ void Plasma::updateLighting()
{ Aurora::Names::EnvironmentProperties::kBackgroundTransform, transform } });

// Update the directional light.
_pScene->setLight(lightIntensity, value_ptr(lightColor), value_ptr(_lightDirection));
_pDistantLight->values().setFloat(Aurora::Names::LightProperties::kIntensity, lightIntensity);
_pDistantLight->values().setFloat3(
Aurora::Names::LightProperties::kColor, value_ptr(lightColor));
_pDistantLight->values().setFloat3(
Aurora::Names::LightProperties::kDirection, value_ptr(_lightDirection));
}

void Plasma::updateGroundPlane()
Expand Down Expand Up @@ -1647,7 +1653,7 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE /*hPrevInstance

return result ? 0 : -1;
}
#else //! INTERACTIVE_PLASMA
#else //! INTERACTIVE_PLASMA
int main(int argc, char* argv[])
{
// Create an application object on the stack, and run it. The run() function returns when
Expand Down
3 changes: 2 additions & 1 deletion Applications/Plasma/Plasma.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -170,6 +170,7 @@ class Plasma
Aurora::IRenderer::Backend _rendererType = Aurora::IRenderer::Backend::Default;
Aurora::IRendererPtr _pRenderer;
Aurora::IGroundPlanePtr _pGroundPlane;
Aurora::ILightPtr _pDistantLight;
Aurora::IScenePtr _pScene;
Aurora::IWindowPtr _pWindow;
vector<string> _assetPaths;
Expand Down
2 changes: 1 addition & 1 deletion Applications/Plasma/SceneContents.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion Applications/Plasma/SceneContents.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@ struct SceneGeometryData
std::vector<float> positions;
std::vector<float> normals;
std::vector<float> texCoords;
std::vector<float> tangents;

std::vector<std::uint32_t> indices;
Aurora::GeometryDescriptor descriptor;
Expand Down
2 changes: 1 addition & 1 deletion Applications/Plasma/glTFLoader.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Applications/Plasma/pch.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Applications/Plasma/resource.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Autodesk, Inc.
// Copyright 2023 Autodesk, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
49 changes: 49 additions & 0 deletions AuroraVersion.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// AuroraVersion.h.in is processed by cmake configure_file to produce AuroraVersion.h
// *** Do not edit AuroraVersion.h this is an autogenerated file ***

#define AURORA_FILEVERSION_NUMBER @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,@PROJECT_VERSION_TWEAK@
#define AURORA_FILEVERSION_STRING "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.@PROJECT_VERSION_TWEAK@\0"
#define AURORA_COPYRIGHT_STRING "Copyright (C) @AURORA_BUILD_YEAR@ Autodesk, Inc.\0"
#define AURORA_PRODUCTVERSION_STRING "Autodesk Aurora @AURORA_BUILD_YEAR@\0"

#ifdef _DEBUG
#define FILEFLAGS_VALUE @DEBUG_FLAG_VALUE@
#define FILE_SUFFIX "@DEBUG_SUFFIX@"
#else
#define FILEFLAGS_VALUE 0x0L
#define FILE_SUFFIX ""
#endif

#define AURORA_VERSION_INFO_2(name, extension) \
VS_VERSION_INFO VERSIONINFO \
FILEVERSION AURORA_FILEVERSION_NUMBER \
PRODUCTVERSION 1,0,0,1 \
FILEFLAGSMASK 0x3fL \
FILEFLAGS FILEFLAGS_VALUE \
FILEOS VOS_NT_WINDOWS32 \
FILETYPE 0x2L \
FILESUBTYPE 0x0L \
BEGIN \
BLOCK "StringFileInfo" \
BEGIN \
BLOCK "040904b0" \
BEGIN \
VALUE "Comments", "\0" \
VALUE "CompanyName", "Autodesk, Inc.\0" \
VALUE "FileDescription", #name \
VALUE "FileVersion", AURORA_FILEVERSION_STRING \
VALUE "InternalName", #name \
VALUE "LegalCopyright", AURORA_COPYRIGHT_STRING \
VALUE "LegalTrademarks", "\0" \
VALUE "OriginalFilename", #name FILE_SUFFIX extension "\0" \
VALUE "ProductName", "Autodesk, Inc. " #name \
VALUE "ProductVersion", AURORA_PRODUCTVERSION_STRING \
VALUE "SpecialBuild", "\0" \
END \
END \
BLOCK "VarFileInfo" \
BEGIN \
VALUE "Translation", 0x409, 1200 \
END \
END
#define AURORA_VERSION_INFO(name) AURORA_VERSION_INFO_2(name, ".dll")
Loading

0 comments on commit dbb7199

Please sign in to comment.