johann.nadalutti Posted April 10, 2024 Posted April 10, 2024 Hi, I created many referenced nodes from an ObjectMeshStatic, and the mesh use a surface material that need to changed UV from node ID. In visual graph I change UV position with "InstanceID" and "Function" nodes. This works, but sometimes the UVs change when we change the position of the object or camera. Thanks for your help.
arizmenda Posted April 11, 2024 Posted April 11, 2024 Hi, Johann. Can you, please, provide us your mesh with textures and surface material in .upackage for a research? You can do it by clicking on mesh with RMB -> Export As Package and attach the package file to your reply. How often does this behavior occur? Does it happen every single time you moving the nodes and camera, or just randomly? Thanks!
johann.nadalutti Posted April 11, 2024 Author Posted April 11, 2024 Hi, unigine_project01.zip This is my test project. Thanks ! 1
arizmenda Posted April 11, 2024 Posted April 11, 2024 Thank you for your samples and quick response! We are now going to examine the code and material. We will reply as soon as we'll got some information about the case.
arizmenda Posted April 12, 2024 Posted April 12, 2024 Hi, Johann! Your method doesn't work due to Instance ID node grants a non-deterministic result, nothing can be done with it. If it's for static nodes, you can attach it to the world position. But if it's for dynamic nodes, you'll either have to generate signs from the code or just manually prepare nodes with numbers as usual. Thank you!
johann.nadalutti Posted April 12, 2024 Author Posted April 12, 2024 Hi, It's for dynamic nodes, how to do this in c# code ? Thanks you !
arizmenda Posted April 15, 2024 Posted April 15, 2024 Hi, Johann! Thank you for waiting! Your code suppose to randomly generate car license plates with different textures by setting a random seed value for the material parameter of specific surfaces. Basically, you need to write a randomizer, that defines seed. The rest is done by material. It should put dynamic UV mapping to the surface depends on world coordinates. You should also consider working on your mesh to avoid positioning problems. We can provide you piece of mgraph a bit later. Thanks!
johann.nadalutti Posted April 15, 2024 Author Posted April 15, 2024 Hi, that work now ! I generate UV from a global counter from a CS script. I need to duplicate material from the script too. Thanks ! LicPlateUVGenerator.csbox_mesh_base.mgraph 1
arizmenda Posted April 17, 2024 Posted April 17, 2024 Hi, Johann! That's good to hear! As promised, here's a mesh, texture and material: car_numbers.upackage You can use it as example, but overall, your solution is quite elegant! Again, thank you for waiting. 1
Recommended Posts