What is the best way to have multiple textures on a tcastlescene? (ie my terrain indexed triangle sets). I see MultiTexture node? But not any examples that use it. It doesn’t look like this is how you handle the multiple textures used in tcastleterrain. I want to have the grid texture be able to combine with whatever the terrain texture ends up being.
If you want to see (possibly mix) multiple textures when displaying the single pixel from a single triangle on the screen, then multi-texturing is the solution. Here by multi-texturing I mean the “capability to pass multiple textures to a single shader on GPU”.
However, it doesn’t mean using necessarily the X3D TMultiTextureNode. The TMultiTextureNode exposes some ways to combine the textures (and it’s not without flaws, I described them on X3D MultiTexturing problems | Castle Game Engine ; I described the proposed future here).
But it’s much more flexible to just create your own GLSL shaders,. using our TEffectNode (see Shader Effects (Compositing Shaders) | Castle Game Engine for links to CGE examples). Pass multiple textures as “uniforms” to this shader, and in the shader combine the textures (like grass, rock, snow) using any algorithm you want (e.g. you can look at height, at steepness, and/or you can use another texture called “splatmap” that contains the weights for other textures).
You can take a look how CastleTerrain unit sets up TEffectNode, the related shader code in terrain.fs.