castle-engine/castle-model-viewer

TextureProjector and TextureProjectorParallel are allowed as root nodes in scene

Closed this issue · 2 comments

TextureProjector and TextureProjectorParallel are allowed as root nodes in a scene, since they are similar to Light nodes.

Example model

tovrmlx3d.exe validation output:

C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/X3dSpecifications//TextureProjectorComponentExample.x3d processing with X3dToX3dvClassicVrmlEncoding stylesheet
ClassicVRML validation: tovrmlx3d.exe X3dSpecifications//TextureProjectorComponentExample.x3dv --validate --enable-downloads
tovrmlx3d: Warning: VRML/X3D: Unknown node of type "TextureProjector" (named "")
tovrmlx3d: Warning: VRML/X3D: Node "TextureProjector" is not allowed at the top level of the X3D file
tovrmlx3d: Warning: VRML/X3D: Unknown node of type "TextureProjectorParallel" (named "")
tovrmlx3d: Warning: VRML/X3D: Node "TextureProjectorParallel" is not allowed at the top level of the X3D file

Thanks, fixed! The texture projection nodes (from X3D standard) were just not implemented in CGE.

They are defined now -- which means that reading / writing / validation of them will work OK.

Note that they are still not yet functional, i.e. they do not affect the rendering output. In CGE we instead use non-standard node ProjectedTextureCoordinate for texture projection ( https://castle-engine.io/x3d_extensions_shadow_maps.php#section_texture_projective ). It works differently, as we talked on x3d-public some time ago. ProjectedTextureCoordinate is a texture coordinate, so it can be used for more cases (e.g. also for shadow maps texture projection), it also can be projected from light source or viewpoint. OTOH, ProjectedTextureCoordinate is not a light, it doesn't make scene brighter, it needs to be combined with a desired texture to actually achieve an effect.

Likely we will implement in CGE/view3dscene X3D standard projection texturing nodes at some point. Both approaches (X3D standard, and our ProjectedTextureCoordinate) make sense.

P.S. As usual, the new version will be available as "view3dscene snapshot" from https://castle-engine.io/view3dscene.php soon. You can watch when castle-engine/castle-engine@snapshot...master will no longer show the commit "Define X3D standard texture projection nodes", it meas that commit is now included in the snapshot.