Halloween Costume ideas 2015

CYCLES / Object Info Node


I was casually reading some blog postings from other Blender artists/developers, when I stumbled into this interesting post by Oscurart:
http://oscurart.blogspot.com.au/2012/12/script-generador-id-color-mask.html

That blog post is in Spanish, but thanks to Google Translate, I can understand that he is showing a way to quickly randomize object Color using ColorRamp node in Cycles.

He provided a simple Python script that basically automatically create ColorRamp node in the Node Editor and assigning 30 random different color into ColorRamp constant. Check it on his blog post above.

What even more interesting is looking at his diagram where he plugs in a node called Object Info node into the Factor (Fac) slot and it does the job of giving "random" color for every object assigned with that one material.
This is node network that is shown by Oscurart , what is that OBJECT INFO node?
NOTE: You see, I have not looked into all the new nodes in Cycles recently. I did see Blender video on Particle Info node. I supposed that one also very cool in relation to Particle. I am still waiting for Particle Node system in Blender to execute before getting deep. But I supposed all these are worth looking, today.


OBJECT INFO NODE, SINCE WHEN?
Object Info node is apparently has been there since version 2.64. I pointed to this cool video tutorial by David Miller and he is also mentioning "Object Info" node as an update method in getting material color to randomize:
https://vimeo.com/40389198

Documentation and examples is scarce, but there are probably some posts talking about this "Object Info" node:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Object_Info


Anyways, from Oscurart blog post, looks like he is using it as Color ID Generator for Compositing purpose. For us, we can actually use this for some fancy renders.


THE NODE NETWORK FOR OBJECT INFO NODE
From Oscurart example, we see the node network is really simple. The main useful nodes here are:
  • Object Info node (under Input)
  • ColorRamp node (under Convertor)
This is like dejavu all over again when I first wrote my posts on Particles and how we can randomize object colors by using a Group of bunch of objects. Except that we are doing this inside the Node Editor and directly on the material. Another procedural method you can do within Blender.

OBJECT INFO: RANDOM + LINEAR RAMP



OBJECT INFO: RANDOM + RAMP WITH MORE THAN TWO COLORS



OBJECT INFO: LOCATION + NOISE



OBJECT INFO:LOCATION + IMAGE TEXTURE
Out of curiosity, I inserted Image Texture node as the source of color, with the Factor coming from Object Info: Location

Apparently it works too! Very neat. You can probably create LED grid animation easily this way. All we need to take care is really the Location of each of those objects in the scene, this will be considered as the UV location to remap the color, I am guessing. It probably needs some proper Math node configuration to make sure that the Location value is between 0 to 1 (normalized), kind of what UV usually like. If object moves, the color will slide away. That is kind of the limitation of this, it is object space dependent. There must a work around it.


(The artwork above is an avatar of my friend that was created handmade by orphanage kids in Indonesia. Very neat looking avatar, don't you think?)

Now, I need to research regarding how to Normalize properly.

Looks like I am doing it wrong. Giving random color based on Color Pixel of Image Texture seems to work, but below "normalize" method is probably wrong.



The funny thing is if I change the SCALE it seems to kind of work. But I want a better solution.



Anyone knows how to do this more correctly? Please let me know.

PLUG IT INTO CELL FRACTURED OBJECT = INSTANT RANDOMIZED COLOR

Hope this one is useful for your works.

I will look around for Object Info related information at the forum, maybe I could find more and I will append more information here.

UPDATE 2012.12.24

Found this:
http://blenderartists.org/forum/showthread.php?216866-Cycles-tests-the-new-blender-CPU-GPU-renderer-of-awesomeness/page185

By Sanne:


I tested  the network above and use multiple Texture, multiple UV on the 5 objects. What would be even nicer is to find out a way to Randomize a bunch of Textures and UVs into a single Material network.


Then I found this blog post:

By Andreu Cabre:
http://www.andreucabre.com/2012/02/multiple-uvs-and-decals-in-cycles.html

Definitely worth a study there.

CONCLUSION
Blender Cycles and its node network are getting really quite interesting and advanced, I have to keep up!

Before I am digging too far, basically for now, happy to find out that we can easily:

  • Randomize Material Color using Object Info Node and ColorRamp
  • Apply Material Color based on File Texture.

Post a Comment

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget