Author Topic: Map / Material Select handled by User property  (Read 2317 times)

2022-11-24, 18:44:44

LKEdesign

  • Active Users
  • **
  • Posts: 100
  • I'm addicted to Corona Render and I need NO cure.
    • View Profile
    • LKE Design Web-site
It would be SO useful if you could handle more things by User Property   - one of the top items on my list is the switch between maps or materials using Corona Map Select  or Corona Materials Select , but it could also be fx. Corona Mix Map, or maybe even Multimap.
All the best,
LKE Design
See my work at: http://www.lkedesign.dk/en/portfolio_en.html

2022-11-25, 12:50:59
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12711
  • Marcin
    • View Profile
So you would like to have a single Corona Select Map with multiple maps connected to it and distribute those maps depending on the user property assigned to specific scene object?
For example an object with "brick" user property would get a brick texture, an object with "wood" property would get a wood texture, etc.

Is that right?

If so, I think you can already achieve something similar, for example, with the Object GBuffer ID.
Set different GBuffer IDs for different objects. Then assign different maps through Corona MultiMap in the Object GBuffer ID mode.

It would be more tricky with materials though.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-11-25, 13:28:30
Reply #2

LKEdesign

  • Active Users
  • **
  • Posts: 100
  • I'm addicted to Corona Render and I need NO cure.
    • View Profile
    • LKE Design Web-site
hmmm  well, I want just to be able to select any of the index numbers in a select map/material  - so I have the freedom to switch between any of the material setups beneath that. Could be anything really
All the best,
LKE Design
See my work at: http://www.lkedesign.dk/en/portfolio_en.html

2022-11-25, 13:42:25
Reply #3

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12711
  • Marcin
    • View Profile
So having a user property with value "2" would select material with index number 2?
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-11-25, 14:01:32
Reply #4

LKEdesign

  • Active Users
  • **
  • Posts: 100
  • I'm addicted to Corona Render and I need NO cure.
    • View Profile
    • LKE Design Web-site
For instance, yes - I think it would give so much flexibility in scenes and less complicated material setups
All the best,
LKE Design
See my work at: http://www.lkedesign.dk/en/portfolio_en.html

2022-11-25, 17:30:31
Reply #5

pokoy

  • Active Users
  • **
  • Posts: 1850
    • View Profile
Yes, I was looking for such an option recently and the Select Map/Mat would really be a good candidate for this. Also for CoronaMultimap.

2022-12-13, 13:53:37
Reply #6

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12711
  • Marcin
    • View Profile
I would like to get some additional information on this if possible. I wanted to report it for our devs to review, but I am missing some solid arguments.

I created a dummy scene with two objects.
Object 1 has a user property "material = WOOD"
Object 2 has a user property "material = STONE"

The idea is to use the Corona Select Map/Material or Corona MultiMap in combination with the user properties to decide which object gets which material.

Is this what you would like to have, or am I missing the point?

You mentioned "so useful", "freedom to switch", and "so much flexibility", but this is not enough for me to create a convincing use case.

In my example, you could as well:
- just apply material 1 to object 1 and material 2 to object 2
- use multimap with material ID or object gbuffer ID mode to decide which object get what material properties

Please note that I am not saying that this does not make sense! I am sure it does, but I need to understand better in what specific cases it would be useful, so that I can pass this information to our devs.

For example: is this useful for rendering multiple variants of a specific object? (e.g. multiple renders of a table made of different materials)

Thanks in advance!
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-12-15, 00:54:40
Reply #7

LKEdesign

  • Active Users
  • **
  • Posts: 100
  • I'm addicted to Corona Render and I need NO cure.
    • View Profile
    • LKE Design Web-site
Hej Marcin,

I will get back to you ASAP. I have a deadline to take care of first though.

Cheers
All the best,
LKE Design
See my work at: http://www.lkedesign.dk/en/portfolio_en.html

2022-12-16, 09:44:08
Reply #8

LKEdesign

  • Active Users
  • **
  • Posts: 100
  • I'm addicted to Corona Render and I need NO cure.
    • View Profile
    • LKE Design Web-site
