Stress Maps?

Is stress mapping still a thing in Blender? I can only find very minimal documentation concerning it at all and definitely nothing within the last couple of years.

If it’s not available, is there something similar? I’m looking in to a technique I saw someone use in LightWave that involved using how much the original geometry of a mesh is stretched or contracted from it’s original position to filter textures for facial skin wrinkles.

Essentially, if a certain group of vertices is stretched beyond what they were originally it would affect the transparency of a displacement map. Eyebrow bone raised = top of forehead contracted = displacement map of forehead wrinkles made more visible.

One of the few examples of uses for Blender stress mapping I can find is to make a material that is stretched more transparent like rubber. I think this might be usable for what I have in mind. Possibly it could be inverted or something along those lines.

But, before I can even start trying to find a way to work with any of this, I have to actually find the stress mapping inside Blender.

i have a sample old file for 2.49 wich seems to be working
but it does not work in 2.6

so not certain yet how to make it work in 2.6

did you search Utube or vimeo for video tut may be!

the file i have use a small anim and cloth sim !

happy bl

I had a (very) quick go doing this and it seems to work OK. Stress mapping is in the Texture Coordinates drop down. Once you’ve got that selected, it’ll swing the texture value from -1 to 1 for compressed to stretched with original shape at 0.
Link to image showing the effect: http://daveleack.com/wp-content/uploads/2013/09/stressMapping.png

Interesting, I didn’t even know Blender has it.

Hehe, I didn’t either until a few hours ago :wink:

Thanks Dazirius. I could NOT find anything else about this other than the outdated Blender documentation so I didn’t even know where to find it.

In the screenshot, are you using Blender Render or Cycles?

EDIT: Nevermind, opened up Blender and see it’s BR. Cool, cool. Step in the right direction. Shame it can’t be used in Cycles, though. I imagine that would take quite a lot of coding.

don’t think it matter you can add cycles mat
should work as well!

happy bl

How can you use this in cycles? I’d like to use it in a similar way to how tension maps are used in LightWave.

sorry dont’ know LightWave.
but can you show a pic so we can see it

strees is functiion of edges changes
like change the scale and it will change the color of faces
function of the ramp added

or using a modifier

thanks

stress map don’t change shape as i know of it only change the color
so not certain how your going to do the shape changes!

salut

The stress map would hypothetically be used as a filter. When a stress map is stretched, you can make it more transparent (this is, as a matter of fact, the only example of how it’s been used in Blender I can find for it). It would act sort of like an alpha map for a displacement or normal map filter. The displacement/normal map is what will actually make the shape change appearences. The stress map would be just to mask where the displacement map can and can’t be seen.

ok have you been able to make it work ?
ther eis a sample file at blenderorg

what else do you need ?
happy bl

If you can set it up so that stretched surfaces are white and non-stretched surfaces are black (or vice versa, either way is fine) then you could plug this b&w image/map in to the “fac” slot of a mix shader. Then place your displacement/normal map in to one of the slots and it would not be visible until there it is in the white (or black, depending on the slot). OR, like you mentioned, maybe it could be set up so that the stretched or compressed geometry is transparent like an alpha instead of white. I think either way would work for my purposes.

I just cannot figure out yet how to access the stress map in cycles – and I’ve been tinkering around. I’m also not sure if the stress map can be done so it’s realtime and affected by the actual geometry as you pose the model (i.e. so that stress map will controlled by shape key or bone movements) or if it can only be baked for one still image at a time.

i check on the thread for cycle and it looks like stress map have not been implemented yet
but that it might be possible with OSL and not have seen it yet done

so i’ll check some more to see if someone comes up with a node later on

happy cycles

In the short term you might want to try baking out the stress map to image sequences using blender internal, then using the image sequences as fac inputs or whatever in your favourite material noodles.
In the long term there should perhaps be a texture coordinate output for it. But not yet.

^ Is that possible? I’ve been considering if you could somehow use an image sequence for the the Image Texture node of this. I was curious if there was somehow a way to scroll/scrub back and forth through a image sequence instead of just playing it through as a loop. It would be ideal if it could somehow be linked up to the drivers or shapekeys to go through the images in the sequence.

What I said should certainly be possible.
Linking the frame of the image sequence to the value of a shape key or driver would probably require some custom code… I think… oh wait! Yep, key the value of the offset of the image sequence and drive it with the shape key value as a variable and do something like val * numframes or something. That should work, provided it can cast it nicely back to an integer for the frame value (which I think it will). I’ll have a play at some point and see if it can be done.
If I have any win, I’ll sling up a link to a blend file.

Yep, it’s possible, but it’s a bit of a pain in the butt.
There’s an addon you can enable in user prefs called animated bake or suchlike. Search addons for bake, it should come up.
I don’t remember installing it manually, so you should have it.
Once you’ve baked out the textures to an image sequence it’s a matter of adding a driver to the offset of the image sequence node in your material and using a scripted expression along the lines of int(100 * val) for the value of it, after populating the val variable section beneath there with links to the shape key whose value you want to use to control the frame the sequence is on.
sigh That sounds a lot more complex than it actually is, but I kinda got it working this way.
I wish that I’d spent more time when I tested it setting up the original stress map material because I found it really hard to use as a mask with the colour values I’d chosen. I ended up with middle grey being my “unstretched” value, and black being compressed and white being stretched. If my model had worked this way and I’d tweaked the values a bit better, it would probably have worked fine. As it stands it was a bit of a mess.
The end result though was that the keyed value of my shape key multiplied out to give the image sequence in my cycles material a frame offset to use.
Sounds like that’s what you wanted.
Ps. In my example expression earlier, the 100 was the number of frames I baked out into my image sequence. This means that a value of 1.0 in the shape key might set the offset to 100 and pop it over the top of numframes, but have a play with it, it’s quite intuitive once you have it set up.

So, you’ve made my day by saying this is possible! I’m afraid everything after that is…well I’m coming from the right-brain side of digital art whereas coding is a bit more left-brained. Intuitive for you is definitely not so much for me. Haha. I’m absolutely reading everything you’re saying here though and am going to do my best to research the topics so I can actually understand what’s going on and see if it is what I’m looking for.

Pretty much, if the stress mapping can be used as a filter (which when you said you got gray, black and white results based on compression and stretch, sounds right to me) it should be possible to do something along these lines:

http://forums.newtek.com/showthread…Human-Progress
http://www.youtube.com/watch?v=PNiuR…ture=endscreen

It could be a really great little tool/addon though, so maybe it would be worth tossing it out there on the coding forum to see if the guys there (and here, I suppose it’s all the same blenderartists reading) could have a go at it as well.

Is there any chance you could shoot me a .blend file with what you were working with?

Ah, it’s great to have some more info to gnaw on. Can’t thank you enough.

Actually, I spent half an hour tonight putting a blend file together that was fairly neat, and recording a video demo of it working to a degree. I’ve only got it to the point of just before baking out the stress maps thus far though, so I’m probably going to re-do the rest of the process, taking it to the point where it selects frames from the sequence based on a shape key or something, and write it up in a separate post on my site.
Starting point is here though: http://daveleack.com/2013/10/22/stress-maps-interesting-stuff/