Debian Codegraph @

tools/internal/x3d-nodes-to-pascal/nodes-specification/Shape.txt

raw
1 X3DAppearanceChildNode : X3DNode {
2 }
3
4 X3DAppearanceNode : X3DNode {
5 }
6
7 X3DMaterialNode : X3DAppearanceChildNode {
8 # This is not actually specified anywhere (X3D XML encoding spec
9 # doesn't specify containerField for abstract X3DXxxNode classes)
10 # but it seems most sensible to have all X3DMaterialNode with containerField=material.
11 default-container-field: material
12 }
13
14 X3DOneSidedMaterialNode : X3DMaterialNode {
15 default-container-field: material
16
17 SFColor [in,out] emissiveColor 0 0 0
18 range: [0, 1]
19 doc: Emissive color, multiplied by the @link(EmissiveTexture), makes the shape brighter regardless of the surrounding lights. Usually used to make things glow.
20 SFNode [in,out] emissiveTexture NULL
21 range: X3DSingleTextureNode
22 change: chEverything
23 doc: Emissive texture is multiplied by the @link(EmissiveColor). It allows the perceived emissive factor depend on a texture, and thus vary across the surface.
24 SFString [in,out] emissiveTextureMapping ""
25 doc: Determines texture coordinates used by @link(EmissiveTexture).
26
27 SFNode [in,out] normalTexture NULL
28 range: X3DTexture2DNode
29 change: chEverything
30 doc: Normalmap texture to perform bump mapping. See https://castle-engine.io/bump_mapping .
31 SFString [in,out] normalTextureMapping ""
32 doc: Determines texture coordinates used by @link(NormalTexture).
33 SFFloat [in,out] normalScale 1
34 range: [0,Inf)
35 change: chEverything
36 doc: Emphasize (when > 1) or deemphasize (< 1) the effect of @link(NormalTexture) on the model.
37 }
38
39 X3DShapeNode : X3DChildNode, X3DBoundedObject {
40 # In X3D specificaction, appearance can be [X3DAppearanceNode].
41 # But X3DAppearanceNode type is not useful, as the only possible descendant of it is Appearance,
42 # so we change the type to allow Appearance.
43 # This makes accessing it easier, like "Shape.Appearance.Texture := xxx".
44 SFNode [in,out] appearance NULL
45 range: Appearance
46 setter-before: SetAppearanceBefore
47 SFNode [in,out] geometry NULL
48 range: X3DGeometryNode
49 # As Castle Game Engine extension, we allow bboxCenter/Size to be modified,
50 # i.e. they are [in,out] not only [].
51 SFVec3f [in,out] bboxCenter 0 0 0
52 range: (-Inf,Inf)
53 # Note that bboxCenter documentation string it used for generated "BBox: TBox3D" property.
54 doc: """
55 You can provide a manually-calculated bounding box of the shape here, for optimization purposes. Leave this field as empty (TBox3D.Empty) to let the engine calculate best bounding box automatically.
56
57 Manually providing the bounding box makes sense if you can do it more efficiently than the engine. E.g. if the shape vertexes are animated, then the engine would have to recalcualate the perfect bounding box every frame. It is more efficient to calculate a bounding box of all possible animation frames, and store it here.
58
59 The glTF skinned animation automatically fills this field for the affected shapes.
60
61 @italic(Note: This property is not useful if you want to know the bounding box of a shape, calculated by the engine). This property only allows to override the automatic engine calculation.
62
63 To read the calculated bounding box, load the nodes to TCastleScene. You can then use @link(TCastleTransform.BoundingBox Scene.BoundingBox), @link(TCastleTransform.LocalBoundingBox Scene.LocalBoundingBox), @link(TCastleTransform.WorldBoundingBox Scene.WorldBoundingBox) to know bounding box of the scene. To get bounding box of a particular shape, enumerate @link(TCastleSceneCore.Shapes) to find the correct shape (using any criteria you want -- note that the same TShapeNode may be reused multiple times), and then read @link(TShape.BoundingBox), @link(TShape.LocalBoundingBox).
64 """
65
66 SFVec3f [in,out] bboxSize -1 -1 -1
67 range: [0,Inf) or -1 -1 -1
68
69 # CASTLE GAME ENGINE EXTENSIONS:
70 SFString [in,out] shading "DEFAULT"
71 range: ["DEFAULT"|"GOURAUD"|"PHONG"|"WIREFRAME"]
72 enumerated-type: TShading ShadingNames shDefault
73 doc: How to display given shape.
74 SFBool [in,out] visible TRUE
75 doc: """
76 Is the shape visible. Shapes that are not visible are not rendered, but otherwise are still processed (for example, hidden shapes are still used for collision detection). Toggling this is guaranteed to be ultra-fast.
77
78 Note: An alternative method to hide (and more) things in X3D is to wrap them in a @link(TSwitchNode), and toggle @link(TSwitchNode.WhichChoice) between -1 and 0. When @link(TSwitchNode.WhichChoice) is -1, the children are not processed (not rendered, and do not collide).
79 """
80 SFString [] collision "DEFAULT"
81 range: ["DEFAULT"|"BOX"|"NONE"]
82 enumerated-type: TShapeCollision ShapeCollisionNames scDefault
83 doc: How does the given shape collide. This only matters if @link(TCastleSceneCore.PreciseCollisions) is @true, otherwise the whole scene (with all shapes) collides as one big bounding box.
84 }
85
86 Appearance : X3DAppearanceNode {
87 # Note: In edition 2 of X3D XML encoding, the default-container-field of this is empty...
88 # but in earlier versions, this was "appearance" and this seems more sensible,
89 # Appearance node may only occur within Shape.appearance field.
90
91 default-container-field: appearance
92 SFNode [in,out] fillProperties NULL
93 range: FillProperties
94 not-slim
95 SFNode [in,out] lineProperties NULL
96 range: LineProperties
97 doc: Properties how to display line geometry (line width and such).
98 SFNode [in,out] material NULL
99 range: X3DMaterialNode
100 change: chEverything
101 doc: Material determines how the shape looks, and how it interacts with lighting.
102 setter-before: MoveShapeAssociations
103 MFNode [in,out] shaders []
104 range: X3DShaderNode
105 change: chEverything
106 doc: Override shaders used for rendering this shape. Instead of this, it is usually better to use @link(SetEffects) -- the effects set that way are easier, cooperate with CGE built-in rendering features, and one code is more portable to both mobile and desktop.
107 SFNode [in,out] texture NULL
108 range: X3DTextureNode
109 change: chEverything
110 doc: Main texture used by this appearance (diffuse texture for Phong lighting model, base texture for physical lighting model, emissive texture for the unlit lighting model). @deprecated It is more flexible to set the relevant texture inside material node, like @link(TMaterialNode.DiffuseTexture), @link(TPhysicalMaterialNode.BaseTexture), @link(TAbstractOneSidedMaterialNode.EmissiveTexture TUnlitMaterialNode.EmissiveTexture).
111 SFNode [in,out] textureTransform NULL
112 range: X3DTextureTransformNode
113 change: chEverything
114 doc: Texture transformation.
115
116 # X3D 4
117 SFNode [in,out] backMaterial NULL
118 range: X3DOneSidedMaterialNode
119 change: chNone
120 doc: Alternative material to use for back faces (@italic(not implemented)).
121 SFString [in,out] alphaMode "AUTO"
122 range: ["AUTO"|"OPAQUE"|"MASK"|"BLEND"]
123 enumerated-type: TAlphaMode AlphaModeToString amAuto
124 SFFloat [in,out] alphaCutoff 0.5
125 range: [0,1]
126
127 # CASTLE GAME ENGINE EXTENSIONS:
128 MFNode [] receiveShadows []
129 range: X3DPunctualLightNode
130 change: chShadowMaps
131 SFBool [in,out] shadowCaster TRUE
132 change: chShadowCasters
133 SFNode [in,out] normalMap NULL
134 range: X3DTexture2DNode
135 change: chEverything
136 doc: Normal map of this appearance. See https://castle-engine.io/x3d_implementation_texturing_extensions.php#section_ext_bump_mapping . @deprecated It is better to set normal map within the material node, using the @link(TAbstractOneSidedMaterialNode.NormalTexture).
137 SFNode [in,out] heightMap NULL
138 range: X3DTexture2DNode
139 not-slim
140 doc: Height map of this appearance. See https://castle-engine.io/x3d_implementation_texturing_extensions.php#section_ext_bump_mapping . @deprecated
141 SFFloat [in,out] heightMapScale 0.01
142 SFNode [in,out] blendMode NULL
143 range: BlendMode
144 change: chEverything
145 doc: Determines the exact blending equation used, in case @link(AlphaMode) indicates blending. See https://castle-engine.io/x3d_extensions.php#section_ext_blending .
146 MFNode [] effects []
147 range: Effect
148 change: chEverything
149 doc: Additional shader code for rendering this shape. See https://castle-engine.io/compositing_shaders.php . The shader effects they are easy to use, cooperate with CGE built-in rendering features, and one code is more portable to both mobile and desktop.
150 SFString [in,out] alphaChannel "AUTO"
151 range: ["AUTO"|"NONE"|"TEST"|"BLENDING"]
152 enumerated-type: TAutoAlphaChannel AlphaToString acAuto
153 }
154
155 FillProperties : X3DAppearanceChildNode {
156 default-container-field: fillProperties
157 SFBool [in,out] filled TRUE
158 SFColor [in,out] hatchColor 1 1 1
159 range: [0,1]
160 SFBool [in,out] hatched TRUE
161 SFInt32 [in,out] hatchStyle 1
162 range: [0,Inf)
163 }
164
165 LineProperties : X3DAppearanceChildNode {
166 default-container-field: lineProperties
167 SFBool [in,out] applied TRUE
168 SFInt32 [in,out] linetype 1
169 range: [1,Inf)
170 SFFloat [in,out] linewidthScaleFactor 0
171 range: (-Inf,Inf)
172 }
173
174 Material : X3DOneSidedMaterialNode {
175 default-container-field: material
176 SFFloat [in,out] ambientIntensity 0.2
177 range: [0,1]
178 SFNode [in,out] ambientTexture NULL
179 range: X3DSingleTextureNode
180 change: chEverything
181 SFString [in,out] ambientTextureMapping ""
182
183 SFColor [in,out] diffuseColor 0.8 0.8 0.8
184 range: [0,1]
185 doc: The primary way to control the color of object with Phong material. The object reflects light sources depending on the angle of the surface with respect to the light source. The more directly the surface faces the light, the more diffuse light reflects.
186 SFNode [in,out] diffuseTexture NULL
187 range: X3DSingleTextureNode
188 change: chEverything
189 doc: The primary texture to control the color of object with Phong material. The RGB channel of this texture is multiplied with @link(DiffuseColor), and alpha channel is multiplied with the opacity (1-@link(Transparency)).
190 SFString [in,out] diffuseTextureMapping ""
191
192 SFFloat [in,out] occlusionStrength 1
193 range: [0,1]
194 SFNode [in,out] occlusionTexture NULL
195 range: X3DSingleTextureNode
196 change: chEverything
197 SFString [in,out] occlusionTextureMapping ""
198
199 SFFloat [in,out] shininess 0.2
200 range: [0,1]
201 SFNode [in,out] shininessTexture NULL
202 range: X3DSingleTextureNode
203 change: chEverything
204 SFString [in,out] shininessTextureMapping ""
205
206 SFColor [in,out] specularColor 0 0 0
207 range: [0,1]
208 doc: Color of specular highlight, on shiny objects.
209 SFNode [in,out] specularTexture NULL
210 range: X3DSingleTextureNode
211 change: chEverything
212 SFString [in,out] specularTextureMapping ""
213
214 SFFloat [in,out] transparency 0
215 range: [0,1]
216 doc: Setting @name to value > 0 makes the object partially-transparent. Setting it to 1.0 makes it even invisible (but still collidable). If you want to render the object using blending (which is usually the case for partially-transparent) it is recommended to specify it explicitly using @link(TAppearanceNode.AlphaMode).
217
218 # CASTLE GAME ENGINE EXTENSIONS:
219 SFBool [in,out] fogImmune FALSE
220 not-slim
221 SFFloat [in,out] mirror 0.0
222 range: [0.0; 1.0]
223 MFColor [in,out] reflSpecular []
224 not-slim
225 MFColor [in,out] reflDiffuse []
226 not-slim
227 MFColor [in,out] transSpecular []
228 not-slim
229 MFColor [in,out] transDiffuse []
230 not-slim
231 SFFloat [in,out] reflSpecularExp 1000000
232 not-slim
233 SFFloat [in,out] transSpecularExp 1000000
234 not-slim
235 }
236
237 PhysicalMaterial : X3DOneSidedMaterialNode {
238 default-container-field: material
239
240 SFColor [in,out] baseColor 1 1 1
241 range: [0,1]
242 doc: The primary way to control the color of object with physical (PBR) material.
243 SFNode [in,out] baseTexture NULL
244 range: X3DSingleTextureNode
245 change: chEverything
246 doc: The primary texture to control the color of object with physical (PBR) material. The RGB channel of this texture is multiplied with @link(BaseColor), and alpha channel is multiplied with the opacity (1-@link(Transparency)).
247 SFString [in,out] baseTextureMapping ""
248 doc: Determines texture coordinates used by @link(BaseTexture).
249
250 SFFloat [in,out] metallic 1
251 range: [0,1]
252 doc: The metalness of the material; values range from 0.0 (non-metal) to 1.0 (metal).
253 SFNode [in,out] metallicRoughnessTexture NULL
254 range: X3DSingleTextureNode
255 change: chEverything
256 doc: Control the @link(Metallic) and @link(Roughness) using a texture. The @italic(Blue) channel of this texture is multiplied with @link(Metallic). The @link(Green) channel is multiplied with @link(Roughness). The other channels are ignored.
257 SFString [in,out] metallicRoughnessTextureMapping ""
258 doc: Determines texture coordinates used by @link(MetallicRoughnessTexture).
259
260 SFFloat [in,out] occlusionStrength 1
261 range: [0,1]
262 SFNode [in,out] occlusionTexture NULL
263 range: X3DSingleTextureNode
264 change: chEverything
265 SFString [in,out] occlusionTextureMapping ""
266
267 SFFloat [in,out] roughness 1
268 range: [0,1]
269 doc: The roughness of the material; values range from 0.0 (smooth) to 1.0 (rough).
270
271 SFFloat [in,out] transparency 0
272 range: [0,1]
273 doc: Setting @name to value > 0 makes the object partially-transparent. Setting it to 1.0 makes it even invisible (but still collidable). If you want to render the object using blending (which is usually the case for partially-transparent) it is recommended to specify it explicitly using @link(TAppearanceNode.AlphaMode).
274 }
275
276 Shape : X3DShapeNode {
277 }
278
279 TwoSidedMaterial : X3DMaterialNode {
280 SFFloat [in,out] ambientIntensity 0.2
281 range: [0,1]
282 SFFloat [in,out] backAmbientIntensity 0.2
283 range: [0,1]
284 SFColor [in,out] backDiffuseColor 0.8 0.8 0.8
285 range: [0,1]
286 SFColor [in,out] backEmissiveColor 0 0 0
287 range: [0,1]
288 SFFloat [in,out] backShininess 0.2
289 range: [0,1]
290 SFColor [in,out] backSpecularColor 0 0 0
291 range: [0,1]
292 SFFloat [in,out] backTransparency 0
293 range: [0,1]
294 SFColor [in,out] diffuseColor 0.8 0.8 0.8
295 range: [0,1]!
296 SFColor [in,out] emissiveColor 0 0 0
297 range: [0,1]
298 SFFloat [in,out] shininess 0.2
299 range: [0,1]
300 SFBool [in,out] separateBackColor FALSE
301 SFColor [in,out] specularColor 0 0 0
302 range: [0,1]
303 SFFloat [in,out] transparency 0
304 range: [0,1]
305 }
306
307 UnlitMaterial : X3DOneSidedMaterialNode {
308 default-container-field: material
309
310 # Note: emissiveColor default also changes to 1 1 1
311
312 SFFloat [in,out] transparency 0
313 range: [0,1]
314 doc: Setting @name to value > 0 makes the object partially-transparent. Setting it to 1.0 makes it even invisible (but still collidable). If you want to render the object using blending (which is usually the case for partially-transparent) it is recommended to specify it explicitly using @link(TAppearanceNode.AlphaMode).
315 }