Texture Instancing Compound

Plugins linking to this thread: (hide)

Texture instancing Shader V1.5Author: Reinhard Claus
Updated April 2013 with the ability to fetch the texture offset from an ICE attribute. Previous update added texturable scale X/Y.

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

The shader requires an ICE particle cloud as a texture placing source which has to have its material shared with the object. It has features such as: Modify texture base scaling and rotation, various lookup options for fractal-like patterns, random position offset in texture, rotation by ICE particle vector attribute, random rotation, orient towards a vector or a tangent map. Mental ray only. See the si-community thread for some interesting looking renders created by Rob Chapman.

Mad props to Paul Smith aka pooby for inventing this wonderful method. If you haven't already, check his videos page for loads of ICE inspiration. Btw Paul's first video introducing the method is here. Btw #2: Since, he's created two videos demonstrating this shader: Texture Instancing Shader and Lizard texinstancing.

local backup: Texture Instancing.1.5.xsirtcompound

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Texture Instancing Compound

Post by rray » 03 Jul 2012, 23:59

Thanks for posting Rob, interesting patterns! Very alien :ymalien:
softimage resources section updated Jan 5th 2024

User avatar
druitre
Posts: 471
Joined: 25 Jun 2009, 23:35

Re: Texture Instancing Compound

Post by druitre » 31 Jul 2012, 18:23

rray wrote:How to control the texture's scale with another ICE attribute:

Image
Hi Ray, can you explain a bit more about how you're doing this? I don't get anything useful out of it - just uniform color. Actually, what I'm looking for is a way to have particle size drive texture size directly. But an explanation of how to get any of the particle's attributes into the rendertree would be equally sweet.

thanks, Jasper

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Texture Instancing Compound

Post by rray » 31 Jul 2012, 18:36

Hi!
point_cloud_lookup does only see vector attributes, you'll have to convert the size (which is a scalar) into a custom vector atttribute, or "abuse" the scale attribute like is done here:
ti-settings.png
In that case you'll have to use the ICE tree to set for example the scale Y value to size, then extract the Y in the render tree.

"In" always has to be PointPosition
"Out" is the attribute you want to output by the node
softimage resources section updated Jan 5th 2024

User avatar
druitre
Posts: 471
Joined: 25 Jun 2009, 23:35

Re: Texture Instancing Compound

Post by druitre » 31 Jul 2012, 19:22

Thanks for the quick response!

Still no go, though. Followed your picture and when that didn't work tried the custom vector attribute (named it 'texsize', see picture). It still looks like no data is actually received - is it possible to 'show value' in rendertree like in ICEtree?
ScreenShot015.jpg
(BTW, I also did some variations, without succes. Can you explain what the vector_state/intersection point node is doing? Is it necessary?)

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Texture Instancing Compound

Post by rray » 31 Jul 2012, 19:56

Sorry, I forgot to pick a point cloud in the PPG screenshot I just posted -- that could well be the issue here.

The other thing that's important is that bth the object and the PPG share the same mat. In case it's still not working I'll post a scene here tomorrow.

Intersection point ist the coordinate of the rendered point--- this tells the point_cloud_lookup node where to start looking for nearby points. It could find that out by itself, but exposing it to the users adds some additional control.
softimage resources section updated Jan 5th 2024

User avatar
druitre
Posts: 471
Joined: 25 Jun 2009, 23:35

Re: Texture Instancing Compound

Post by druitre » 01 Aug 2012, 11:39

Nope, the 'variations' I mentioned in my previous post definitely included picking the pointcloud and trying out all combinations of vector state, attributes, map lookup settings etc. Looks like I'm gonna be asking you for that example scene :)

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Texture Instancing Compound

Post by rray » 01 Aug 2012, 13:20

In that case, here's it. Writes random values to the scale attribute in ICE, reads it back in the render tree.
Attachments
DemoProjectTextureInstancing3.zip
(344.62 KiB) Downloaded 500 times
softimage resources section updated Jan 5th 2024

User avatar
druitre
Posts: 471
Joined: 25 Jun 2009, 23:35

Re: Texture Instancing Compound

Post by druitre » 01 Aug 2012, 14:10

Aah, I got it: it was down to the max points/max distance in the map lookup settings. Weird, I thought I had that covered in yesterday's variations.

