Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:42

0001 // Author: Kirill Gavrilov
0002 // Copyright (c) 2015-2019 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _RWGltf_MaterialMetallicRoughness_HeaderFile
0016 #define _RWGltf_MaterialMetallicRoughness_HeaderFile
0017 
0018 #include <Graphic3d_Vec.hxx>
0019 #include <Quantity_ColorRGBA.hxx>
0020 #include <RWGltf_GltfAlphaMode.hxx>
0021 #include <Standard_Transient.hxx>
0022 #include <TCollection_AsciiString.hxx>
0023 
0024 class Image_Texture;
0025 
0026 //! glTF 2.0 format PBR material definition.
0027 class RWGltf_MaterialMetallicRoughness : public Standard_Transient
0028 {
0029 public:
0030 
0031   Handle(Image_Texture)   BaseColorTexture;         //!< RGB texture for the base color
0032   Handle(Image_Texture)   MetallicRoughnessTexture; //!< RG texture packing the metallic and roughness properties together
0033   Handle(Image_Texture)   EmissiveTexture;          //!< RGB emissive map controls the color and intensity of the light being emitted by the material
0034   Handle(Image_Texture)   OcclusionTexture;         //!< R occlusion map indicating areas of indirect lighting
0035   Handle(Image_Texture)   NormalTexture;            //!< normal map
0036   TCollection_AsciiString Id;                       //!< material identifier
0037   TCollection_AsciiString Name;                     //!< material name
0038   Quantity_ColorRGBA      BaseColor;                //!< base color (or scale factor to the texture); [1.0, 1.0, 1.0, 1.0] by default
0039   Graphic3d_Vec3          EmissiveFactor;           //!< emissive color; [0.0, 0.0, 0.0] by default
0040   Standard_ShortReal      Metallic;                 //!< metalness  (or scale factor to the texture) within range [0.0, 1.0]; 1.0 by default
0041   Standard_ShortReal      Roughness;                //!< roughness  (or scale factor to the texture) within range [0.0, 1.0]; 1.0 by default
0042   Standard_ShortReal      AlphaCutOff;              //!< alpha cutoff value; 0.5 by default
0043   RWGltf_GltfAlphaMode    AlphaMode;                //!< alpha mode; RWGltf_GltfAlphaMode_Opaque by default
0044   Standard_Boolean        IsDoubleSided;            //!< specifies whether the material is double sided; FALSE by default
0045 
0046   RWGltf_MaterialMetallicRoughness()
0047   : BaseColor (1.0f, 1.0f, 1.0f, 1.0f),
0048     EmissiveFactor (0.0f, 0.0f, 0.0f),
0049     Metallic  (1.0f),
0050     Roughness (1.0f),
0051     AlphaCutOff (0.5f),
0052     AlphaMode (RWGltf_GltfAlphaMode_Opaque),
0053     IsDoubleSided (Standard_False) {}
0054 
0055 };
0056 
0057 #endif // _RWGltf_MaterialMetallicRoughness_HeaderFile