Author Topic: Different material spinner value per object at render time?  (Read 1002 times)

2022-02-28, 08:49:05

DPS

  • Active Users
  • **
  • Posts: 110
    • View Profile
I'm currently using material IDs and object IDs for various things in my scene.

I'd like to change the ''spread' value (and some others) within several cellular maps contained in a procedural shader. Ideally I can tell various objects in my scene specific values to use for these maps at render time.

It would reduce some convoluted usage of multimaps which are proving a pain to tweak.
Specs: AMD 1950X, Aorus Gaming 7 x399, 64GB RAM, 1080ti. Win10, Max 2017, Corona 1.7.3

2022-02-28, 11:05:38
Reply #1

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 7919
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Maybe you could utilize object's user properties for that, but i don't know how exactly to feed that information to slate's controllers.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2022-02-28, 12:20:39
Reply #2

DPS

  • Active Users
  • **
  • Posts: 110
    • View Profile
I figured out how to get the Object Properties to pass a value to a CoronaUserProperty node, I can plug that into refraction for example and control that. Any ideas how to pipe this into a spinner that doesn't accept a map input?
Specs: AMD 1950X, Aorus Gaming 7 x399, 64GB RAM, 1080ti. Win10, Max 2017, Corona 1.7.3

2022-02-28, 14:33:05
Reply #3

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 7919
  • Let's move this topic, shall we?
    • View Profile
    • My Models
You can't use CoronaUserProperty, because it's a map and you need a controller. If user properties are accessible through maxscript, then it's probably possible to use slate's float script controller to feed them to where you need, but you need to know maxscript for that.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2022-02-28, 16:18:06
Reply #4

clemens_at

  • Active Users
  • **
  • Posts: 108
    • View Profile
try this:

Code: [Select]
myObjs = #($Box001,$Box002) -- add objects with "," seperation here
getObjCMaps = for i in myObjs collect getClassInstances Cellular target:i

for cMap in getObjCMaps do
(
cMap.size = 1.0 --change size value here
cMap.spread = 0.5 --change spread value here
)

2022-03-01, 09:22:33
Reply #5

DPS

  • Active Users
  • **
  • Posts: 110
    • View Profile
Would there be a way to have the script say

cMap.spread = userproperty "spread"

and then in my object user properties for Object01 I have spread=0.5, and in Object02 I have spread=0.2 etc?
Specs: AMD 1950X, Aorus Gaming 7 x399, 64GB RAM, 1080ti. Win10, Max 2017, Corona 1.7.3

2022-03-01, 09:59:25
Reply #6

clemens_at

  • Active Users
  • **
  • Posts: 108
    • View Profile
tell me again what you need exactly.
you want to be able to control different values of different cellular maps all at once inside the Slate Material Editor right?

2022-03-01, 11:44:39
Reply #7

DPS

  • Active Users
  • **
  • Posts: 110
    • View Profile
Hi Clemens

I am working on a building and each floor level uses a different mix of concrete/aggregate. Ground floor uses the most aggregate and from floor 7 onwards there is no aggregate.

To achieve this I have made a procedural shader with multiple cellular maps and splat maps piped into diffuse, gloss, bump etc

I can change the illusion of the amount of aggregate in the concrete by changing the spread in the cellular map and also the threshold in the splat map.

Currently I have 7 shaders. But if I could avoid the duplications of maps that would be ideal. 

I haven’t added any material break up or dirt yet either.

I hoped I could enter specific values in the object properties and feed that to the relevant spinners.
Specs: AMD 1950X, Aorus Gaming 7 x399, 64GB RAM, 1080ti. Win10, Max 2017, Corona 1.7.3

2022-03-01, 13:55:25
Reply #8

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 7919
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Just a small workaround - instead of 7 separate materials, you could use single material and only split the maps that are unique per object. If it's only cellular map that is unique, then make 7 cellular maps and plug them through Corona multi-map. That way, most of the material will be easily controlable from single place. It's not the same as the way that you're trying achieve, but still better than managing 7 different materials.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2022-03-02, 08:45:15
Reply #9

DPS

  • Active Users
  • **
  • Posts: 110
    • View Profile
I would have done that but the objects that have the aggregate material may also have an interior wall shader, or soffit shader applied to different polygons.

I have a standard set of IDs that my modeler applies and the range for the aggregate starts at ID 80 and I can’t be bothered to redo the IDs within my scene. If Corona multi maps allowed you to specify that the range doesn’t start at 0 (like Vray) then I would have used that.
Specs: AMD 1950X, Aorus Gaming 7 x399, 64GB RAM, 1080ti. Win10, Max 2017, Corona 1.7.3