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

Texture Formats #887

Merged
merged 9 commits into from
Nov 18, 2020
Merged

Texture Formats #887

merged 9 commits into from
Nov 18, 2020

Conversation

pandaGaume
Copy link
Contributor

fix #844 Optimize format for ORM. fix size difference between GLTF and GLB. Replace raw format on GLB with corresponding Encoded format such jpg or png

fix test for re-use of Max Attribute. Fix null check for texture optimization.
Choice of extension for ORM, set right image format to glb buffer
make code path to glb and gltf texture write similar
Copy link
Contributor

@Drigax Drigax left a comment

Choose a reason for hiding this comment

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

These changes look pretty good, I just want to make sure we're properly documenting the behavior of the given texture export policies to minimize confusion.

@@ -3,6 +3,11 @@

namespace BabylonExport.Entities
{
public enum TextureFormatExportPolicy
{
QUALITY, CONSERVATIV, SIZE
Copy link
Contributor

Choose a reason for hiding this comment

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

*CONSERVATIVE

Can we document what the intent of the export policies are? I assume Quality -> maximize image quality, CONSERVATIVE -> change as little as possible?, SIZE -> minimize image size

@@ -498,8 +499,16 @@ private GLTFBufferView WriteImageToGltfBuffer(GLTF gltf, GLTFImage gltfImage, st
byte[] imageBytes = null;
if (imageBitmap != null)
{
ImageConverter converter = new ImageConverter();
imageBytes = (byte[])converter.ConvertTo(imageBitmap, typeof(byte[]));
//ImageConverter converter = new ImageConverter();
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove commented code

//imageBytes = (byte[])converter.ConvertTo(imageBitmap, typeof(byte[]));
using(MemoryStream m = new MemoryStream())
{
// try our best to get extension - default will be png which is the looseless format.
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove commented code

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.

3ds Max 2021: GLB export merges O/R/M jpg files into a ORM png file
2 participants