Skip to content

Commit

Permalink
format for release
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonbrownlee committed Oct 26, 2023
1 parent 253b800 commit cba8618
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 177 deletions.
122 changes: 61 additions & 61 deletions .github/workflows/release.yml
Expand Up @@ -29,18 +29,18 @@ jobs:
# scripts/release_ci/linux.sh
# ls build_release

# release-linux-houdini:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
# with:
# force-delete: true # guarantees .gitattributes are respected in working dir
# image: hdospray/ubuntu:20.04-cb-hdospray23.02
# artifact-out: release-linux-houdini
# artifact-path: build_release/*.gz
# cmd: |
# scripts/release_ci/linux_houdini.sh
# cmake --build build_release -j 32 --target package
# ls build_release
release-linux-houdini:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
force-delete: true # guarantees .gitattributes are respected in working dir
image: hdospray/ubuntu:20.04-cb-hdospray23.02
artifact-out: release-linux-houdini
artifact-path: build_release/*.gz
cmd: |
scripts/release_ci/linux_houdini.sh
cmake --build build_release -j 32 --target package
ls build_release
# release-windows:
# secrets: inherit
Expand All @@ -54,17 +54,17 @@ jobs:
# artifact-out: release-windows
# artifact-path: "build_release/hdospray*.zip build_release/hdospray*.msi"

# release-windows-houdini:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
# with:
# runs-on: '[ "Windows", "build", "NAS" ]'
# cmd: |
# scripts/release_ci/win_houdini.ps1
# & $env:SIGN_FILE_WINDOWS hdospray*.zip
# & ls
# artifact-out: release-windows-houdini
# artifact-path: "build_release/hdospray*.zip"
release-windows-houdini:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
runs-on: '[ "Windows", "build", "NAS" ]'
cmd: |
scripts/release_ci/win_houdini.ps1
& $env:SIGN_FILE_WINDOWS hdospray*.zip
& ls
artifact-out: release-windows-houdini
artifact-path: "build_release/hdospray*.zip"

# release-osx-clang:
# secrets: inherit
Expand Down Expand Up @@ -98,44 +98,44 @@ jobs:

### SCAN JOBS ###

# static-analysis:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/static_analysis.yml@main
# with:
# image: hdospray/ubuntu:20.04-cb-hdospray23.02
# project: HDOSPRay
# prebuild: |
# scripts/release_ci/linux_houdini.sh
# ls build_release
# build: cmake --build build_release -j 32

# binary-analysis:
# needs:
# - release-linux-houdini
# - release-osx-clang-houdini
# - release-windows-houdini
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/binary_analysis.yml@main
# with:
# project: hdospray
# artifact-in-linux: release-linux-houdini
# artifact-in-macos: release-osx-clang-houdini
# artifact-in-windows: release-windows-houdini
# path: build_release/hdospray*

# antivirus-scan:
# needs:
# - release-linux-houdini
# - release-osx-clang-houdini
# - release-windows-houdini
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/antivirus_scan.yml@main
# with:
# project: hdospray
# artifact-in-linux: release-linux-houdini
# artifact-in-macos: release-osx-clang-houdini
# artifact-in-windows: release-windows-houdini
# path: build_release/hdospray*
static-analysis:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/static_analysis.yml@main
with:
image: hdospray/ubuntu:20.04-cb-hdospray23.02
project: HDOSPRay
prebuild: |
scripts/release_ci/linux_houdini.sh
ls build_release
build: cmake --build build_release -j 32

binary-analysis:
needs:
- release-linux-houdini
- release-osx-clang-houdini
- release-windows-houdini
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/binary_analysis.yml@main
with:
project: hdospray
artifact-in-linux: release-linux-houdini
artifact-in-macos: release-osx-clang-houdini
artifact-in-windows: release-windows-houdini
path: build_release/hdospray*

antivirus-scan:
needs:
- release-linux-houdini
- release-osx-clang-houdini
- release-windows-houdini
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/antivirus_scan.yml@main
with:
project: hdospray
artifact-in-linux: release-linux-houdini
artifact-in-macos: release-osx-clang-houdini
artifact-in-windows: release-windows-houdini
path: build_release/hdospray*

# snyk-scan:
# secrets: inherit
Expand Down
14 changes: 12 additions & 2 deletions README.md
Expand Up @@ -186,10 +186,20 @@ Compliation on windows is similar to Linux/Mac.

## Running

Once built, the plugin code should be located in your `usd` install
directory under `plugin/usd/HdOSPRay`. Run `usdview <scenefile>` and
Once built, the plugin should be located in your install directory under
`plugin/usd/HdOSPRay`. A setup script is provided for setting env vars.
If you built usd with usdimaging, you can run `usdview <scenefile>` and
select `view->Hydra` and then `Renderer->OSPRay`.

Houdini setup is specific to each platform, but has been tested with
Houdini 19.5.640. For Mac/Linux, there is a houdini\_setup script in
your Houdini installation directory. This should be sourced, and then
source the hdospray\_setup.sh script and you should be able to select
OSPRay as a hydra delegate in the drop down menu in stage view. For
windows, it is recommended to copy the bin and plugin directories from
your hdOSPRay build to the respective directories in the Houdini
install.

OSPRay can be set to the default renderer by either

- Setting the `HD_DEFAULT_RENDERER` environment variable
Expand Down
5 changes: 3 additions & 2 deletions doc/documentation.md
Expand Up @@ -2,8 +2,9 @@

## Running

Once built, the plugin code should be located in your `usd` install directory under `plugin/usd/HdOSPRay`.
Run `usdview <scenefile>` and select `view->Hydra` and then `Renderer->OSPRay`.
Once built, the plugin should be located in your install directory under `plugin/usd/HdOSPRay`. A setup script is provided for setting env vars. If you built usd with usdimaging, you can run `usdview <scenefile>` and select `view->Hydra` and then `Renderer->OSPRay`.

Houdini setup is specific to each platform, but has been tested with Houdini 19.5.640. For Mac/Linux, there is a houdini_setup script in your Houdini installation directory. This should be sourced, and then source the hdospray_setup.sh script and you should be able to select OSPRay as a hydra delegate in the drop down menu in stage view. For windows, it is recommended to copy the bin and plugin directories from your hdOSPRay build to the respective directories in the Houdini install.

OSPRay can be set to the default renderer by either

Expand Down
2 changes: 1 addition & 1 deletion hdOSPRay/basisCurves.h
Expand Up @@ -68,7 +68,7 @@ class HdOSPRayBasisCurves : public HdBasisCurves {
VtFloatArray _widths;
VtVec3fArray _points;
VtVec3fArray _normals;
GfMatrix4f _xfm{1};
GfMatrix4f _xfm { 1 };
VtVec2fArray _texcoords;
VtVec4fArray _colors;
GfVec4f _singleColor { .5f, .5f, .5f, 1.f };
Expand Down
3 changes: 2 additions & 1 deletion hdOSPRay/instancer.cpp
Expand Up @@ -83,7 +83,8 @@ HdOSPRayInstancer::_SyncPrimvars()
if (HdChangeTracker::IsPrimvarDirty(dirtyBits, id, pv.name)) {
VtValue value = GetDelegate()->Get(id, pv.name);
if (!value.IsEmpty()) {
_primvarMap[pv.name] = std::make_unique<HdVtBufferSource>(new HdVtBufferSource(pv.name, value));
_primvarMap[pv.name] = std::make_unique<HdVtBufferSource>(
new HdVtBufferSource(pv.name, value));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion hdOSPRay/lights/light.h
Expand Up @@ -103,7 +103,7 @@ class HdOSPRayLight : public HdLight {
// USDLuxLight parameters to set up the emission of the light source
EmissionParameter _emissionParam;
// The transformation of the light source in the scene.
GfMatrix4d _transform{1};
GfMatrix4d _transform { 1 };

// if light source is on (not to be confused with camera visible)
bool _visibility { true };
Expand Down
12 changes: 5 additions & 7 deletions hdOSPRay/material.cpp
Expand Up @@ -228,18 +228,15 @@ HdOSPRayMaterial::_UpdateOSPRayMaterial()
if (!HdOSPRayConfig::GetInstance().useSimpleMaterial) {
if (_type == MaterialTypes::carPaint) {
if (_typeDirty)
_ospMaterial
= opp::Material("carPaint");
_ospMaterial = opp::Material("carPaint");
UpdateCarPaintMaterial();
} else if (_type == MaterialTypes::luminous) {
if (_typeDirty)
_ospMaterial
= opp::Material("luminous");
_ospMaterial = opp::Material("luminous");
UpdateLuminousMaterial();
} else { // preview, principled, other
if (_typeDirty)
_ospMaterial
= opp::Material("principled");
_ospMaterial = opp::Material("principled");
UpdatePrincipledMaterial(rendererType);
}
} else {
Expand Down Expand Up @@ -415,7 +412,8 @@ HdOSPRayMaterial::_ProcessOspLuminousNode(HdMaterialNode node)
}

void
HdOSPRayMaterial::_ProcessTextureNode(HdMaterialNode node, const TfToken& inputName,
HdOSPRayMaterial::_ProcessTextureNode(HdMaterialNode node,
const TfToken& inputName,
const TfToken& outputName)
{
bool isPtex = node.identifier == HdOSPRayMaterialTokens->HwPtexTexture_1;
Expand Down
3 changes: 2 additions & 1 deletion hdOSPRay/mesh.cpp
Expand Up @@ -129,7 +129,8 @@ HdOSPRayMesh::Sync(HdSceneDelegate* sceneDelegate, HdRenderParam* renderParam,
}

// Create ospray mesh
_PopulateOSPMesh(sceneDelegate, std::move(renderer), dirtyBits, desc, ospRenderParam);
_PopulateOSPMesh(sceneDelegate, std::move(renderer), dirtyBits, desc,
ospRenderParam);

if (*dirtyBits & HdChangeTracker::DirtyTopology) {
// TODO: need to update material when topology has changed?
Expand Down
2 changes: 1 addition & 1 deletion hdOSPRay/mesh.h
Expand Up @@ -182,7 +182,7 @@ class HdOSPRayMesh final : public HdMesh {

HdMeshUtil* _meshUtil { nullptr };
HdMeshTopology _topology;
GfMatrix4f _transform {1};
GfMatrix4f _transform { 1 };
VtVec3fArray _points;
VtVec2fArray _texcoords;
VtVec2fArray _computedTexcoords; // triangulated
Expand Down
7 changes: 4 additions & 3 deletions hdOSPRay/renderPass.cpp
Expand Up @@ -812,12 +812,13 @@ HdOSPRayRenderPass::_CopyFrameBuffer(
tbb::parallel_for(0, (int)w, [&](int ix) {
const float x = ix;
const float y = iy;
const GfVec3f pos( 2.f * (x / w) - 1.f,
2.f * (y / h) - 1.f, -1.f);
const GfVec3f pos(2.f * (x / w) - 1.f,
2.f * (y / h) - 1.f, -1.f);
GfVec3f dir = _inverseProjMatrix.Transform(pos);
GfVec3f origin = GfVec3f(0, 0, 0);
origin = _inverseViewMatrix.Transform(origin);
dir = -_inverseViewMatrix.Transform(dir).GetNormalized();
dir = -_inverseViewMatrix.Transform(dir)
.GetNormalized();
float& d = depth[static_cast<int>(y * w + x)];
GfVec3f hit = origin + dir * d;
hit = viewMatrix.Transform(hit);
Expand Down
3 changes: 2 additions & 1 deletion hdOSPRay/rendererPlugin.cpp
Expand Up @@ -45,7 +45,8 @@ HdOSPRayRendererPlugin::CreateRenderDelegate()
v0 .20.x to v0 .23.x
#endif

int ac = 1;
int ac
= 1;
std::string initArgs = HdOSPRayConfig::GetInstance().initArgs;
std::stringstream ss(initArgs);
std::string arg;
Expand Down
3 changes: 2 additions & 1 deletion hdOSPRay/texture.cpp
Expand Up @@ -189,7 +189,8 @@ LoadHioTexture2D(const std::string file, const std::string channelsStr,
= std::shared_ptr<uint8_t>(data, std::default_delete<uint8_t[]>());
auto outDataPtr = std::shared_ptr<uint8_t>(
outData, std::default_delete<uint8_t[]>());
return HdOSPRayTexture(std::move(ospTexture), outData ? outDataPtr : dataPtr);
return HdOSPRayTexture(std::move(ospTexture),
outData ? outDataPtr : dataPtr);
}

struct UDIMTileDesc {
Expand Down
6 changes: 3 additions & 3 deletions hdOSPRay/texture.h
Expand Up @@ -29,15 +29,15 @@ struct HdOSPRayTexture {
~HdOSPRayTexture() = default;
std::string file;
enum class WrapType { NONE, BLACK, CLAMP, REPEAT, MIRROR };
WrapType wrapS {WrapType::CLAMP};
WrapType wrapT {WrapType::CLAMP};
WrapType wrapS { WrapType::CLAMP };
WrapType wrapT { WrapType::CLAMP };
GfVec4f scale { 1.0f };
GfVec2f xfm_translation { 0.f, 0.f };
GfVec2f xfm_scale { 1.f, 1.f };
float xfm_rotation { 0.f };
bool hasXfm { false };
enum class ColorType { NONE, RGBA, RGB, R, G, B, A };
ColorType type {ColorType::NONE};
ColorType type { ColorType::NONE };
opp::Texture ospTexture { nullptr };
bool isPtex { false };
std::shared_ptr<uint8_t> data; // should be uint8_t[], but to support older
Expand Down
20 changes: 1 addition & 19 deletions scripts/release_ci/macosx.sh
Expand Up @@ -5,16 +5,6 @@
set -x
cmake --version

echo "deps: "
ls /Users/github-runner/actions-runner/intel/001/_work/libraries.graphics.renderkit.ospray-hydra/hdospray_deps
echo "deps/usd-23.02/install: "
ls /Users/github-runner/actions-runner/intel/001/_work/libraries.graphics.renderkit.ospray-hydra/hdospray_deps/usd-23.02/install
echo "deps/usd-23.02/install/ospray: "
ls /Users/github-runner/actions-runner/intel/001/_work/libraries.graphics.renderkit.ospray-hydra/hdospray_deps/usd-23.02/install/ospray
echo "deps/usd-23.02/install/ospray/bin: "
ls /Users/github-runner/actions-runner/intel/001/_work/libraries.graphics.renderkit.ospray-hydra/hdospray_deps/usd-23.02/install/ospray/bin
echo "done"

#### Set variables for script ####

ROOT_DIR=$PWD
Expand Down Expand Up @@ -45,14 +35,6 @@ echo "which pyside6-uic:"
which pyside6-uic
which uic
pip3.9 show PySide6
echo "site-packages:"
ls /usr/local/lib/python3.9/site-packages
echo "site-packages2:"
ls /Users/github-runner/Library/Python/3.9/lib/python/site-packages
echo "libexec: "
ls /Users/github-runner/Library/Python/3.9/lib/python/site-packages/PySide6/Qt/libexec
ls /Users/github-runner/Library/Python/3.9/lib/python/site-packages/PySide6/Qt
ls /Users/github-runner/Library/Python/3.9/lib/python/site-packages/PySide6

# rebuild dependencies - clear install dir
# rm -r $DEP_DIR/install
Expand Down Expand Up @@ -95,7 +77,7 @@ cmake .. -Dpxr_DIR=$USD_ROOT -Dospray_DIR=$USD_ROOT/ospray/lib/cmake/ospray-2.12
-DTBB_DIR=$USD_ROOT/tbb/lib/cmake/tbb -DCMAKE_BUILD_TYPE=Release \
-D HDOSPRAY_INSTALL_OSPRAY_DEPENDENCIES=ON \
-D HDOSPRAY_GENERATE_SETUP=ON \
-D HDOSPRAY_PYTHON_INSTALL_DIR=/Users/github-runner/Library/Python/3.9 \
-D HDOSPRAY_PYTHON_INSTALL_DIR=~/Library/Python/3.9 \
-DHDOSPRAY_SIGN_FILE=$SIGN_FILE_MAC || exit 2
cmake --build . -j ${THREADS} || exit 2

Expand Down

0 comments on commit cba8618

Please sign in to comment.