Node: CommonSurfaceShader

X3DOM
Component: Shaders

Quick Links

➨ Fields

Implements the Blinn-Phong BRDF with normal mapping and a perfect specular component.

HTML Encoding and Default Values

<CommonSurfaceShader alphaFactor='1' alphaTexture='x3dom.nodeTypes.X3DTextureNode' alphaTextureChannelMask=''a'' alphaTextureCoordinatesId='0' alphaTextureId='-1' ambientFactor='0.2,0.2,0.2' ambientTexture='x3dom.nodeTypes.X3DTextureNode' ambientTextureChannelMask=''rgb'' ambientTextureCoordinatesId='0' ambientTextureId='-1' binormalTextureCoordinatesId='-1' diffuseDisplacementTexture='x3dom.nodeTypes.X3DTextureNode' diffuseFactor='0.8,0.8,0.8' diffuseTexture='x3dom.nodeTypes.X3DTextureNode' diffuseTextureChannelMask=''rgb'' diffuseTextureCoordinatesId='0' diffuseTextureId='-1' displacementAxis=''y'' displacementFactor='255.0' displacementTexture='x3dom.nodeTypes.X3DTextureNode' displacementTextureCoordinatesId='0' displacementTextureId='-1' emissiveFactor='0,0,0' emissiveTexture='x3dom.nodeTypes.X3DTextureNode' emissiveTextureChannelMask=''rgb'' emissiveTextureCoordinatesId='0' emissiveTextureId='-1' environmentFactor='1,1,1' environmentTexture='x3dom.nodeTypes.X3DTextureNode' environmentTextureChannelMask=''rgb'' environmentTextureCoordinatesId='0' environmentTextureId='-1' fresnelBlend='0' invertAlphaTexture='false' language='""' metadata='X3DMetadataObject' normalBias='-1,-1,1' normalFormat=''UNORM'' normalScale='2,2,2' normalSpace=''TANGENT'' normalTexture='x3dom.nodeTypes.X3DTextureNode' normalTextureChannelMask=''rgb'' normalTextureCoordinatesId='0' normalTextureId='-1' reflectionFactor='0,0,0' reflectionTexture='x3dom.nodeTypes.X3DTextureNode' reflectionTextureChannelMask=''rgb'' reflectionTextureCoordinatesId='0' reflectionTextureId='-1' relativeIndexOfRefraction='1' shininessFactor='0.2' shininessTexture='x3dom.nodeTypes.X3DTextureNode' shininessTextureChannelMask=''a'' shininessTextureCoordinatesId='0' shininessTextureId='-1' specularFactor='0,0,0' specularTexture='x3dom.nodeTypes.X3DTextureNode' specularTextureChannelMask=''rgb'' specularTextureCoordinatesId='0' specularTextureId='-1' tangentTextureCoordinatesId='-1' transmissionFactor='0,0,0' transmissionTexture='x3dom.nodeTypes.X3DTextureNode' transmissionTextureChannelMask=''rgb'' transmissionTextureCoordinatesId='0' transmissionTextureId='-1' ></CommonSurfaceShader>

Inheritance


Fields