I get your point, about just applying the actual material to the object. BUT it's all about flexibility and encapsulation.

IF poosible my 3D assets has only one MultisubMaterial applied. That makes things easy to manage. One of the submaterials can then be a switable material, maybe containing multiple options, which would be cool to be able to reach and switch from the object itself  - encapsulation and flexibility.

Often I make lamps with light materials instead of Coronalights. So to be able to switch the lamp On and OFF, I switch between a map in a SelectMap that is attached as a mask to a layered material that wraps a light material over fx. a lightbulbs glass. Using the UserProperty map, it makes the switching ON and OFF on instances of the same lamp without having to go into the material editor and switch a material.

So being able to switch materials on an instances without the need to go into a potential comnplicated shader tree and swap materials is for me a good reason to add this functionality.

Timeride use the User property to switch between facade colors  - cool. I just think that being able to switch between either maps or materials in the scene, without going into the shader tree, could be so useful.

Maybe it should actually be an integrated part in the SelectMap / SelectMaterial shaders.

In general I would like some changes to the SelectMaps / SelectMaterial.
It would be cool if it in the UI worked more than the MultiSubMaterial.
With this i mean, that you can see either the assigned material name or a designated label.

That would make the selection much easier.

I hope I have made my reasons more clear now. :)
All the best,
LKE Design
See my work at: http://www.lkedesign.dk/en/portfolio_en.html

2022-12-16, 18:23:58
Reply #9

arqing

  • Active Users
  • **
  • Posts: 10
    • View Profile
You can do that with just a Controller.
I do it all the time for my HDRs or everything that has a SelectMap or SelectMaterial. With a single click I move from one to another.



If the images doesnt load.. check this link:
https://drive.google.com/file/d/11qnEFmcsClEC8Be2Yy5EcKWlWQB_yktU/view?usp=share_link


2023-01-02, 17:00:37
Reply #10

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12711
  • Marcin
    • View Profile
I am not convinced yet, sorry. It would be still too challenging for me to explain why it is needed.
How is right-clicking on an object > selecting properties from the quad menu > going to user-defined > changing some value by typing text more convenient than just opening the material editor?
How is having a single multi/sub material applied to multiple objects making things easier to manage than having different materials applied to multiple objects?
Lamp on/off example - this sounds like a perfect case for the Select Map / Material. I also did it like this in the past (you can even plug a Corona Color into the Select Map - black vs white). You can also already do it with User Property. For example, the same User Property could be switched between 0 and 1 to make the lamp emit light or not.

In general I would like some changes to the SelectMaps / SelectMaterial.
It would be cool if it in the UI worked more than the MultiSubMaterial.
With this i mean, that you can see either the assigned material name or a designated label.
I don't get this part. Can you explain what changes you mean specifically?



Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2023-01-18, 13:49:53
Reply #11

Tanner

  • Active Users
  • **
  • Posts: 64
    • View Profile
You can do that with just a Controller.
I do it all the time for my HDRs or everything that has a SelectMap or SelectMaterial. With a single click I move from one to another.



If the images doesnt load.. check this link:
https://drive.google.com/file/d/11qnEFmcsClEC8Be2Yy5EcKWlWQB_yktU/view?usp=share_link

I use the controllers all of the time when I want one selection to influence another. This is a particularly useful, native tool that works when you have a material set up and you change the scale of say the diffuse map, the scale will also affect all the pertaining gloss, normal, height, etc. maps too. But yes, you can have linear/bezier float controllers control most options in Corona material/map nodes.

2023-01-19, 13:13:04
Reply #12

LKEdesign

  • Active Users
  • **
  • Posts: 100
  • I'm addicted to Corona Render and I need NO cure.
    • View Profile
    • LKE Design Web-site
Guys, you miss the best part  - the flexibility in the scene of being able to use the same material hierarki  and being able to switch instances on / off or give a color value or something.

Example: 
A lamp with a bulb using lightmaterial / glass material in a selectmaterial  - each instance can be switched on and off, without going to the material editior and have two material versions - with the toential risk of having redundancy errors.

