esr_esr
January 19, 2022, 3:03pm
#1
Hi all ,
The objects in the example scene are using one pixel map texture which is 512x512 px divided into 4 pequal parts.
What I’m trying to do is , i would like to change entities colors.For example changing one entity color to yellow.Simple isnt it:)?
So in order to achive this , my first guess is changing uvs of meshInstance accoording to textures pixels.But I dont find a proper solution.
Note: I dont want to change materials offset and tiling because it produces different materials.I want want material for batching actually.
Note2 :In Blender , i can do this with uv unwrapping.
Scene : https://playcanvas.com/editor/scene/1315038
Suggestions appreciated.Thanks
This sounds like a good option to me. Create 4 meshes with different UV coordinates, and those will batch together fine.
yaustar
January 19, 2022, 3:33pm
#3
There are some private material parameters that can be used (and maybe subject to change in the future) to change the offset and tiling on per meshinstance basis.
The second link in that post could a be a possibility here.
esr_esr
January 19, 2022, 3:38pm
#4
Thank you Yaustar i’ll look at these
but those stop meshes from batching, same as different materials
esr_esr
January 19, 2022, 3:42pm
#6
So it’s not actually different thing than creating different mats ok got it
yaustar
January 19, 2022, 3:49pm
#7
Oh do they? I didn’t realise that