question

Richard Blumenstein avatar image
Richard Blumenstein asked ·

Texture Randomly via element

I am looking to color elements without having to renumber them individually. I have tried different approaches to no success. The place that has gotten me the closest is https://answers.arnoldrenderer.com/questions/4677/drive-aiswitch-index-via-objectid.html, but I still cannot find a way to break things down into elements. I know that there is multitexture and mutliid but that is too slow on a tree and uses too much memory. Any suggestions would be greatly appreciated.

rendertextureedit texture
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Mads Drøschler avatar image
Mads Drøschler answered ·

https://i.imgur.com/vwGXe2J.jpg

https://i.imgur.com/t6Do4vd.jpg

https://i.imgur.com/bBDyupV.jpg


2020 file.

https://we.tl/t-X9q8HWXhz6

Just swap out the bitmap and have a play.

You can add in additional tools that provoke certain tendencies in the scattering effect, Bias a particular map % over others, filter things in and out. All kinds of things.

The Control map can be extended to control all practical settings one would typically sit and play with, across whole network, its practical and speeds production up significantly pulling settings to a UI.

2 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Thanks @Mads Drøschler

I am sorry that I took so long to respond, The first answer is good but only if you have 3 or less variations. Anything more than that and it will go out of the range of the variation images. The second solution that you gave is really great, but it seams to break more easily. I copied the solution to the library and put it on another object and it breaks. I guess I don't use OSL that much. Do you have any good resources for OSL? Also I really appreciate your responses, do you have a place to buy you coffee?

https://www.dropbox.com/s/nhgh0vq7k5njq5b/color%20test.max?dl=0

0 Likes 0 · ·

Try look here.

I created a small custom OSL shader node. The "Steps" value is what you want to increase to expand the range of items that gets picked up by the random generator.

Think of Obj_gain_max as an integer slot instead of float. just handle nice simple entries like 0,1,2,3 and so forth. You need to manual that part out so it matches with the number of entries you want to pick up.

So if you want 5 bitmaps in the mix, change this "Steps" value to 5.

0 Likes 0 · ·
ss.jpg (84.8 KiB)
Mads Drøschler avatar image
Mads Drøschler answered ·

I made a video some time ago, going over it.
You can check it out here:
https://www.youtube.com/watch?v=dP2MAYwA3JY

Made a couple of Material ID's make a color data channel with DCM, catch it with the shader, and use it to drive pr element random generator.

If you have some issues setting it up, let me know, and I will produce a small generic scene with some Forest pack type grass patch we will add element ID to and control random diffuse textures on each straw, as an example.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.