| 1 |
# -*- mode: shell-script -*- |
| 2 |
# |
| 3 |
# Specification of Castle Game Engine X3D extensions. |
| 4 |
# See https://castle-engine.io/x3d_extensions.php . |
| 5 |
# This file is in the format understood by |
| 6 |
# our ../x3d-nodes-to-pascal/x3d-nodes-to-pascal.lpr |
| 7 |
# and by White Dune scripts. |
| 8 |
# |
| 9 |
# Note that we only list here *new* X3D nodes. |
| 10 |
# Extensions (new fields) to existing nodes must be listed in other txt files |
| 11 |
# (otherwse x3d-nodes-to-pascal would not be able to handle them). |
| 12 |
# ---------------------------------------------------------------------------- |
| 13 |
|
| 14 |
# "KambiAppearance" is just a synonym for "Appearance" now. |
| 15 |
# |
| 16 |
# Now we just add all new fields to the standard "Appearance" node. |
| 17 |
# Reasons: we describe in shadow_maps_x3d paper |
| 18 |
# our propositions for Appearance (without introducing KambiAppearance, |
| 19 |
# as (in the future) these should not be specific to our engine), |
| 20 |
# also InstantReality already has Appearance.blendMode. |
| 21 |
# |
| 22 |
# You can however use KambiAppearance in your models, this allows you |
| 23 |
# to declare KambiAppearance by EXTERNPROTO and fallback on standard |
| 24 |
# Appearance. |
| 25 |
KambiAppearance : Appearance { |
| 26 |
} |
| 27 |
|
| 28 |
GeneratedShadowMap : X3DSingleTextureNode { |
| 29 |
SFString [in,out] update "NONE" |
| 30 |
range: ["NONE"|"NEXT_FRAME_ONLY"|"ALWAYS"] |
| 31 |
enumerated-type: TTextureUpdate TextureUpdateNames upNone |
| 32 |
doc: When to update the texture contents. |
| 33 |
# See GeneratedCubeMapTexture.change for reasoning why chRedisplay is good. |
| 34 |
change: chRedisplay |
| 35 |
SFInt32 [] size 128 |
| 36 |
range: (0,Inf) |
| 37 |
change: chTextureRendererProperties |
| 38 |
SFNode [] light NULL |
| 39 |
range: X3DPunctualLightNode |
| 40 |
change: chGeneratedTextureUpdateNeeded |
| 41 |
weak-link |
| 42 |
doc: @deprecated This field is only used internally by the engine now. You should never specify any light source here. The light source associated with the shadow map is implicit: it is the parent node of this GeneratedShadowMap node, that defined this GeneratedShadowMap node in defaultShadowMap field. |
| 43 |
SFFloat [in,out] scale DefaultScale |
| 44 |
range: [0,Inf) |
| 45 |
change: chGeneratedTextureUpdateNeeded |
| 46 |
SFFloat [in,out] bias DefaultBias |
| 47 |
range: [0,Inf) |
| 48 |
change: chGeneratedTextureUpdateNeeded |
| 49 |
SFString [] compareMode "COMPARE_R_LEQUAL" |
| 50 |
range: ["COMPARE_R_LEQUAL"|"COMPARE_R_GEQUAL"|"NONE"] |
| 51 |
enumerated-type: TShadowMapCompareMode CompareModeNames smCompareRLEqual |
| 52 |
change: chTextureRendererProperties |
| 53 |
doc: @deprecated This is ignored now. It was unportable and complicated to maintain. |
| 54 |
} |
| 55 |
|
| 56 |
Text3D : Text { |
| 57 |
SFFloat [in,out] depth 0.1 |
| 58 |
range: >= 0 |
| 59 |
change: chGeometry |
| 60 |
} |
| 61 |
|
| 62 |
KambiInline : Inline { |
| 63 |
MFString [in,out] replaceNames [] |
| 64 |
change: chEverything |
| 65 |
MFNode [in,out] replaceNodes [] |
| 66 |
range: X3DNode |
| 67 |
change: chEverything |
| 68 |
} |
| 69 |
|
| 70 |
KambiNavigationInfo : NavigationInfo { |
| 71 |
} |
| 72 |
|
| 73 |
Teapot : X3DGeometryNode { |
| 74 |
SFVec3f [] size 3 3 3 |
| 75 |
SFBool [] solid TRUE |
| 76 |
SFBool [] manifold FALSE |
| 77 |
SFNode [in,out] texCoord NULL |
| 78 |
range: TextureCoordinateGenerator, ProjectedTextureCoordinate, MultiGeneratedTextureCoordinate |
| 79 |
} |
| 80 |
|
| 81 |
RenderedTexture : X3DSingleTextureNode { |
| 82 |
SFNode [in,out] background NULL |
| 83 |
range: X3DBackgroundNode |
| 84 |
change: chGeneratedTextureUpdateNeeded |
| 85 |
SFNode [in,out] fog NULL |
| 86 |
range: Fog |
| 87 |
change: chGeneratedTextureUpdateNeeded |
| 88 |
SFNode [in,out] environment NULL |
| 89 |
range: Environment |
| 90 |
change: chGeneratedTextureUpdateNeeded |
| 91 |
SFNode [in,out] scene NULL |
| 92 |
range: X3DNode |
| 93 |
change: chGeneratedTextureUpdateNeeded |
| 94 |
MFInt32 [in,out] dimensions [DefaultRenderedTextureWidth, DefaultRenderedTextureHeight, 4, 1, 1] |
| 95 |
change: chTextureRendererProperties |
| 96 |
SFString [in,out] update "NONE" |
| 97 |
range: ["NONE"|"NEXT_FRAME_ONLY"|"ALWAYS"] |
| 98 |
enumerated-type: TTextureUpdate TextureUpdateNames upNone |
| 99 |
doc: When to update the texture contents. |
| 100 |
# See GeneratedCubeMapTexture.change for reasoning why chRedisplay is good. |
| 101 |
change: chRedisplay |
| 102 |
# note that we allow even VRML 1.0 cameras by TAbstractViewpointNode |
| 103 |
SFNode [in,out] viewpoint NULL |
| 104 |
range: X3DViewpointNode, ViewpointMirror |
| 105 |
change: chGeneratedTextureUpdateNeeded |
| 106 |
SFNode [] textureProperties NULL |
| 107 |
range: TextureProperties |
| 108 |
change: chTextureRendererProperties |
| 109 |
SFBool [] repeatS TRUE |
| 110 |
change: chTextureRendererProperties |
| 111 |
SFBool [] repeatT TRUE |
| 112 |
change: chTextureRendererProperties |
| 113 |
SFBool [] repeatR TRUE |
| 114 |
change: chTextureRendererProperties |
| 115 |
MFBool [in,out] depthMap [] |
| 116 |
change: chTextureRendererProperties |
| 117 |
MFInt32 [in,out] zOffset [] |
| 118 |
change: chTextureRendererProperties |
| 119 |
MFNode [in,out] targets [] |
| 120 |
range: X3DTextureNode |
| 121 |
change: chTextureRendererProperties |
| 122 |
SFMatrix4f [out] viewing |
| 123 |
SFMatrix4f [out] projection |
| 124 |
SFString [in,out] frameBufferMode "AUTO" |
| 125 |
change: chTextureRendererProperties |
| 126 |
MFNode [] excludeNodes [] |
| 127 |
change: chGeneratedTextureUpdateNeeded |
| 128 |
range: X3DNode |
| 129 |
SFString [] triggerName "Render" |
| 130 |
change: chNone |
| 131 |
SFImage [out] image_changed |
| 132 |
SFBool [out] rendering |
| 133 |
} |
| 134 |
|
| 135 |
Logger : X3DChildNode { |
| 136 |
SFInt32 [in,out] level 1 |
| 137 |
SFString [] logFile "" |
| 138 |
SFBool [in,out] enabled TRUE |
| 139 |
XFAny [in] write |
| 140 |
} |
| 141 |
|
| 142 |
# MultiGeneratedTextureCoordinate : X3DTextureCoordinateNode { |
| 143 |
# # |
| 144 |
# MFNode [in,out] texCoord NULL |
| 145 |
# range: TextureCoordinateGenerator, ProjectedTextureCoordinate |
| 146 |
# } |
| 147 |
# |
| 148 |
# Implementation detail: instead of being a new class |
| 149 |
# derived from abstract X3DTextureCoordinateNode, |
| 150 |
# MultiGeneratedTextureCoordinate now descends from MultiTextureCoordinate. |
| 151 |
# See TMultiGeneratedTextureCoordinateNode comments for reasons. |
| 152 |
MultiGeneratedTextureCoordinate : MultiTextureCoordinate { |
| 153 |
} |
| 154 |
|
| 155 |
ProjectedTextureCoordinate : X3DSingleTextureCoordinateNode { |
| 156 |
SFNode [in,out] projector NULL |
| 157 |
range: SpotLight, DirectionalLight, X3DViewpointNode, TSpotLightNode_1, TDirectionalLightNode_1 |
| 158 |
change: chTextureCoordinate |
| 159 |
doc: Viewpoint or light that determine how is the texture projected. |
| 160 |
} |
| 161 |
|
| 162 |
# See https://castle-engine.io/x3d_extensions_screen_effects.php |
| 163 |
ScreenEffect : X3DChildNode { |
| 164 |
SFBool [in,out] enabled TRUE |
| 165 |
change: chScreenEffectEnabled |
| 166 |
SFBool [in,out] needsDepth FALSE |
| 167 |
change: chRedisplay |
| 168 |
MFNode [in,out] shaders [] |
| 169 |
range: X3DShaderNode |
| 170 |
change: chEverything |
| 171 |
} |
| 172 |
|
| 173 |
# See https://castle-engine.io/compositing_shaders.php |
| 174 |
Effect : X3DChildNode { |
| 175 |
|
| 176 |
SFString [] language "" |
| 177 |
range: ["CG"|"GLSL"|"HLSL"|...] |
| 178 |
enumerated-type: TShaderLanguage ShaderLanguageNames slDefault |
| 179 |
change: chEverything |
| 180 |
doc: Shading language. Only the GLSL (OpenGL Shading Language) is actually supported. The default value, empty string, is equivalent to GLSL. |
| 181 |
SFBool [in,out] enabled TRUE |
| 182 |
change: chVisibleNonGeometry |
| 183 |
MFNode [] parts [] |
| 184 |
range: EffectPart |
| 185 |
change: chEverything |
| 186 |
SFString [] uniformMissing "WARNING" |
| 187 |
range: ["WARNING", "IGNORE"] |
| 188 |
enumerated-type: TUniformMissing UniformMissingNames umWarning |
| 189 |
change: chEverything |
| 190 |
doc: Should we report a missing uniform value. Setting this to umWarning (default) is useful to spot simple mistakes in naming uniforms. On the other hand, OpenGL aggressively removes unused uniforms from code, and it may cause spurious messages that some uniform is missing -- even though the shader is correct, is just doesn't use some uniform value e.g. because no lights are present on the current scene. |
| 191 |
} |
| 192 |
|
| 193 |
# See https://castle-engine.io/compositing_shaders.php |
| 194 |
EffectPart : X3DNode, X3DUrlObject { |
| 195 |
default-container-field: parts |
| 196 |
|
| 197 |
MFString [in,out] url [] |
| 198 |
change: chEverything |
| 199 |
SFString [] type "VERTEX" |
| 200 |
range: ["VERTEX"|"FRAGMENT"] |
| 201 |
enumerated-type: TShaderType ShaderTypeNameX3D stVertex |
| 202 |
change: chEverything |
| 203 |
} |
| 204 |
|
| 205 |
# See https://castle-engine.io/compositing_shaders.php |
| 206 |
ShaderTexture : X3DSingleTextureNode { |
| 207 |
SFString [] defaultTexCoord "BOUNDS2D" |
| 208 |
#range: ["BOUNDS2D"|"BOUNDS3D"] |
| 209 |
change: chEverything |
| 210 |
# TODO: use enumerated-type:.... |
| 211 |
} |
| 212 |
|
| 213 |
# See https://castle-engine.io/x3d_extensions.php#section_ext_blending |
| 214 |
BlendMode { |
| 215 |
default-container-field: blendMode |
| 216 |
SFString [in,out] srcFactor "src_alpha" |
| 217 |
range: ["zero", ..., "one_minus_constant_alpha"] |
| 218 |
enumerated-type: TBlendingSourceFactor BlendingSourceFactorNames bsSrcAlpha |
| 219 |
SFString [in,out] destFactor "one_minus_src_alpha" |
| 220 |
range: ["zero", ..., "one_minus_constant_alpha"] |
| 221 |
enumerated-type: TBlendingDestinationFactor BlendingDestinationFactorNames bdOneMinusSrcAlpha |
| 222 |
SFColor [in,out] color 1 1 1 |
| 223 |
SFFloat [in,out] colorTransparency 0 |
| 224 |
} |
| 225 |
|
| 226 |
ViewpointMirror { |
| 227 |
default-container-field: viewpoint |
| 228 |
SFFloat [in,out] distanceFromShape 0.01 |
| 229 |
} |
| 230 |
|
| 231 |
OrientationInterpolator2D : X3DInterpolatorNode { |
| 232 |
MFFloat [in,out] keyValue [] |
| 233 |
change: chNone |
| 234 |
SFVec3f [in,out] axis 0 0 1 |
| 235 |
SFRotation [out] value_changed |
| 236 |
} |