instantreality 1.0

Component:
Shaders
Status:
fully implemented
Structure type:
concrete
Standard:
Avalon

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
MFBool 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.
MFString 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
SFBool activate SFBool inputOnly The activate field forces the shader to activate the contained objects.
SFBool invertAlphaTexture SFBool inputOutput FALSE If true, (1-sampledValue) is used as alpha. If false the sampled value is used.
SFBool 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.
SFBool isValid SFBool outputOnly The isValid field is used to indicate whether the current shader objects can be run as a shader program.
SFFloat alphaFactor SFFloat inputOutput 1 The value of alphaTexture is multiplied by this value. If no texture is set, the value is used directly.
SFFloat fresnelBlend SFFloat inputOutput 0 To what degree the Fresnel equation for dielectrics should be used to blend the perfect specular reflection and transmission.
SFFloat relativeIndexOfRefraction SFFloat inputOutput 1 Relative IOR for perfect specular component.
SFFloat shininessFactor SFFloat inputOutput 0.2 The value of shininessTexture is multiplied by this value. If no texture is set, the value is used directly.
SFInt32 alphaTextureCoordinatesId SFInt32 inputOutput 0 Texture coordinate channel to use for alphaTexture.
SFInt32 alphaTextureId SFInt32 inputOutput -1 The texture unit.
SFInt32 ambientTextureCoordinatesId SFInt32 inputOutput 0 Texture coordinate channel to use for ambientTexture.
SFInt32 ambientTextureId SFInt32 inputOutput -1 The texture unit.
SFInt32 binormalTextureCoordinatesId SFInt32 inputOutput -1 Texture coordinate channel that contains the tangents in v.
SFInt32 diffuseTextureCoordinatesId SFInt32 inputOutput 0 Texture coordinate channel to use for diffuseTexture.
SFInt32 diffuseTextureId SFInt32 inputOutput -1 The texture unit.
SFInt32 emissiveTextureCoordinatesId SFInt32 inputOutput 0 Texture coordinate channel to use for emissiveTexture.
SFInt32 emissiveTextureId SFInt32 inputOutput -1 The texture unit.
SFInt32 environmentTextureCoordinatesId SFInt32 inputOutput 0 [Currently not used, coordinates are computed in shader.]
SFInt32 environmentTextureId SFInt32 inputOutput -1 The texture unit.
SFInt32 normalTextureCoordinatesId SFInt32 inputOutput 0 Texture coordinate channel to use for normalTexture.
SFInt32 normalTextureId SFInt32 inputOutput -1 The texture unit.
SFInt32 reflectionTextureCoordinatesId SFInt32 inputOutput 0 Texture coordinate channel to use for reflectionTexture.
SFInt32 reflectionTextureId SFInt32 inputOutput -1 The texture unit.
SFInt32 shininessTextureCoordinatesId SFInt32 inputOutput 0 Texture coordinate channel to use for shininessTexture.
SFInt32 shininessTextureId SFInt32 inputOutput -1 The texture unit.
SFInt32 specularTextureCoordinatesId SFInt32 inputOutput 0 Texture coordinate channel to use for specularTexture.
SFInt32 specularTextureId SFInt32 inputOutput -1 The texture unit.
SFInt32 tangentTextureCoordinatesId SFInt32 inputOutput -1 Texture coordinate channel that contains the tangents in u.
SFInt32 transmissionTextureCoordinatesId SFInt32 inputOutput 0 Texture coordinate channel to use for transmissionTexture.
SFInt32 transmissionTextureId SFInt32 inputOutput -1 The texture unit.
SFNode alphaTexture SFNode inputOutput Texture containing alpha component.
SFNode ambientTexture SFNode inputOutput Texture containing ambient component.
SFNode diffuseTexture SFNode inputOutput Texture containing diffuse component.
SFNode emissiveTexture SFNode inputOutput Texture containing emissive component.
SFNode environmentTexture SFNode inputOutput Cube texture containing the environment for perfect specular reflection and transmission.
SFNode metadata SFNode inputOutput MetadataObject container for payload metadata inside MetadataSet element
SFNode normalTexture SFNode inputOutput Texture containing normal component for normal mapping.
SFNode reflectionTexture SFNode inputOutput AppearanceProperty Texture containing reflection component. Perfect specular reflection is modulated by this.
SFNode shininessTexture SFNode inputOutput Texture containing shininess component.
SFNode specularTexture SFNode inputOutput Texture containing specular component.
SFNode transmissionTexture SFNode inputOutput Texture containing transmission component. Perfect specular transmission is modulated by this.
SFString alphaTextureChannelMask SFString inputOutput a ChannelMask for alphaTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFString ambientTextureChannelMask SFString inputOutput rgb ChannelMask for ambientTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFString diffuseTextureChannelMask SFString inputOutput rgb ChannelMask for diffuseTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFString emissiveTextureChannelMask SFString inputOutput rgb ChannelMask for emissiveTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFString environmentTextureChannelMask SFString inputOutput rgb ChannelMask for environmentTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFString normalFormat SFString inputOutput UNORM How normals are stored in normalTexture. Currently only "UNORM" (each component packed into a [0,1] color channel) is supported.
SFString normalSpace SFString inputOutput TANGENT Space in which normals in normalTexture are defined. Currently only "TANGENT" (a default tangent space normal map) is supported.
SFString normalTextureChannelMask SFString inputOutput rgb ChannelMask for normalTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFString reflectionTextureChannelMask SFString inputOutput rgb ChannelMask for reflectionTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFString shininessTextureChannelMask SFString inputOutput a ChannelMask for shininessTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFString specularTextureChannelMask SFString inputOutput rgb ChannelMask for specularTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFString transmissionTextureChannelMask SFString inputOutput rgb ChannelMask for transmissionTexture in the form of a glsl swizzle (e.g. "rgb", "a").
SFVec3f 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.
SFVec3f 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.
SFVec3f 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.
SFVec3f 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.
SFVec3f normalBias SFVec3f initializeOnly -1 -1 -1 Bias to apply to normal sampled from normalTexture
SFVec3f normalScale SFVec3f initializeOnly 2 2 2 scale to apply to normal sampled from normalTexture
SFVec3f 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.
SFVec3f 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.
SFVec3f 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.