Page 2 of 3

Re: Texture Instancing Compound

Posted: 01 Aug 2012, 13:20
by rray
In that case, here's it. Writes random values to the scale attribute in ICE, reads it back in the render tree.

Re: Texture Instancing Compound

Posted: 01 Aug 2012, 14:10
by druitre
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!

Re: Texture Instancing Compound

Posted: 01 Aug 2012, 15:14
by rray
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.

Re: Texture Instancing Compound

Posted: 06 Aug 2012, 20:21
by druitre
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!

Re: Texture Instancing Compound

Posted: 06 Aug 2012, 23:47
by rray
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 )

Re: Texture Instancing Compound

Posted: 02 Jan 2013, 15:51
by Pooby
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:

Re: Texture Instancing Compound

Posted: 03 Jan 2013, 00:37
by rray
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.

Re: Texture Instancing Compound

Posted: 04 Jan 2013, 21:33
by rray
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

Re: Texture Instancing Compound

Posted: 04 Jan 2013, 23:01
by Pooby
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.

Re: Texture Instancing Compound

Posted: 04 Jan 2013, 23:33
by rray
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.

Re: Texture Instancing Compound

Posted: 07 Jan 2013, 13:29
by rray
Updated .. V1.4 allows separate X and Y scaling, also added a few comments in the compound so it's easier to get into the inner workings


(an earlier 1.3 update had X & Y scaling too, but had some problems with shearing effects when rotating stretched textures)

Re: Texture Instancing Compound

Posted: 22 Jan 2013, 19:00
by kykeon
Hi there,
first of all, what a nice tool we have there! Many thanks to Reinhard Claus.

My question is about using the texture's alpha to avoid "square" overlapping. I would like to make a snake skin, and the look has to be very regular obviously...

Does anyone achieve to use the alpha, or did I miss something somewhere?

Many thanks!

Re: Texture Instancing Compound

Posted: 22 Jan 2013, 19:32
by rray
Hi & you're welcome!
I realize this would be cool, am afraid though that's not possible because of limitations that the "point cloud lookup" node has which is used inside the compound. Problem with that is that it can only look up attributes like "position" from one particle at a time. Actually it does multiple but this results in a mash up of attributes which makes it impossible to extract the position of multiple particles.
Maybe there's some other way to do that which I've not discovered yet.

Re: Texture Instancing Compound

Posted: 22 Jan 2013, 22:21
by kykeon
Thank you.
I realize it will not feet my needs for making a snake skin, even with the abilty of using the alpha. Too bad, because it was theoricaly a good way to avoid streching of the scales when part of the body inflate... As you said, I can't find a way to get the direction for overlapping properly one scale after another. As we can see here:
Image

Also I realize there is probably no way to get the color attribute to change colors of the scales to create this kind of pattern
Image
for example.

I will probably do it with a "feather" particle system or may be by textures dependings of the look the director is looking for.
Any ways, I will definitly use it in a way or another for another purpose, the bark Paul Smith did for exemple or may be his gravel simulation.

Many thanks! Cheers.

Re: Texture Instancing Compound

Posted: 30 Apr 2013, 02:20
by rray
kykeon I hope you'll find a good use. Cheers!

There's an update (first post of this thread/rray.de) . V1.5 adds Paul's idea, the ability to read the texture offset from an ICE attribute (similar to what is done with the rotation). Previous method didn't work well with animation. Be warned not tested much yet %-(

Re: Texture Instancing Compound

Posted: 30 Apr 2013, 22:15
by Pooby
https://vimeo.com/65171697

thanks for the update