- or a monitor where you have 10 different content maps, where you can switch the content per monitor instance  - without having to go to the Material Editor. ( and yes, I know you could just amke a multisub with the individual screen content as a material  - but then again, you have to have redundant materials. )

These are just a few examples.

The red thread in this is to simplify hierkies and workflows  - and by making the Userproperty more versatile - (and not only on Select XX ) I believe you could have an easier life :)
All the best,
LKE Design
See my work at: http://www.lkedesign.dk/en/portfolio_en.html

2023-01-19, 17:25:52
Reply #13

Tanner

  • Active Users
  • **
  • Posts: 64
    • View Profile
Example: 
A lamp with a bulb using lightmaterial / glass material in a selectmaterial  - each instance can be switched on and off, without going to the material editor and have two material versions - with the toential risk of having redundancy errors.

In fact I used to do this with controllers linked to a parameter I could turn off and on elsewhere in the scene (like the O.G. Light Lister tool that got discontinued - I'd turn the opacity map off and it would switch to a glass material instead of a black light mat). But instead of using a SelectMTL, you defer to nested (or not) Blend materials. You can link most features with bezier/linear float controllers and assign custom attributes to the objects in the scene. Most people just don't know about it because they have no interest in it.

The other one I've used in the past is selecting which HDRI is used in the scene at any given time by linking the SelectMap SELECTED controller to a generic light object that doesn't actually render. But changing the intensity value to 0.0, 1.0, 2.0, 3.0, etc. would change which sky is visible.

- or a monitor where you have 10 different content maps, where you can switch the content per monitor instance  - without having to go to the Material Editor. ( and yes, I know you could just amke a multisub with the individual screen content as a material  - but then again, you have to have redundant materials. )

You could do this with one material, but plug the screen texture into a multimap and set the randomization to Object GBuffer ID. Then, when you duplicate your monitors (even as instances), you can assign each one a different ID under the properties window to control which image appears on the monitor. No need to for 10 materials, just 10 bitmaps plugged into 1 multimap into 1 material.

I think there is still a bit of background setting up in order to use this User Property much like linking controllers throughout a scene, but I like where your head it at. +1
« Last Edit: 2023-01-19, 17:31:40 by Tanner »

2023-01-26, 10:24:49
Reply #14

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12711
  • Marcin
    • View Profile
So far nobody answered my questions from https://forum.corona-renderer.com/index.php?topic=38534.msg207848#msg207848 :)

Guys, you miss the best part  - the flexibility in the scene of being able to use the same material hierarki  and being able to switch instances on / off or give a color value or something.
Again, these are just some vague terms like "flexibility". What flexibility? In what exact case? How is the new idea more flexible than the old one?
"give a color value or something" - that's not a very convincing argument :)

Quote
A lamp with a bulb using lightmaterial / glass material in a selectmaterial  - each instance can be switched on and off, without going to the material editior and have two material versions - with the toential risk of having redundancy errors.
Again: "How is right-clicking on an object > selecting properties from the quad menu > going to user-defined > changing some value by typing text more convenient than just opening the material editor?"
(as I asked in https://forum.corona-renderer.com/index.php?topic=38534.msg207848#msg207848)
The other solutions posted by Tanner seem completely fine to me.

Quote
- or a monitor where you have 10 different content maps, where you can switch the content per monitor instance  - without having to go to the Material Editor. ( and yes, I know you could just amke a multisub with the individual screen content as a material  - but then again, you have to have redundant materials. )
Once again, this was already mentioned at least twice, by me and Tanner: you can use one material with Corona Multimap in Object GBuffer ID mode for this. You only need 1 material in this case. You do not need to set up more materials. You only need to load multiple bitmaps into a Multimap, that's all.

Quote
The red thread in this is to simplify hierkies and workflows  - and by making the Userproperty more versatile - (and not only on Select XX ) I believe you could have an easier life :)
And once again: how is using user property instead of other available tools such as multimap or select map more flexible/versatile? How exactly does it make one's life easier?

Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us