It is currently 25 May 2013, 12:02

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Texture Instancing Compound
PostPosted: 20 Jun 2012, 02:01 
Offline
Moderator
User avatar

Joined: 26 Sep 2009, 15:51
Posts: 779
Location: Bonn, Germany
Texture Instancing Shader

Image

Mad props to Paul Smith aka pooby for inventing this wonderful method. If you haven't already, check his vimeo videos page for loads of ICE inspiration. Btw Paul's first video introducing the method is here: http://vimeo.com/33908339

Since, he's added 2 videos demonstrating this shader: https://vimeo.com/56627504 and https://vimeo.com/56762083. Cheers!


How it works

Basic function of this shader is to stamp an instance of the selected texture at each particle location on the shaded object.

Usage

Shader setup is really simple. Basically you only need a point cloud and an object that share the same material.

For a quick test do the following: Create a new scene, create polymesh sphere, create point cloud sphere, plug "Texture Instancing" into Scene_Material's surface port. Open the shader's PPG, pick the point cloud, then the noicon.pic texture, render.

Now all texture instances are oriented upwards. This is because of the chosen rotation method ("Custom Vector" at 0,1,0). You can enter a different orientation vector here, or use a tangent property. Another option is to have each particle have a texture orientation vector of its own, which has to be created as a point cloud attribute using ICE (See example scene posted below).

Usually for heavily randomized texture instances (like pebbles, sand etc.), using custom vector or tangents will be enough. For "flow" type setups with ICE, the third option has to be used.

To show different bits of the same texture, as Paul did in the first video, you'll have to scale up the texture quite a bit, and use random position offsets. If you see uniformly colored parts appear, try the "wrap" option.

Some notes to sum this up:

(*) Only for mental ray, but with rendermapping the result will be usable in other renderers too.
(*) Make sure the point cloud has a shared material as the textured object (Same material is not enough)
(*) ICE attribute vectors get projected on the surface, and used as the Y up axis for the stamped texture. Ideally the vector attribute would be parallel to textured surface, otherwise there'll be a little distortion (which is true for the other methods, custom vector and tangents, as well)

I hope it works for you! report bugs and crashes and post pretty pictures as usual ))


(Updates)
V1.2 has an option to add roughness to the cell borders/blend them + added commentary inside the compound
V1.3 has Scale X and Scale Y exposed separately and also has closest particle position exposed as an output.
V1.4 bug fix. shearing occured when using different X and Y scales and rotation. Now Tex Size and Offsets are in SI Units, so your values might need to be a little different.
V1.4 bug fix. Didn't work with SI 2012 (which has an older Edit UV node)
V1.5 ability to read offset from an ICE attribute, PPG UI a bit reorganized


Attachments:
Texture Instancing.1.5.xsirtcompound [74.1 KiB]
Downloaded 17 times
File comment: Fixed a missing connection
DemoProjectTextureInstancing_2012.zip [315.29 KiB]
Downloaded 101 times

_________________
Image rray.de, a resource site for softimage, updated apr 13th


Last edited by rray on 22 Jun 2012, 15:16, edited 4 times in total.
Top
 Profile  
 
 Post subject: Re: Texture Instancing Compound
PostPosted: 21 Jun 2012, 02:04 
Offline
Moderator
User avatar

Joined: 26 Sep 2009, 15:51
Posts: 779
Location: Bonn, Germany
Some experiments using the settings on the lookup tab:

Image

first one is the "smear" preset, second one has settings 25 0,316 1,32 for both lookup properties

_________________
Image rray.de, a resource site for softimage, updated apr 13th


Top
 Profile  
 
 Post subject: Re: Texture Instancing Compound
PostPosted: 21 Jun 2012, 03:38 
Offline

Joined: 08 Jul 2009, 05:16
Posts: 89
interesting! reminds me of the modo tool that came out recently in 601, 'texture replicators'?


Top
 Profile  
 
 Post subject: Re: Texture Instancing Compound
PostPosted: 21 Jun 2012, 09:44 
Offline

Joined: 27 Aug 2010, 22:25
Posts: 145
Wow. Thanks for this. I can't wait to test it out when I get to a workstation.
Having it as a shader makes so much sense.

Thanks too for the compliments


Top
 Profile  
 
 Post subject: Re: Texture Instancing Compound
PostPosted: 21 Jun 2012, 16:05 
Offline
Moderator
User avatar

Joined: 26 Sep 2009, 15:51
Posts: 779
Location: Bonn, Germany
Thank you both for your feedback.

Yes the modo feature looks similar. Would like to have added blending between the instances as an option, but it looks like it isn't possible. I think with high particle counts things could also become blurry with the blending.

_________________
Image rray.de, a resource site for softimage, updated apr 13th


Top
 Profile  
 
 Post subject: Re: Texture Instancing Compound
PostPosted: 22 Jun 2012, 17:43 
Offline

Joined: 27 Aug 2010, 22:25
Posts: 145
Its a shame it wont work with Arnold. I'm useless with Mental ray.


Top
 Profile  
 
 Post subject: Re: Texture Instancing Compound
PostPosted: 23 Jun 2012, 01:31 
Offline
Moderator
User avatar

Joined: 26 Sep 2009, 15:51
Posts: 779
Location: Bonn, Germany
Couldn't test on Arnold but I was afraid that might be so because of the Point_cloud_lookup node I used.
This one exports the whole cloud to mental ray for the closest points lookup. I think they may have used the same (super fast) code they use for the ICE lookups, which is probably not available to Solidangle.
Once Arnold should support such lookups though, I'll do my best to help rewiring this compound for Arnold.
Until then maybe it's good for rendermapping... then again that's exactly what pixelparticles does with your setup... hm...

_________________
Image rray.de, a resource site for softimage, updated apr 13th


Top
 Profile  
 
 Post subject: Re: Texture Instancing Compound
PostPosted: 24 Jun 2012, 22:07 
Offline
Moderator
User avatar

Joined: 26 Sep 2009, 15:51
Posts: 779
Location: Bonn, Germany
How to control the texture's scale with another ICE attribute:

Image

_________________
Image rray.de, a resource site for softimage, updated apr 13th


Top
 Profile  
 
 Post subject: Re: Texture Instancing Compound
PostPosted: 25 Jun 2012, 11:17 
Offline
User avatar

Joined: 09 Aug 2010, 15:17
Posts: 52
Location: Sweden
This looks sweet! Thanks for sharing. :)

_________________
----------------------------------------
http://vimeo.com/mikaelpettersen


Top
 Profile  
 
 Post subject: Re: Texture Instancing Compound
PostPosted: 01 Jul 2012, 03:42 
Offline
User avatar

Joined: 09 Jun 2009, 14:49
Posts: 364
Location: Brussels, Belgium / London, UK
this is seriously cool for generating a lot of variety and detail!

Image

Image

Image

Image

Image

Image

Image

_________________
Gossip is what no one claims to like, but everybody enjoys.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group