Click or drag to resize
Ab4d.SharpEngine logo

PhysicallyBasedMaterial Class

PhysicallyBasedMaterial class defines a material for Physically based rendering (PBR material).
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.CoreComponentBase
    Ab4d.SharpEngine.CoreInitializedSceneComponent
      Ab4d.SharpEngine.MaterialsMaterial
        Ab4d.SharpEngine.MaterialsPhysicallyBasedMaterial

Namespace: Ab4d.SharpEngine.Materials
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.0.9584+ba1aaa26d4181dd3fa8ed7b6398391d1affa36c8
Syntax
C#
public class PhysicallyBasedMaterial : Material, 
	IPhysicallyBasedMaterial, IMultiMapMaterial, ITransparentMaterial, IEmissiveMaterial, ITwoSidedMaterial

The PhysicallyBasedMaterial type exposes the following members.

Constructors
Properties
 NameDescription
Public propertyAlphaClipThreshold Pixels with alpha color values below this value will be clipped (not rendered and their depth will not be written to depth buffer). Expected values are between 0 and 1. When 0 (by default) then alpha clipping is disabled - this means that also pixels with alpha value 0 are fully processed (they are not visible but its depth value is still written so objects that are rendered afterwards and are behind the pixel will not be visible).
Public propertyAmbientOcclusionFactor Float value that defines a factor that is multiplied with the ambient occlusion texture (when specified). Default value is 1 which does not change the values in the texture. Default value is 1.
Public propertyBaseColor Color4 used for diffuse colors in non-metals ("dielectrics") or specular color in metals. When used with BaseColor texture, this color defines a color mask that is multiplied with each texture value. When alpha component is less than 1, then other color components need to be pre-multiplied by the alpha value. Default value is White.
Public propertyDiffuseFactor Diffuse factor - applicable only to specular/glossiness workflow (KHR_materials_pbrSpecularGlossiness extension).
Public propertyEmissiveColor Gets or sets a Color3 that that represents the emissive color - the color of the object regardless of the lights.
Public propertyEmissiveStrength Emissive strength (KHR_materials_emissive_strength).
Public propertyHasOnlyEmissiveColor Gets a Boolean that specifies if this material has only emissive color. This property is not used in PhysicallyBasedMaterial and always returns false.
Public propertyHasTransparency Gets a boolean that specifies if this material is semi-transparent and needs to be alpha blended with the scene.
Public propertyIsTwoSided 
Public propertyMetalness Float value that specifies the amount of metalness - 0 for non-metal; 1 for raw metal. When used with Metalness texture, this value defines a mask that is multiplied with each texture value. Default value is 1.
Public propertyPbrWorkflow PBR workflow to use: metallic/roughness (the default) or specular/glossiness.
Public propertyRoughness Float value that defines surface irregularities - 0 for totally flat surface; 1 for rough surface without any reflection. When used with Roughness texture, this value defines a mask that is multiplied with each texture value. Default value is 1.
Public propertySpecularFactor Specular factor - applicable only to specular/glossiness workflow (KHR_materials_pbrSpecularGlossiness extension).
Public propertyTextureMaps Gets a list of TextureMapInfo object that defines texture maps that should be rendered with this material.
Top
Methods
 NameDescription
Public methodStatic memberCreateMetalnessRoughnessImage CreateMetalnessRoughnessImage creates a new RawImageData with both metalness and roughness data stored in the same image (metalness values are stored in the blue channel and roughness values are stored in the green channel). This is needed for PhysicallyBasedMaterial to work correctly.
Protected methodDispose Dispose
(Overrides MaterialDispose(Boolean))
Public methodDisposeWithTextures DisposeWithTextures disposes this Material and also disposes all the TextureMaps even if the GpuImages of the textures were created by the user (in this case the standard Dispose method does not dispose the GpuImages).
Public methodGetDetailsText GetDetailsText adds string that writes details about this Material into the specified StringBuilder.
(Overrides MaterialGetDetailsText(StringBuilder, Boolean, Boolean, Boolean))
Public methodGetTextureMap(TextureMapTypes) Returns the GpuImage for the specified map type. If the map type is not found, then null is returned.
Public methodGetTextureMap(TextureMapTypes, GpuSampler) Returns the GpuImage for the specified map type. The method also sets the gpuSampler as an out parameter. If the map type is not found, then null is returned.
Public methodHasTextureMap Returns true if this PhysicallyBasedMaterial defines the specified map type.
Protected methodOnInitializeSceneResources Initializes resources with the specified Scene and GpuDevice. This method can be overriden and is called from InitializeSceneResources(Scene) method.
(Overrides MaterialOnInitializeSceneResources(Scene, VulkanDevice))
Public methodRemoveTextureMap Removes TextureMapInfo struct with the specified mapType from the TextureMaps.
Public methodSetTextureMap(TextureMapTypes, GpuImage) SetTextureMap updates (when the same mapType was already added) or adds a map type to this PhysicallyBasedMaterial. This method sets the sampler type to Mirror.
Public methodSetTextureMap(TextureMapTypes, GpuImage, CommonSamplerTypes) SetTextureMap updates (when the same mapType was already added) or adds a map type to this PhysicallyBasedMaterial.
Public methodSetTextureMap(TextureMapTypes, GpuImage, GpuSampler) SetTextureMap updates (when the same mapType was already added) or adds a map type to this PhysicallyBasedMaterial.
Public methodSetTextureMap(TextureMapTypes, RawImageData, CommonSamplerTypes, String) SetTextureMap updates (when the same mapType was already added) or adds a map type to this PhysicallyBasedMaterial.
Public methodSetTextureMap(TextureMapTypes, String, IBitmapIO, CommonSamplerTypes, Boolean, Boolean, Boolean) SetTextureMap updates (when the same mapType was already added) or adds a map type to this PhysicallyBasedMaterial. The texture is created from the provided the file name. If this material is not yet initialized, then the texture is loaded when initialized.
Public methodSetTextureMap(TextureMapTypes, Stream, String, IBitmapIO, CommonSamplerTypes, Boolean, Boolean, Boolean) SetTextureMap updates (when the same mapType was already added) or adds a map type to this PhysicallyBasedMaterial. The texture is created from the provided file stream. If this material is not yet initialized, then the texture is loaded when initialized.
Top
See Also