Thanks for the example!

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Texture Instancing Compound

Post by rray » 01 Aug 2012, 15:14

Hey great. "1" for max points outputs 1 attribute per texture/point. Setting it to more than 1 averages the attribute values. Can lead to some interesting effects sometimes.
softimage resources section updated Jan 5th 2024

User avatar
druitre
Posts: 471
Joined: 25 Jun 2009, 23:35

Re: Texture Instancing Compound

Post by druitre » 06 Aug 2012, 20:21

Hi Ray, me again! Solved one issue, stumbled onto the next :)

How does one go about using this technique on an enveloped mesh? I managed to figure out some ways to control pointscale and texturescale and combined with flow along curves this gives me a good starting point for creating skin/scales/pores etc on animals/humans. But, if I animate my character, the texture does not stay locked on the deforming mesh.

For pointposition, I can only get that locked by setting emissiontype to 'point', disabling 'time varying' and deleting 'relax particles'. Which also means I lose an even/relaxed distribution. If I leave 'relax particles' in place, it looks like it is evaluating the relax-parameters after the deform, not before it. Even though the ICEtree is in the modelingstack?

Scale on the other hand, when I randomize that by adding a turbulize around value, looks like it is using global coordinates - the randomization stays in place with the mesh moving through it.

Everything I've been trying so far hasn't taken me any closer to a solution. I figure it must be possible though. Mapping to UV coordinates? Or setting up a (non-deforming) copy of the mesh and using that as input in a second tree?

Ofcourse, I could rendermap the texture to a UV at first frame, but it would be way cooler to keep the whole thing live.

Any suggestions welcome!

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Texture Instancing Compound

Post by rray » 06 Aug 2012, 23:47

There are some approaches that might do it like freezing the PC, then sticking the particles to the mesh, or maybe enveloping the point cloud so it deforms along with the body. You'd have to link the rotation lookup parameter to the particle rotation somehow in either case. TBH I think out of lazyness I would go with rendermapping for that one (Sound unadventurous I know x_x )
softimage resources section updated Jan 5th 2024

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: Texture Instancing Compound

Post by Pooby » 02 Jan 2013, 15:51

I had a proper go with this shader, and I have to say, its brilliant. Thanks for making it.
I've been fiddling around with it all morning doing trees and all sorts with ease. If I had one request it would be to be able to control the parameters of each sample with a weight map. so, say you were doing a tree, you could make the texture finer and less intense on small branches, but you can kind of do that now by mixing 2 shaders.
I did a video overview of the use of it.



Edited by gustavoeb: use vim tag :smile:

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Texture Instancing Compound

Post by rray » 03 Jan 2013, 00:37

Chuffed to see! Keep up your tutorials too they are great.
Pooby wrote:If I had one request it would be to be able to control the parameters of each sample with a weight map. so, say you were doing a tree, you could make the texture finer and less intense on small branches
The shader is completely build out of factory nodes, to use a weightmap to control some parts of it like the texture scale or offset, you can edit the compound and expose these parameters for texturing. But for blending two textures the only option is probably using 2 shaders like you did.

This scene shows how to use another ice parameter on the point cloud that is controling the scale: DemoProjectTextureInstancing3.zip.
softimage resources section updated Jan 5th 2024

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Texture Instancing Compound

Post by rray » 04 Jan 2013, 21:33

Updated ..... This new version can break up the cell borders.

Btw, for rendermapping is there an aliasing setting somewhere like in the render options ?
or is the supersampling the only option to increase quality?

Download is on first page

Image
softimage resources section updated Jan 5th 2024

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: Texture Instancing Compound

Post by Pooby » 04 Jan 2013, 23:01

Great thanks. I look forward to trying that out. I find it amazing how the borders don't notice much, as in this example showing the scaling by weightmap, that I didnt intially think was possible, but is...
https://vimeo.com/56762083
But having a way of blurring them borders will be even better.

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: Texture Instancing Compound

Post by rray » 04 Jan 2013, 23:33

Oh that worked really well.
I didn't think it would because I was texturing the scale of the cell shader a while ago, and that produced weird smearing along the gradients. Never tried it with the texture instance shader for that reason.
softimage resources section updated Jan 5th 2024

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests