Skip to content

Commit

Permalink
[Olympus] Miscellaneous changes
Browse files Browse the repository at this point in the history
- Add release guide for olympus
- Allow skipping of mipmap generation (cpp-pm#5)
- Enable transparent shadows for gltf (google#9)
- Fix morph target loading with sparse accessor
  • Loading branch information
zbai-sc authored and rahulshethsc committed Jun 29, 2022
1 parent 46064cf commit 74bae3a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
30 changes: 30 additions & 0 deletions RELEASE_GUIDE_OLYMPUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Filament Release Guide

- $VERSION = the current version that has been released (e.g. 1.10.7)
- $NEXT_VERSION = the next version we plan to release (e.g. 1.10.8)
- $PATCH_VERSION = the minor version on top of filament version (e.g. 1.10.7-__p0__)

## Release a new filament version for olympus

### 1. keep track of our changes in the current release

- compare the current olympus release branch `elisemorysc/filament:olympus-$VERSION` with the upstream filament release `google/filament:v$VERSION` (e.g. https://github.com/google/filament/compare/v1.10.7...elisemorysc:olympus-1.10.7)
- we should see the hunterization commit marked `[Hunter]`
- we should see the olympus changes marked `[Olympus]`

### 2. create new release branch

- create a new branch `elisemorysc/filament:olympus-$NEXT_VERSION` from the upstream filament version (e.g. `google/filament:v1.10.8` -> `elisemorysc/filament:olympus-1.10.8`)
- cherry pick in our changes from the last step
- solve any conflicts

### 3. cut new release

- cut a new release `olympus-$NEXT_VERSION-$PATH_VERSION` (e.g. `olympus-1.10.8-p0`) from the new branch

## Release a new filament version for hunter

- create a new branch `elisemorysc/filament:hunter-$NEXT_VERSION` from the upstream filament version (e.g. `google/filament:v1.10.8` -> `elisemorysc/filament:hunter-1.10.8`)
- cherry pick in the hunterization commit marked `[Hunter]` from the current olympus release `elisemorysc/filament:olympus-$VERSION`
- solve any conflicts
- put up a PR against the hunter repo for filament `cpp-pm/filament:hunter-$NEXT_VERSION`
3 changes: 3 additions & 0 deletions libs/gltfio/include/gltfio/ResourceLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ struct ResourceConfiguration {
//! If true, ignores skinning when computing bounding boxes. Implicitly true for instanced
//! assets. Only applicable when recomputeBoundingBoxes is set to true.
bool ignoreBindTransform;

//! If true, skip mip map generation on loading textures.
bool skipMipMapGeneration;
};

/**
Expand Down
1 change: 1 addition & 0 deletions libs/gltfio/src/MaterialGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ static Material* createMaterial(Engine* engine, const MaterialKey& config, const
break;
case AlphaMode::BLEND:
builder.blending(MaterialBuilder::BlendingMode::FADE);
builder.transparentShadow(true);
break;
default:
// Ignore
Expand Down
9 changes: 9 additions & 0 deletions libs/gltfio/src/ResourceLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ struct ResourceLoader::Impl {
mNormalizeSkinningWeights = config.normalizeSkinningWeights;
mRecomputeBoundingBoxes = config.recomputeBoundingBoxes;
mIgnoreBindTransform = config.ignoreBindTransform;
mSkipMipMapGeneration = config.skipMipMapGeneration;
}

Engine* mEngine;
bool mNormalizeSkinningWeights;
bool mRecomputeBoundingBoxes;
bool mIgnoreBindTransform;
bool mSkipMipMapGeneration;
std::string mGltfPath;

// User-provided resource data with URI string keys, populated with addResourceData().
Expand Down Expand Up @@ -815,10 +817,17 @@ void ResourceLoader::applySparseData(FFilamentAsset* asset) const {
cgltf_size numBytes = sizeof(float) * numFloats;
float* generated = (float*) malloc(numBytes);
cgltf_accessor_unpack_floats(accessor, generated, numFloats);
if (slot.morphTargetBuffer) {
slot.morphTargetBuffer->setPositionsAt(*pImpl->mEngine, slot.bufferIndex,
(const float3*) generated, slot.morphTargetBuffer->getVertexCount());
free(generated);
}
else if (slot.vertexBuffer) {
BufferObject* bo = BufferObject::Builder().size(numBytes).build(*asset->mEngine);
asset->mBufferObjects.push_back(bo);
bo->setBuffer(*pImpl->mEngine, BufferDescriptor(generated, numBytes, FREE_CALLBACK));
slot.vertexBuffer->setBufferObjectAt(*pImpl->mEngine, slot.bufferIndex, bo);
}
}
}

Expand Down

0 comments on commit 74bae3a

Please sign in to comment.