Cortona VRML Client 5.0 supports DirectX 9.0c. The latest version of DirectX is available at
Please make sure you have a DirectX 9.0 compatible graphics adapter with hardware shader support.
The implementation of programmable shaders corresponds to the X3D Programmable Shader Proposal. The supported shader languages are High Level Shader Language (HLSL) and nVidia Cg shading language. DirectX 9.0 FX format is supported.
Three new nodes were added to Cortona VRML Client for shader support: ShaderAppearance, VertexShader and FragmentShader.
ShaderAppearance
EXTERNPROTO ShaderAppearance [
exposedField SFNode fillProperties
exposedField SFNode fragmentShader
exposedField SFNode lineProperties
exposedField SFNode material
exposedField SFNode texture
exposedField SFNode textureTransform
exposedField SFNode vertexShader
]
[
"urn:inetarallelgraphics.com:cortona:ShaderAppearance"
"http://www.parallelgraphics.com/vrml/proto/Cortona/extensions.wrl
VertexShader
VertexShader { exposedField MFString url #any number of field fieldType fieldName eventIn fieldType fieldName eventOut fieldType fieldName exposedField fieldType fieldName }
VertexShader node defines a vertex shader for modifying geometry's vertex values. Url field specifies shader programming language code. The prefix in the beginning of the url's field value shows the browser what shader language is used. Hlsl prefix means that High Level Shader Language is used, cg prefix means that nVidia Cg shading language is used.
This example demonstrates the vertex shader written in the HLSL:
VertexShader { url ["hlsl: ..."] }
Multiple valued url field could contain several different shader programs simultaneously. A description of order of preference for multiple valued URL fields may be found in the following document:
In addition to the url field, any number of different fields could be declared in the VertexShader node. These fields receive and process events of the scene.
FragmentShader
FragmentShader {
exposedField MFString url
#any number of
field fieldType fieldName
eventIn fieldType fieldName
eventOut fieldType fieldName
exposedField fieldType fieldName
}
FragmentShader node (more often it is known as a pixel shader) defines a pixel shader for modifying geometry's pixel values. All the fields of the FragmentShader have the same syntax as VertexShader's fields.
More detailed information about shaders can be found in the following documents:
|
| Microsoft DirectX 9 SDK: |
|
| X3D Specification, programmable shaders component, Microsoft High Level Shading Language (HLSL) Binding: J.3. Interaction other nodes and components, |
|
| X3D Specification, programmable shaders component, nVidia Cg shading language binding: K.4. Interaction other nodes and components, |
#ShaderAppearance"
]
ShaderAppearance node is used instead of Appearance node. The vertexShader field contains VertexShader node. The fragmentShader field contains FragmentShader node. Detaialed description of VertexShader and FragmentShader nodes is placed below. The material, texture and textureTransform fields work as in the Appearance node. They define the visual properties of geometry only in the following cases:
|
| The DirectX9 renderer is not activated. |
|
| Your hardware has no shader support. |
|
| Vertex or Fragment shaders are not specified or written in the language which is not supported by the browser. |
FillProperties and lineProperties are not yet implemented. If these fields exist, they are ignored by the browser.
Edit: Removed advertising from signature