Sorry for the delayed response…I’ve actually been wrapping my head around the best way to showcase how to do this.
The main difference between what you’re seeing in Unreal, vs NME is the tiling node. That tiling node allows you to essentially break up a larger space into smaller chunks of space. Since we don’t have that node, we have to get pretty creative in NME to achieve the same type of thing.
Check out this Node Material: Babylon.js Node Material Editor
The light blue frame that you see is an operation I pulled together to do exactly that. It takes UV space and breaks it apart into smaller chunks.
There are two main inputs to consider:
- The Gridsize float is how many sections you want UV space to be divided into.
- The x,yPositions Vector 2 is the row/column coordinate location for each smaller chunk of space. position 0,0 is the top left chunk of space, and position 3,3 is the bottom right chunk of space.
Where this gets a bit more advanced, is when you consider that you’ll need one of these frames for EACH chunk of space. In the default case I have gridsize set to 4…which creates a 4x4 grid of smaller spaces…that’s a total of 16. So in this case you’ll want 16 individual small chunks of space, each needing their own frame…so 16 total frames.
As you can imagine, this can get pretty wild pretty fast. Can you imagine if your gridsize was set to 1024? Yikes! You definitely wouldn’t want to create that many frames by hand.
So there are two tricks to consider here…Custom Frames (to reuse a subgraph of frames), and creating node materials in code, so you can loop through the creation of node trees the number of times you need.
Luckily, we actually have 2 videos that talk in depth about both of these topics:
Custom Frames: https://youtu.be/_bxAQM0pnzs
Node Materials Through Code: https://youtu.be/GrmVObi6caQ
Once you have one of these frames for each separate smaller chunk, you could then multiple each region by random values in the code to create a random color for each chunk.
I know that’s a lot to digest. I’m actually going to use this as a use case in an upcoming demo.
I hope this is helpful!