Platforms to show: All Mac Windows Linux Cross-Platform
SCNMaterialMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | SceneKit | MBS Mac64bit Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
When you create a material, you define a collection of visual attributes and their options, which you can then reuse for multiple geometries in a scene.
A material has several visual properties, each of which defines a different part of SceneKit’s lighting and shading process. Each visual property is an instance of the SCNMaterialPropertyMBS class that provides a solid color, texture, or other 2D content for that aspect of SceneKit’s rendering. The material’s lightingModelName property then determines the formula SceneKit uses to combine the visual properties with the lights in the scene to produce the final color for each pixel in the rendered scene. For more details on the rendering process, see SCNLightingModelMBS.
You attach one or more materials to an instance of the SCNGeometryMBS class using its firstMaterial or materials property. Multiple geometries can reference the same material. In this case, changing the attributes of the material changes the appearance of every geometry that uses it.
- 30 properties
- property ambient as SCNMaterialPropertyMBS
- property ambientOcclusion as SCNMaterialPropertyMBS
- property blendMode as Integer
- property colorBufferWriteMask as Integer
- property cullMode as Integer
- property diffuse as SCNMaterialPropertyMBS
- property displacement as SCNMaterialPropertyMBS
- property DoubleSided as Boolean
- property emission as SCNMaterialPropertyMBS
- property fillMode as Integer
- property fresnelExponent as Double
- property Handle as Integer New in 24.4
- property lightingModelName as String
- property LitPerPixel as Boolean
- property locksAmbientWithDiffuse as Boolean
- property metalness as SCNMaterialPropertyMBS
- property multiply as SCNMaterialPropertyMBS
- property name as String
- property normal as SCNMaterialPropertyMBS
- property readsFromDepthBuffer as Boolean
- property reflective as SCNMaterialPropertyMBS
- property roughness as SCNMaterialPropertyMBS
- property selfIllumination as SCNMaterialPropertyMBS
- property shaderModifiers as Dictionary New in 24.4
- property shininess as Double
- property specular as SCNMaterialPropertyMBS
- property transparency as Double
- property transparencyMode as Integer
- property transparent as SCNMaterialPropertyMBS
- property writesToDepthBuffer as Boolean
- 2 methods
- method Constructor
- method copy as SCNMaterialMBS
- 6 shared methods
- shared method material as SCNMaterialMBS
- shared method SCNLightingModelBlinn as string
- shared method SCNLightingModelConstant as string
- shared method SCNLightingModelLambert as string
- shared method SCNLightingModelPhong as string
- shared method SCNLightingModelPhysicallyBased as string
- 16 constants
Constants
Constant | Value | Description |
---|---|---|
SCNTransparencyModeAOne | 0 |
One of the constants for the modes SceneKit uses to calculate the opacity of pixels rendered with a material, used by the transparencyMode property.
SceneKit derives transparency information from the alpha channel of colors. The value 1.0 is opaque. |
SCNTransparencyModeDefault | 0 |
One of the constants for the modes SceneKit uses to calculate the opacity of pixels rendered with a material, used by the transparencyMode property.
Default |
SCNTransparencyModeDualLayer | 3 |
One of the constants for the modes SceneKit uses to calculate the opacity of pixels rendered with a material, used by the transparencyMode property.
Dual layer. |
SCNTransparencyModeRGBZero | 1 | One of the constants for the modes SceneKit uses to calculate the opacity of pixels rendered with a material, used by the transparencyMode property. SceneKit derives transparency information from the luminance of colors. The value 0.0 is opaque. more |
SCNTransparencyModeSingleLayer | 2 |
One of the constants for the modes SceneKit uses to calculate the opacity of pixels rendered with a material, used by the transparencyMode property.
Single layer. |
Blend Modes
Constant | Value | Description |
---|---|---|
SCNBlendModeAdd | 1 |
Blend by adding the source color to the destination color. This mode results in a brightening effect that can be useful for making objects appear to glow relative to their surroundings. |
SCNBlendModeAlpha | 0 |
Blend by multiplying source and destination color values by their corresponding alpha values. This mode is the default value of the blendMode property. |
SCNBlendModeMax | 6 |
Max |
SCNBlendModeMultiply | 3 |
Blend by multiplying the source color with the background color. This mode results in colors that are at least as dark as either of the two contributing colors. |
SCNBlendModeReplace | 5 |
Blend by replacing the destination color with the source color, ignoring alpha. |
SCNBlendModeScreen | 4 |
Blend by multiplying the inverse of the source color with the inverse of the destination color. This mode results in colors that are at least as light as either of the two contributing colors. |
SCNBlendModeSubtract | 2 |
Blend by subtracting the source color from the destination color. |
Cull Modes
Constant | Value | Description |
---|---|---|
SCNCullModeBack | 0 |
The mode for culling back-facing polygons (and rendering only front-facing polygons). |
SCNCullModeFront | 1 |
The mode for culling front-facing polygons (and rendering only back-facing polygons). |
Fill Modes
Constant | Value | Description |
---|---|---|
SCNFillModeFill | 0 |
Fill |
SCNFillModeLines | 1 |
Lines |
This class has no sub classes.
Some methods using this class:
- SCNGeometryMBS.insertMaterial(Material as SCNMaterialMBS, Index as Integer)
- SCNGeometryMBS.materials as SCNMaterialMBS()
- SCNGeometryMBS.materialWithName(name as string) as SCNMaterialMBS
- SCNGeometryMBS.replaceMaterial(Index as Integer, Material as SCNMaterialMBS)
- SCNGeometryMBS.setMaterials(materials() as SCNMaterialMBS)
Some properties using for this class:
- SCNGeometryMBS.firstMaterial as SCNMaterialMBS
Some examples using this class:
Blog Entries
- MonkeyBread Software Releases the MBS Xojo Plugins in version 24.4
- MBS Xojo Plugins, version 24.4pr6
- MBS Xojo Plugins, version 19.1pr1
Release notes
- Version 24.4
- Added shaderModifiers and handle properties for SCNMaterialMBS class.
- Version 19.1
- Added SCNVector4MBS, SCNMatrix4MBS, SCNVector3MBS, SCNMaterialPropertyMBS and SCNMaterialMBS classes for SceneKit.
The items on this page are in the following plugins: MBS Mac64bit Plugin.
SCNLookAtConstraintMBS - SCNMaterialPropertyMBS