Click or drag to resize
Ab4d.SharpEngine logo

StandardMaterialBase Methods

The StandardMaterialBase type exposes the following members.

Methods
 NameDescription
Public methodCreateDiffuseTexture(RawImageData, CommonSamplerTypes, String, Single) CreateDiffuseTexture creates a GpuImage object from the specified rawImageData. If this material was already initialized ([!:Material.Scene] is set), then this method sets the DiffuseTexture, DiffuseTextureSamplerType and DiffuseTextureSampler properties. If this material was not yet initialized, then the creation of the texture is postponed until the InitializeResources method is called. To immediately create the texture call this method and pass a VulkanDevice as the first parameter. The created GpuImage is disposed when this Material is disposed.
Public methodCreateDiffuseTexture(VulkanDevice, RawImageData, CommonSamplerTypes, String, Single) CreateDiffuseTexture creates a GpuImage object from the specified rawImageData. The method sets the DiffuseTexture, DiffuseTextureSamplerType and DiffuseTextureSampler properties. Calling this method requires a valid gpuDevice objects. If you want to lazily create a diffuse texture before the device is known, call the method without the gpuDevice parameter. The created GpuImage is disposed when this Material is disposed.
Protected methodDispose Releases unmanaged and managed resources (when disposing is true). This method may be called only from the CheckAndDispose(Boolean) method and must not be called manually by the user.
(Overrides MaterialDispose(Boolean))
Public methodDisposeWithTexture DisposeWithTexture disposes this Material and also disposes the GpuImage that is assigned to the DiffuseTexture (if it is not cached by the Scene) even if the textures were created by the user and then set to the DiffuseTexture property (in this case the standard Dispose method does not dispose the DiffuseTexture).
Public methodGetDetailsText GetDetailsText adds string that writes details about this Material into the specified StringBuilder.
(Overrides MaterialGetDetailsText(StringBuilder, Boolean, Boolean, Boolean))
Public methodLoadDiffuseTexture(String, IBitmapIO, CommonSamplerTypes, Single, Boolean, Boolean) LoadDiffuseTexture lazily loads the specified textureFileName, creates a GpuImage object from the file and sets it to the DiffuseTexture property. The method also sets DiffuseTextureSamplerType and DiffuseTextureSampler properties. If this material was not yet initialized when this method is called ([!:Material.Scene] is not yet set), then the creation of the texture is postponed until the InitializeSceneResources method is called. To immediately create the texture, call this method and pass a VulkanDevice as the first parameter. When the created GpuImage is not cached by the Scene (useSceneCache is false by default) or GpuDevice (useGpuDeviceCache is true by default), then it is disposed when this Material is disposed.
Public methodLoadDiffuseTexture(VulkanDevice, String, IBitmapIO, CommonSamplerTypes, Single, Boolean) LoadDiffuseTexture immediately loads the specified textureFileName, creates a GpuImage object from the file and sets it to the DiffuseTexture property. The method also sets DiffuseTexture, DiffuseTextureSamplerType and DiffuseTextureSampler properties. Calling this method requires a valid gpuDevice objects. When useGpuDeviceCache is true (by default), then before loading the image the GpuDevice's cache is checked if this file was already loaded. Also, the create GpuImage is cached by the GpuDevice's cache. If you want to use Scene case, use the method override that takes Scene objects as parameter. If you want to lazily create a diffuse texture before the device is known, call the method without the gpuDevice parameter. When the created GpuImage is not cached by the GpuDevice (useGpuDeviceCache is true by default), then it is disposed when this Material is disposed.
Public methodLoadDiffuseTexture(Scene, String, IBitmapIO, CommonSamplerTypes, Single, Boolean, Boolean) LoadDiffuseTexture immediately loads the specified textureFileName, creates a GpuImage object from the file and sets it to the DiffuseTexture property. The method also sets DiffuseTexture, DiffuseTextureSamplerType and DiffuseTextureSampler properties. Calling this method requires a valid Scene object that has initialized GpuDevice set. When useGpuDeviceCache is true (by default), then before loading the image the Scene's cache is checked if this file was already loaded. Also, the create GpuImage is cached by the Scene's cache. If you want to use GpuDevice case, use the method override that takes GpuDevice objects as parameter. If you want to lazily create a diffuse texture before the device is known, call the method without the Scene parameter. When the created GpuImage is not cached by the Scene (useSceneCache is false by default) or GpuDevice (useGpuDeviceCache is true by default), then it is disposed when this Material is disposed.
Public methodLoadDiffuseTexture(Stream, String, IBitmapIO, CommonSamplerTypes, Single, Boolean, Boolean) LoadDiffuseTexture lazily loads the texture from the specified file steam, creates a GpuImage object from the file and sets it to the DiffuseTexture property. The method also sets DiffuseTextureSamplerType and DiffuseTextureSampler properties. If this material was not yet initialized when this method is called ([!:Material.Scene] is not yet set), then the creation of the texture is postponed until the InitializeSceneResources method is called. To immediately create the texture, call this method and pass a VulkanDevice as the first parameter. When the created GpuImage is not cached by the Scene (useSceneCache is false by default) or GpuDevice (useGpuDeviceCache is true by default), then it is disposed when this Material is disposed.
Public methodLoadDiffuseTexture(VulkanDevice, Stream, String, IBitmapIO, CommonSamplerTypes, Single, Boolean) LoadDiffuseTexture immediately loads the texture from the specified file steam, creates a GpuImage object from the file and sets it to the DiffuseTexture property. The method also sets DiffuseTexture, DiffuseTextureSamplerType and DiffuseTextureSampler properties. Calling this method requires a valid gpuDevice objects. When useGpuDeviceCache is true (by default), then before loading the image the GpuDevice's cache is checked if this file was already loaded. Also, the create GpuImage is cached by the GpuDevice's cache. If you want to use Scene case, use the method override that takes Scene objects as parameter. If you want to lazily create a diffuse texture before the device is known, call the method without the gpuDevice parameter. When the created GpuImage is not cached by the GpuDevice (useGpuDeviceCache is true by default), then it is disposed when this Material is disposed.
Public methodLoadDiffuseTexture(Scene, Stream, String, IBitmapIO, CommonSamplerTypes, Single, Boolean, Boolean) LoadDiffuseTexture immediately loads the texture from the specified file steam, creates a GpuImage object from the file and sets it to the DiffuseTexture property. The method also sets DiffuseTexture, DiffuseTextureSamplerType and DiffuseTextureSampler properties. Calling this method requires a valid Scene object that has initialized GpuDevice set. When useGpuDeviceCache is true (by default), then before loading the image the Scene's cache is checked if this file was already loaded. Also, the create GpuImage is cached by the Scene's cache. If you want to use GpuDevice case, use the method override that takes GpuDevice objects as parameter. If you want to lazily create a diffuse texture before the device is known, call the method without the Scene parameter. When the created GpuImage is not cached by the Scene (useSceneCache is false by default) or GpuDevice (useGpuDeviceCache is true by default), then it is disposed when this Material is disposed.
Protected methodOnDiffuseTextureDisposing OnDiffuseTextureDisposing
Protected methodOnInitializeSceneResources Initializes resources with the specified Scene and GpuDevice. This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides MaterialOnInitializeSceneResources(Scene, VulkanDevice))
Protected methodResetMaterialBase ResetMaterialBase
Public methodSetDiffuseTextureSampler SetDiffuseTextureSampler method sets the DiffuseTextureSampler to the specified sampler. It also sets the DiffuseTextureSamplerType to Other. It is also possible to set the DiffuseTextureSampler to a common sampler by setting the DiffuseTextureSamplerType.
Protected methodSetWhiteDiffuseColor SetWhiteDiffuseColor sets DiffuseColor to white behind the scenes so that the DiffuseColor is not marked to be changed by the user. This is used when setting texture so that texture is not masked by any other color.
Top
See Also