GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
texture_utils.h
Go to the documentation of this file.
1// Copyright 2019 The Draco Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15#ifndef DRACO_TEXTURE_TEXTURE_UTILS_H_
16#define DRACO_TEXTURE_TEXTURE_UTILS_H_
17
19
20#ifdef DRACO_TRANSCODER_SUPPORTED
21#include "draco/core/status.h"
23#include "draco/io/file_utils.h"
24#include "draco/material/material_library.h"
27
28namespace draco {
29
30// Helper class implementing various utilities operating on draco::Texture.
31class TextureUtils {
32 public:
33 // Returns |texture| image stem (file basename without extension) based on the
34 // source image filename or an empty string when source image is not set.
35 static std::string GetTargetStem(const Texture &texture);
36
37 // Returns |texture| image stem (file basename without extension) based on the
38 // source image filename or a name generated from |index| and |suffix| like
39 // "Texture5_BaseColor" when source image is not set.
40 static std::string GetOrGenerateTargetStem(const Texture &texture, int index,
41 const std::string &suffix);
42
43 // Returns |texture| format based on compression settings, the source image
44 // mime type or the source image filename.
45 static ImageFormat GetTargetFormat(const Texture &texture);
46
47 // Returns |texture| image file extension based on compression settings, the
48 // source image mime type or the source image filename.
49 static std::string GetTargetExtension(const Texture &texture);
50
51 // Returns |texture| format based on source image mime type or the source
52 // image filename.
53 static ImageFormat GetSourceFormat(const Texture &texture);
54
55 // Returns image format corresponding to a given image file |extension|. NONE
56 // is returned when |extension| is empty or unknown.
57 static ImageFormat GetFormat(const std::string &extension);
58
59 // Returns image file extension corresponding to a given image |format|. Empty
60 // extension is returned when the |format| is NONE.
61 static std::string GetExtension(ImageFormat format);
62
63 // Returns the number of channels required for encoding a |texture| from a
64 // given |material_library|, taking into account texture opacity and assuming
65 // that occlusion and metallic-roughness texture maps may share a texture.
66 // TODO(vytyaz): Move this and FindTextures() to MaterialLibrary class.
67 static int ComputeRequiredNumChannels(
68 const Texture &texture, const MaterialLibrary &material_library);
69
70 static std::vector<const Texture *> FindTextures(
71 const TextureMap::Type texture_type,
72 const MaterialLibrary *material_library);
73};
74
75} // namespace draco
76
77#endif // DRACO_TRANSCODER_SUPPORTED
78#endif // DRACO_TEXTURE_TEXTURE_UTILS_H_
texture_type
Definition GameApi.cc:40967
instead of< li > Displaying models works via URL t expect full length movie as the output of this process< li > Different animation models are very limited basically just translate rotate</ul >< h2 > What to do if your hosting location has no php</h2 >< ul >< li > comment out or remove display php lines at the beginning< li > you will lose threads too< li > every zip file distributed by meshpage org has one of those display php files with this issue</ul >< h2 > What should I do to serve the files via http</h2 > I get some random triangles that do not belong to the model</h2 > The engine works correctly The obj file supports quads and polygons But some external tools that create obj files insert random polygons to the file to discourage rendering of polygons We consider polygon rendering is important and our engine should support it by default If you have we have disable_polygons() feature in the engine to get rid of the trash. But real solution is to change the tool you use to create the .obj file/check the .obj file that it doesn 't contain random(invisible) polygons that do not render in competing 3d engines. Our engine does not have the performance problems normally associated with polygons given that triangle quad polygon type change does not cause additional draw commands to the opengl rendering< p > GLTF standard organisation made significant mistake when specifying GLTF file format
Definition meshpage.php:1092
Definition attribute_octahedron_transform.cc:21