These are the X3D / X3DOM fields of this node. Values should usually be received / set as strings via DOM functions (i.e., using setAttribute("myFieldName", "myFieldValue") and getAttribute("myFieldName")).
Name Type Default Value Range Inheritance Standard Description
alphaFactor SFFloat 1 The value of alphaTexture is multiplied by this value. If no texture is set, the value is used directly.
alphaTexture SFNode Texturing/X3DTextureNode Texture containing alpha component.
alphaTextureChannelMask SFString 'a' [a,rgb,..] ChannelMask for alphaTexture in the form of a glsl swizzle (e.g. "rgb", "a").
alphaTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for alphaTexture.
alphaTextureId SFInt32 -1 The texture unit.
ambientFactor SFVec3f 2 The value of ambientTexture is multiplied by this value. If no texture is set, the value is used directly.
ambientTexture SFNode Texturing/X3DTextureNode Texture containing ambient component.
ambientTextureChannelMask SFString 'rgb' [rgb,a,..] ChannelMask for ambientTexture in the form of a glsl swizzle (e.g. "rgb", "a").
ambientTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for ambientTexture.
ambientTextureId SFInt32 -1 The texture unit.
binormalTextureCoordinatesId SFInt32 -1 Texture coordinate channel that contains the tangents in v.
diffuseDisplacementTexture SFNode Texturing/X3DTextureNode Texture containing diffuse displacement component.
diffuseFactor SFVec3f 8 The value of diffuseTexture is multiplied by this value. If no texture is set, the value is used directly.
diffuseTexture SFNode Texturing/X3DTextureNode Texture containing diffuse component.
diffuseTextureChannelMask SFString 'rgb' [rgb,a,..] ChannelMask for diffuseTexture in the form of a glsl swizzle (e.g. "rgb", "a").
diffuseTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for diffuseTexture.
diffuseTextureId SFInt32 -1 The texture unit.
displacementAxis SFString 'y' Axis along which the vertices are displacement
displacementFactor SFFloat 0 Factor for the displacement.
displacementTexture SFNode Texturing/X3DTextureNode Texture containing displacement component.
displacementTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for displacementTexture.
displacementTextureId SFInt32 -1 The texture unit.
emissiveFactor SFVec3f 0,0,0 The value of emissiveTexture is multiplied by this value. If no texture is set, the value is used directly.
emissiveTexture SFNode Texturing/X3DTextureNode Texture containing emissive component.
emissiveTextureChannelMask SFString 'rgb' [rgb,a,..] ChannelMask for emissiveTexture in the form of a glsl swizzle (e.g. "rgb", "a").
emissiveTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for emissiveTexture.
emissiveTextureId SFInt32 -1 The texture unit.
environmentFactor SFVec3f 1,1,1 The value of environmentTexture is multiplied by this value. If no texture is set, the value is used directly.
environmentTexture SFNode Texturing/X3DTextureNode Cube texture containing the environment for perfect specular reflection and transmission.
environmentTextureChannelMask SFString 'rgb' [rgb,a,..] ChannelMask for environmentTexture in the form of a glsl swizzle (e.g. "rgb", "a").
environmentTextureCoordinatesId SFInt32 0 [Currently not used, coordinates are computed in shader.]
environmentTextureId SFInt32 -1 The texture unit.
fresnelBlend SFFloat 0 To what degree the Fresnel equation for dielectrics should be used to blend the perfect specular reflection and transmission.
invertAlphaTexture SFBool false If true, (1-sampledValue) is used as alpha. If false the sampled value is used.
language SFString "" ["Cg"|"GLSL"|"HLSL"|...] X3DShaderNode The language field is used to indicate to the browser which shading language is used for the source file(s). This field may be used as a hint for the browser if the shading language is not immediately determinable from the source (e.g., a generic MIME type of text/plain is returned). A browser may use this field for determining which node instance will be selected and to ignore languages that it is not capable of supporting. Three basic language types are defined for this specification and others may be optionally supported by a browser.
metadata SFNode X3DMetadataObject Core/X3DNode Field to add metadata information
normalBias SFVec3f -1,-1,1 Bias to apply to normal sampled from normalTexture
normalFormat SFString 'UNORM' [UNORM] How normals are stored in normalTexture. Currently only "UNORM" (each component packed into a [0,1] color channel) is supported.
normalScale SFVec3f 2,2,2 scale to apply to normal sampled from normalTexture
normalSpace SFString 'TANGENT' [TANGENT, OBJECT] Space in which normals in normalTexture are defined.
normalTexture SFNode Texturing/X3DTextureNode Texture containing normal component for normal mapping.
normalTextureChannelMask SFString 'rgb' [rgb,a,..] ChannelMask for normalTexture in the form of a glsl swizzle (e.g. "rgb", "a").
normalTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for normalTexture.
normalTextureId SFInt32 -1 The texture unit.
reflectionFactor SFVec3f 0,0,0 The value of reflectionTexture is multiplied by this value. If no texture is set, the value is used directly.
reflectionTexture SFNode Texturing/X3DTextureNode Texture containing reflection component.
reflectionTextureChannelMask SFString 'rgb' [rgb,a,..] ChannelMask for reflectionTexture in the form of a glsl swizzle (e.g. "rgb", "a").
reflectionTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for reflectionTexture.
reflectionTextureId SFInt32 -1 The texture unit.
relativeIndexOfRefraction SFFloat 1 Relative IOR for perfect specular component.
shininessFactor SFFloat 2 The value of shininessTexture is multiplied by this value. If no texture is set, the value is used directly.
shininessTexture SFNode Texturing/X3DTextureNode Texture containing shininess component.
shininessTextureChannelMask SFString 'a' [rgb,a,..] ChannelMask for shininessTexture in the form of a glsl swizzle (e.g. "rgb", "a").
shininessTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for shininessTexture.
shininessTextureId SFInt32 -1 The texture unit.
specularFactor SFVec3f 0,0,0 The value of specularTexture is multiplied by this value. If no texture is set, the value is used directly.
specularTexture SFNode Texturing/X3DTextureNode Texture containing specular component.
specularTextureChannelMask SFString 'rgb' [rgb,a,..] ChannelMask for specularTexture in the form of a glsl swizzle (e.g. "rgb", "a").
specularTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for specularTexture.
specularTextureId SFInt32 -1 The texture unit.
tangentTextureCoordinatesId SFInt32 -1 Texture coordinate channel that contains the tangents in u.
transmissionFactor SFVec3f 0,0,0 The value of transmissionTexture is multiplied by this value. If no texture is set, the value is used directly.
transmissionTexture SFNode Texturing/X3DTextureNode Texture containing transmission component.
transmissionTextureChannelMask SFString 'rgb' [rgb,a,..] ChannelMask for transmissionTexture in the form of a glsl swizzle (e.g. "rgb", "a").
transmissionTextureCoordinatesId SFInt32 0 Texture coordinate channel to use for transmissionTexture.
transmissionTextureId SFInt32 -1 The texture unit.