Topic: Access Shader properties of Map Material on Runtime

Hi Alex.
I found another challenge for me (hope not for you smile ).
I want to add some nice effects in runtime to the map, like dissolve, vertex displacements, hologram, etc...
My difficult is the map does not have a standard material property and Playmaker can`t access the instanced material of the map.

I am using Amplify Shader with your PBR Bridge script and all works very well if you set up before hitting play, but if I change the material in play mode nothing happens.

Any idea of how to get the map working with a runtime configurable shader?

Thanks

Re: Access Shader properties of Map Material on Runtime

Hello.

Tileset Control creates a hidden Mesh Renderer component in play mode, and you can get / set materials.

https://i.ibb.co/svzbh07/img1.png

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Access Shader properties of Map Material on Runtime

Hi Alex.

I can get the material, but I can`t change it on the map after the map was created.
If I use the exact same material and Playmaker setup in a cube, for example, I can change it in runtime.

Maybe a need an extra step to the map update the new material information?

Thanks

Re: Access Shader properties of Map Material on Runtime

Please show how you do it, and I will give advice on how to fix it.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Access Shader properties of Map Material on Runtime

I recorded a video.


https://drive.google.com/file/d/1OHgVae … sp=sharing

Re: Access Shader properties of Map Material on Runtime

You change only the first material (which is most likely outside the view), and the map uses a lot of materials (one for each tile).
Actually, this is the reason why the Mesh Renderer is hidden.
Generating a large number of previews can greatly slow down the inspector, and at high settings, it can cause inspector crashes.
The amount of material depends on your settings.
Video:
https://www.dropbox.com/s/3e0oryha73m0f … 6.mp4?dl=0
GetCountMaterials action attached.

Post's attachments

Attachment icon GetCountMaterials.cs 927 b, 84 downloads since 2020-06-23 

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Access Shader properties of Map Material on Runtime

Thanks again, Alex.
Now all works.