CommonSurfaceShader (Standard name: SurfaceShader)
Implements the Blinn-Phong BRDF with normal mapping and a perfect specular component.
Inheritance
Code
XML encoding
<CommonSurfaceShader logFeature='' alphaTextureChannelMask='a' alphaTextureCoordinatesId='0' alphaTextureId='-1' invertAlphaTexture='FALSE' alphaFactor='1' normalBias='-1 -1 -1' normalScale='2 2 2' textureTransformEnabled='0 0 0 0 0 0 0 0' fresnelBlend='0' relativeIndexOfRefraction='1' environmentTextureChannelMask='rgb' environmentTextureCoordinatesId='0' environmentTextureId='-1' environmentFactor='1 1 1' transmissionTextureCoordinatesId='0' transmissionTextureChannelMask='rgb' transmissionTextureId='-1' transmissionFactor='0 0 0' reflectionTextureCoordinatesId='0' reflectionTextureChannelMask='rgb' reflectionFactor='0 0 0' reflectionTextureId='-1' normalTextureChannelMask='rgb' normalTextureCoordinatesId='0' normalTextureId='-1' normalFormat='UNORM' normalSpace='TANGENT' shininessTextureChannelMask='a' shininessTextureId='-1' shininessTextureCoordinatesId='0' shininessFactor='0.2' specularTextureChannelMask='rgb' specularTextureCoordinatesId='0' specularTextureId='-1' specularFactor='0 0 0' diffuseTextureChannelMask='rgb' diffuseTextureId='-1' diffuseTextureCoordinatesId='0' diffuseFactor='0.8 0.8 0.8' ambientTextureChannelMask='rgb' ambientTextureCoordinatesId='0' ambientTextureId='-1' ambientFactor='0.2 0.2 0.2' emissiveTextureChannelMask='rgb' emissiveTextureCoordinatesId='0' emissiveTextureId='-1' emissiveFactor='0 0 0' tangentTextureCoordinatesId='-1' binormalTextureCoordinatesId='-1' />
Classic encoding
CommonSurfaceShader { logFeature [""] alphaTextureChannelMask "a" alphaTextureCoordinatesId 0 alphaTextureId -1 invertAlphaTexture FALSE alphaFactor 1 normalBias -1 -1 -1 normalScale 2 2 2 textureTransformEnabled [0 0 0 0 0 0 0 0] fresnelBlend 0 relativeIndexOfRefraction 1 environmentTextureChannelMask "rgb" environmentTextureCoordinatesId 0 environmentTextureId -1 environmentFactor 1 1 1 transmissionTextureCoordinatesId 0 transmissionTextureChannelMask "rgb" transmissionTextureId -1 transmissionFactor 0 0 0 reflectionTextureCoordinatesId 0 reflectionTextureChannelMask "rgb" reflectionFactor 0 0 0 reflectionTextureId -1 normalTextureChannelMask "rgb" normalTextureCoordinatesId 0 normalTextureId -1 normalFormat "UNORM" normalSpace "TANGENT" shininessTextureChannelMask "a" shininessTextureId -1 shininessTextureCoordinatesId 0 shininessFactor 0.2 specularTextureChannelMask "rgb" specularTextureCoordinatesId 0 specularTextureId -1 specularFactor 0 0 0 diffuseTextureChannelMask "rgb" diffuseTextureId -1 diffuseTextureCoordinatesId 0 diffuseFactor 0.8 0.8 0.8 ambientTextureChannelMask "rgb" ambientTextureCoordinatesId 0 ambientTextureId -1 ambientFactor 0.2 0.2 0.2 emissiveTextureChannelMask "rgb" emissiveTextureCoordinatesId 0 emissiveTextureId -1 emissiveFactor 0 0 0 tangentTextureCoordinatesId -1 binormalTextureCoordinatesId -1 }
Interface
Filter: X3D only | Avalon only | All
id | Name | DataType | PartType | Default | ValueType | Description |
---|---|---|---|---|---|---|
activate | SFBool | inputOnly | The activate field forces the shader to activate the contained objects. | |||
alphaFactor | SFFloat | inputOutput | 1 | The value of alphaTexture is multiplied by this value. If no texture is set, the value is used directly. | ||
alphaTexture | SFNode | inputOutput | Texture containing alpha component. | |||
alphaTextureChannelMask | SFString | inputOutput | a | ChannelMask for alphaTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
alphaTextureCoordinatesId | SFInt32 | inputOutput | 0 | Texture coordinate channel to use for alphaTexture. | ||
alphaTextureId | SFInt32 | inputOutput | -1 | The texture unit. | ||
ambientFactor | SFVec3f | inputOutput | 0.2 0.2 0.2 | The value of ambientTexture is multiplied by this value. If no texture is set, the value is used directly. | ||
ambientTexture | SFNode | inputOutput | Texture containing ambient component. | |||
ambientTextureChannelMask | SFString | inputOutput | rgb | ChannelMask for ambientTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
ambientTextureCoordinatesId | SFInt32 | inputOutput | 0 | Texture coordinate channel to use for ambientTexture. | ||
ambientTextureId | SFInt32 | inputOutput | -1 | The texture unit. | ||
binormalTextureCoordinatesId | SFInt32 | inputOutput | -1 | Texture coordinate channel that contains the tangents in v. | ||
diffuseFactor | SFVec3f | inputOutput | 0.8 0.8 0.8 | The value of diffuseTexture is multiplied by this value. If no texture is set, the value is used directly. | ||
diffuseTexture | SFNode | inputOutput | Texture containing diffuse component. | |||
diffuseTextureChannelMask | SFString | inputOutput | rgb | ChannelMask for diffuseTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
diffuseTextureCoordinatesId | SFInt32 | inputOutput | 0 | Texture coordinate channel to use for diffuseTexture. | ||
diffuseTextureId | SFInt32 | inputOutput | -1 | The texture unit. | ||
emissiveFactor | SFVec3f | inputOutput | 0 0 0 | The value of emissiveTexture is multiplied by this value. If no texture is set, the value is used directly. | ||
emissiveTexture | SFNode | inputOutput | Texture containing emissive component. | |||
emissiveTextureChannelMask | SFString | inputOutput | rgb | ChannelMask for emissiveTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
emissiveTextureCoordinatesId | SFInt32 | inputOutput | 0 | Texture coordinate channel to use for emissiveTexture. | ||
emissiveTextureId | SFInt32 | inputOutput | -1 | The texture unit. | ||
environmentFactor | SFVec3f | inputOutput | 1 1 1 | The value of environmentTexture is multiplied by this value. If no texture is set, the value is used directly. | ||
environmentTexture | SFNode | inputOutput | Cube texture containing the environment for perfect specular reflection and transmission. | |||
environmentTextureChannelMask | SFString | inputOutput | rgb | ChannelMask for environmentTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
environmentTextureCoordinatesId | SFInt32 | inputOutput | 0 | [Currently not used, coordinates are computed in shader.] | ||
environmentTextureId | SFInt32 | inputOutput | -1 | The texture unit. | ||
fresnelBlend | SFFloat | inputOutput | 0 | To what degree the Fresnel equation for dielectrics should be used to blend the perfect specular reflection and transmission. | ||
invertAlphaTexture | SFBool | inputOutput | FALSE | If true, (1-sampledValue) is used as alpha. If false the sampled value is used. | ||
isSelected | SFBool | outputOnly | The isSelected output field is used to indicate that this shader instance is the one selected for use by the browser. A TRUE value indicates that this instance is in use. | |||
isValid | SFBool | outputOnly | The isValid field is used to indicate whether the current shader objects can be run as a shader program. | |||
logFeature | MFString | inputOutput | state, child, parent, route, eventIn, eventOut | controls the logging of changes, state: log state changes (e.g. live), child: log child add/remove, parent: log parent add/remove, route: log route add/remove; eventIn: log receiving of events, eventOut: log sending of events: guiView, runtime system should create node-view, guiEdit: runtime system should create node-editeverything: log everything | ||
metadata | SFNode | inputOutput | MetadataObject | container for payload metadata inside MetadataSet element | ||
normalBias | SFVec3f | initializeOnly | -1 -1 -1 | Bias to apply to normal sampled from normalTexture | ||
normalFormat | SFString | inputOutput | UNORM | How normals are stored in normalTexture. Currently only "UNORM" (each component packed into a [0,1] color channel) is supported. | ||
normalScale | SFVec3f | initializeOnly | 2 2 2 | scale to apply to normal sampled from normalTexture | ||
normalSpace | SFString | inputOutput | TANGENT | Space in which normals in normalTexture are defined. Currently only "TANGENT" (a default tangent space normal map) is supported. | ||
normalTexture | SFNode | inputOutput | Texture containing normal component for normal mapping. | |||
normalTextureChannelMask | SFString | inputOutput | rgb | ChannelMask for normalTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
normalTextureCoordinatesId | SFInt32 | inputOutput | 0 | Texture coordinate channel to use for normalTexture. | ||
normalTextureId | SFInt32 | inputOutput | -1 | The texture unit. | ||
reflectionFactor | SFVec3f | inputOutput | 0 0 0 | The value of reflectionTexture is multiplied by this value. If no texture is set, the value is used directly. | ||
reflectionTexture | SFNode | inputOutput | AppearanceProperty | Texture containing reflection component. Perfect specular reflection is modulated by this. | ||
reflectionTextureChannelMask | SFString | inputOutput | rgb | ChannelMask for reflectionTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
reflectionTextureCoordinatesId | SFInt32 | inputOutput | 0 | Texture coordinate channel to use for reflectionTexture. | ||
reflectionTextureId | SFInt32 | inputOutput | -1 | The texture unit. | ||
relativeIndexOfRefraction | SFFloat | inputOutput | 1 | Relative IOR for perfect specular component. | ||
shininessFactor | SFFloat | inputOutput | 0.2 | The value of shininessTexture is multiplied by this value. If no texture is set, the value is used directly. | ||
shininessTexture | SFNode | inputOutput | Texture containing shininess component. | |||
shininessTextureChannelMask | SFString | inputOutput | a | ChannelMask for shininessTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
shininessTextureCoordinatesId | SFInt32 | inputOutput | 0 | Texture coordinate channel to use for shininessTexture. | ||
shininessTextureId | SFInt32 | inputOutput | -1 | The texture unit. | ||
specularFactor | SFVec3f | inputOutput | 0 0 0 | The value of specularTexture is multiplied by this value. If no texture is set, the value is used directly. | ||
specularTexture | SFNode | inputOutput | Texture containing specular component. | |||
specularTextureChannelMask | SFString | inputOutput | rgb | ChannelMask for specularTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
specularTextureCoordinatesId | SFInt32 | inputOutput | 0 | Texture coordinate channel to use for specularTexture. | ||
specularTextureId | SFInt32 | inputOutput | -1 | The texture unit. | ||
tangentTextureCoordinatesId | SFInt32 | inputOutput | -1 | Texture coordinate channel that contains the tangents in u. | ||
textureTransformEnabled | MFBool | initializeOnly | 0 0 0 0 0 0 0 0 | defines if the OpenGL texture transform for a texture coordinate channel should be applied. This transform is applied in the vertex shader before the transformsassiciated with the textures are applied. | ||
transmissionFactor | SFVec3f | inputOutput | 0 0 0 | The value of transmissionTexture is multiplied by this value. If no texture is set, the value is used directly. | ||
transmissionTexture | SFNode | inputOutput | Texture containing transmission component. Perfect specular transmission is modulated by this. | |||
transmissionTextureChannelMask | SFString | inputOutput | rgb | ChannelMask for transmissionTexture in the form of a glsl swizzle (e.g. "rgb", "a"). | ||
transmissionTextureCoordinatesId | SFInt32 | inputOutput | 0 | Texture coordinate channel to use for transmissionTexture. | ||
transmissionTextureId | SFInt32 | inputOutput | -1 | The texture unit. |