# Material đ
In the real world, each object would react differently to light. Steel looks more shiny than a ceramic vase, and a wooden box would not reflect light as strongly as a steel box. Each object also reacts differently to specular highlights. Some objects don't scatter a lot of light but reflect a lot of light, resulting in a smaller highlight, and some objects scatter a lot and they produce a larger radius highlight. If we want to simulate multiple types of objects in OpenGL, we must define the Material property for each object separately.
# DC.ColorMaterialProperty
# example
let material = new DC.ColorMaterialProperty(DC.Color.RED)
# creation
constructor(color)
- parameters
{DC.Color} color
- returns
material
- parameters
# DC.ImageMaterialProperty
# example
let material = new DC.ImageMaterialProperty({
image: '**/**.png',
transparent: true,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
material
- parameters
//options(optional)
{
"image": "",
"repeat": { "x": 1, "y": 1 },
"color": DC.Color.WHITE,
"transparent": false
}
# properties
{String} image
{Object} repeat
{DC.Color} color
{Boolean} transparent
# DC.CircleBlurMaterialProperty
# example
let material = new DC.CircleBlurMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.CircleDiffuseMaterialProperty
# example
let material = new DC.CircleDiffuseMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.CircleFadeMaterialProperty
# example
let material = new DC.CircleFadeMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.CirclePulseMaterialProperty
# example
let material = new DC.CirclePulseMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.CircleScanMaterialProperty
# example
let material = new DC.CircleScanMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
material
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.CircleSpiralMaterialProperty
# example
let material = new DC.CircleSpiralMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.CircleVaryMaterialProperty
# example
let material = new DC.CircleVaryMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
material
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.CircleWaveMaterialProperty
# example
let material = new DC.CircleWaveMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
material
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10,
"count": 5,
"gradient": 0.1
}
# properties
{Color} color
{Number} speed
{Number} count
{Number} gradient
# DC.EllipsoidElectricMaterialProperty
# example
let material = new DC.EllipsoidElectricMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.EllipsoidTrailMaterialProperty
# example
let material = new DC.EllipsoidTrailMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.PolylineDashMaterialProperty
# example
let material = new DC.PolylineDashMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"gapColor": DC.Color.TRANSPARENT,
"dashLength": 16.0
}
# properties
{DC.Color} color
{DC.Color} gapColor
{Number} dashLength
# DC.PolylineArrowMaterialProperty
# example
let material = new DC.PolylineArrowMaterialProperty(DC.Color.WHITE)
# creation
constructor(color)
- parameters
{DC.Color} color
- returns
materialProperty
- parameters
# properties
{DC.Color} color
# DC.PolylineOutlineMaterialProperty
# example
let material = new DC.PolylineOutlineMaterialProperty({
color: DC.Color.WHITE,
outlineColor: DC.Color.BLACK,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"outlineColor": DC.Color.BLACK,
"outlineWidth": 1
}
# properties
{DC.Color} color
{DC.Color} outlineColor
{Number} outlineWidth
# DC.PolylineGlowMaterialProperty
# example
let material = new DC.PolylineGlowMaterialProperty({
color: DC.Color.WHITE,
glowPower: 0.25,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"glowPower": 0.25,
"taperPower": 1
}
# properties
{DC.Color} color
{Number} glowPower
{Number} taperPower
# DC.PolylineFlickerMaterialProperty
# example
let material = new DC.PolylineFlickerMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.PolylineFlowMaterialProperty
# example
let material = new DC.PolylineFlowMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10,
"percent": 0.3,
"gradient": 0.1
}
# properties
{DC.Color} color
{Number} speed
{Number} percent
{Number} gradient
# DC.PolylineImageTrailMaterialProperty
# example
let material = new DC.PolylineImageTrailMaterialProperty({
color: DC.Color.WHITE,
image: '**/*.png',
repeat: { x: 10, y: 1 },
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10,
"image": "**/*.png",
"repeat": { "x": 10, "y": 1 }
}
# properties
{DC.Color} color
{Number} speed
{String} image
{Object} repeat
# DC.PolylineLightingMaterialProperty
# example
let material = new DC.PolylineLightingMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE
}
# properties
{DC.Color} color
# DC.PolylineLightingTrailMaterialProperty
# example
let material = new DC.PolylineLightingTrailMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.PolylineTrailMaterialProperty
# example
let material = new DC.PolylineTrailMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.RadarLineMaterialProperty
# example
let material = new DC.RadarLineMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.RadarWaveMaterialProperty
# example
let material = new DC.RadarWaveMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.WallImageTrailMaterialProperty
# example
let material = new DC.WallImageTrailMaterialProperty({
color: DC.Color.WHITE,
image: '**/*.png',
repeat: { x: 10, y: 1 },
})
# creation
constructor([options])
- parameters
{Object} options
- returns
materialProperty
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10,
"image": "**/*.png",
"repeat": { "x": 10, "y": 1 }
}
# properties
{DC.Color} color
{Number} speed
{String} image
{Object} repeat
# DC.WallTrailMaterialProperty
# example
let material = new DC.WallTrailMaterialProperty({
color: DC.Color.WHITE,
})
# creation
constructor([options])
- parameters
{Object} options
- returns
material
- parameters
// options(optional)
{
"color": DC.Color.WHITE,
"speed": 10
}
# properties
{DC.Color} color
{Number} speed
# DC.WaterMaterialProperty
# example
let material = new DC.WaterMaterialProperty({
baseWaterColor: DC.Color.WHITE,
normalMap: '**/**.png',
})
# creation
constructor([options])
- parameters
{Object} options
- returns
material
- parameters
// options(optional)
{
"baseWaterColor": DC.Color.WHITE,
"blendColor": DC.Color.WHITE,
"specularMap": "",
"normalMap": "",
"frequency": 1000,
"animationSpeed": 0.03,
"amplitude": 10,
"specularIntensity": 10
}
# properties
{DC.Color} baseWaterColor
{DC.Color} blendColor
{String} normalMap
{String} specularMap