Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: MAY3D on 2023-06-16, 10:24:37

Title: Corona MultiMap Random & Defined Textures
Post by: MAY3D on 2023-06-16, 10:24:37
Hi All

I am working on an interior with tiled walls. I've used MultiMap to randomise 20 tile textures (all variations on the same stone) across a number of different Floorgen objects. However, my client has asked me to swap the texture on 6 specific tiles and I can't figure out how to do it without the other tiles changing as well. I'm randomising by Mesh Element & Instance, so I can't simply change Material IDs. Any suggestions?

TIA
Title: Re: Corona MultiMap Random & Defined Textures
Post by: aaouviz on 2023-06-16, 10:39:46
What I do in this situation is to add an edit poly on top of the floor gen in the modifier stack and detach those specific tiles. Then I apply a more specific material to those extracted objects.
Title: Re: Corona MultiMap Random & Defined Textures
Post by: MAY3D on 2023-06-16, 10:43:10
Thanks, I tried that, but then the randomisation of the other tiles changed. I think because it's set to Mesh Element & Instance, when you remove a part of the mesh, the randomisation is recalculated :(
Title: Re: Corona MultiMap Random & Defined Textures
Post by: James Vella on 2023-06-16, 11:41:56
Instead of Mesh Element why not use Material ID?

You can put a MaterialByElement modifier with Random Distribution for the floorgen object.
(https://i.ibb.co/QPMwkD4/random.png) (https://imgbb.com/)

Then when you use a PolySelect modifier you can select the tile and put a MaterialID modifier on that to control the ones you want.
(https://i.ibb.co/4sS7Nbs/stack.png) (https://ibb.co/GsM0PZs)

Edit:
Hmm I suppose thats just 'in hindsight', since you are already down the rabbit hole you could just create 2 scenes (or a duplicate object in the same scene), change those 6 tiles and then render it with a mask.

Title: Re: Corona MultiMap Random & Defined Textures
Post by: MAY3D on 2023-06-16, 11:49:46
Thanks, that would certainly have helped if I had started that way. Unfortunately, as the current texture assignment doesn't follow the IDs, when I switch to that the tile randomisation changes. I need everything to stay as is other than the 6 tiles the client has asked to swap. In hindsight the Mat ID approach would have been better from the start, but I didn't expect the client to be quite so specific.

Perhaps a future feature of MultiMap could be to "bake" mat IDs onto the geo based on how they've been allocated with mesh element/instance. To get this to do what I need, I've had to compare the textures to the previous render and then manually assign the IDs  so the layout doesn't change. At least now I have more control. A good learning experience, I suppose.
Title: Re: Corona MultiMap Random & Defined Textures
Post by: James Vella on 2023-06-16, 11:57:46
Yeah at this point the only thing I can think of is just duplicate the object, adjust and render with a mask. While a 'bake' would be an interesting idea I think the whole point of Mesh Element is exactly for that purpose, to give instant randomization as you extend/change the tile arrangement.

Edit:
Oh actually here's an idea. Not sure if it overcomplicates your setup but why not:

1. Use a Multisub as your main material
2. Plug in your current MultiMap into Material ID 1
3. Set the whole floorgen to Material ID 1
4. Polyselect the tile you want
5. Assign Material ID 2 (grey in the screenshot below)
6. Rince repeat for the other 5 tiles.

It just means you cannot change the floorgen later but should fix the issue for now and give you control over those 6 tiles to change them as the client needs (if they want more changes, which is probably lol).

(https://i.ibb.co/PM4nZ0Y/meshelem.png) (https://ibb.co/VxDZW5N)

(https://i.ibb.co/qM80GgJ/meshelem2.png) (https://ibb.co/xSbmvgF)
Title: Re: Corona MultiMap Random & Defined Textures
Post by: romullus on 2023-06-16, 14:14:40
On top of what's already been suggested by others, you could use Corona slicer to "cut" specific tiles and replace them with the tiles that has the texture that you need. I didn't test that, but i think slicer should not reset multi-map's randomization seed.
Title: Re: Corona MultiMap Random & Defined Textures
Post by: MAY3D on 2023-06-16, 14:42:24
Thank you, both interesting ideas. I had to do it all manually to get the render out, but I'll give these a go when I have some down time. Always good to have solutions like these to hand when things crop up in the future.