Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Specular Glossiness to Metallic Roughness conversion step to workflows. #36

Merged
merged 11 commits into from Aug 3, 2018

Conversation

najadojo
Copy link
Contributor

@najadojo najadojo commented Jul 7, 2018

Add a Specular Glossiness to Metallic Roughness conversion step to workflows.
Refactored texture loading and packing utils into generic textures utils.
Resolved packing, resizing and compressing texture issues with sRGB and alpha channels.
Update draco build to allow for ARM.

Also includes #34 and #35.

Jamie Marconi added 6 commits June 25, 2018 13:48
Update driectxtex to 2018.6.1.2
Add abilibty to apply Draco mesh compression.
Modify SerializeBinary to allow for BufferView's that we don't understand natively.
…rkflows.

Refactored texture loading and packing utils into generic textures utils.
Resolved packing, resizing and compressing texture issues with sRGB and alpha channels.
Update draco build to allow for ARM.

// 2. Texture Compression
convertedDoc = GLTFTextureCompressionUtils::CompressAllTexturesForWindowsMR(streamReader, document, tempDirectoryA, maxTextureSize, false /* retainOriginalImages */);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! This is a big bug.

@@ -68,5 +71,14 @@
<ClCompile Include="src\GLBtoGLTF.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="GLTFMeshCompressionUtils.cpp">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the src folder

resultDocument = ConvertMaterial(streamReader, resultDocument, material, outputDirectory);
}

resultDocument.extensionsUsed.erase(KHR::Materials::PBRSPECULARGLOSSINESS_NAME);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this fail if the extension is not there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idempotent in that case.

@@ -261,7 +260,6 @@ void GLTFTextureCompressionUtils::CompressImage(DirectX::ScratchImage& image, Te
break;
case TextureCompression::BC7_SRGB:
compressionFormat = DXGI_FORMAT_BC7_UNORM_SRGB;
compressionFlags |= DirectX::TEX_COMPRESS_SRGB_IN;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I changed to handle the SRGB conversion during load. Math needs to be done on linear values so I just made it the default.

Copy link
Contributor

@robertos robertos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is awesome. This needs to be tested against a variety of files, but if it looks good I'd say go for it. Please let me know if you need help

@najadojo
Copy link
Contributor Author

najadojo commented Jul 7, 2018

Did you have a collection of test assets that are typically used?

@robertos
Copy link
Contributor

robertos commented Jul 7, 2018 via email

This was referenced Jul 9, 2018
Switch draco compression to an option; it makes loading slower.
@robertos
Copy link
Contributor

@najadojo Let me know if I can help you to complete this PR - lots of goodness here :)

@najadojo
Copy link
Contributor Author

I haven't completed testing these changes yet and I've been moved on to other work... I'll try and finish that up in my free time.

@najadojo
Copy link
Contributor Author

@Dharnidharka this last commit will fix #39, using mesh compressed assets as input. You can grab a release binary on the artifacts page.

@najadojo
Copy link
Contributor Author

@robertos this PR is ready for merging.

@Dharnidharka
Copy link

@najadojo Thank you for the fix :)

@robertos robertos merged commit 37a5498 into microsoft:master Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants