-
Notifications
You must be signed in to change notification settings - Fork 319
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
Texture Formats #887
Conversation
rebase from upstream
Choice of extension for ORM, set right image format to glb buffer
make code path to glb and gltf texture write similar
There was a problem hiding this 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 |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove commented code
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