10

I'd like to make a scientifically accurate animated snake using particle objects (and no, sculpting or bump mapping won't be realistic enough because real scales don't actually shrink and stretch when the snake bends, they overlap or move away from each other, like particles do).

As per this answer Particle Object to Inherit Uniform Colour from Emitter I managed to get the scales to have ONE color sampled from the emitter thanks to the "from instancer" checkbox.

enter image description here

Cute but not good enough!

Real snake scales have multiple colors EACH, they're not actually pixilated! enter image description here

So this is what I hoped to achieve, an imitation of real life:

enter image description here

This would not only make my snake 100% realistic, but also make my life easier as I would only have to paint a pattern onto the body mesh which then reflects perfectly onto the scales... but even though I tried to follow the instructions from the follow-up answer on the previously mentioned post, which supposedly would make the scales go "chamelleon-like" just as I need them to, I can't for the life of me get it to work!

each scale has the same rainbow as the entire body, rather than only copying a small area in their vicinity...

I've tried:

  • making sure everything shares the same origin.
  • making the original scale object have the same size as the whole body (scale applied)
  • making a completely new file with simpler objects (cubes and planes)

nothing works.

enter image description here

Here's the file, hopefully containing new updeated texture:

Any help will be appreciated!

CBarr
  • 518
  • 3
  • 11
  • Main point is you don't want individual scales to deform when the body deforms, right? So another way to see the subject can be "how to rig the scales (that are not particles) so that they don't individually deform?". Any though? – lemon Oct 18 '20 at 15:47
  • Well.... yeah. I see your point. but I tried several alternatives and neither instancing nor arrays allowed me to have such precise control over the scales' orientation and size while animating the snake. Only particle objects behave correctly, so that's why I'm using them. But if you have a solution that allows me to paint a pattern onto the entire set of scales (rather than paint each scale individually!) with them behaving properly while the body moves, I wanna know! – CBarr Oct 18 '20 at 15:57
  • I don't have (completey) this solution for now but am quite sure "from instancer" cannot be used as you can only refer to the body position in object space, which means that will deform the texture mapping when the snake is animated. – lemon Oct 18 '20 at 16:02
  • I don't know why you say that - "from instancer" works great, even when the snake wiggles about. Sadly, it only samples exactly ONE pixel from the base mesh color (well, makes sense, particles are infinitely small), so each scale only has one solid color... useless here, but if I wanted to make a mosaic it would be ideal. See how the scales retain the exact same pattern as the body even when it moves: https://imgur.com/lVWrPpM – CBarr Oct 18 '20 at 16:12
  • 1
    Apply the particle OR use "Animation Nodes" add-on, then copy UV using https://blender.stackexchange.com/a/86759 OR bake snake texture to the scales? – cppBeginner Oct 19 '20 at 01:20
  • Apply Particles as in "Convert"? That creates a thousand objects no longer attached to the body/armature. Unless there's something else I don't know, that doesn't seem like a feasible option. But the other two sound interesting, I must try them out! – CBarr Oct 19 '20 at 15:38
  • Can also use data transfer for the weights. The tricky point is to make it so that all the vertices of one individual scale get the same weight (as they dont deform). This is doable using shape key (a bit painful though). – lemon Oct 19 '20 at 15:45
  • Not sure that can be considered accurate enough? https://i.stack.imgur.com/IZjXx.jpg . @CBarr, what do you think? – lemon Oct 19 '20 at 16:10
  • If the texture on the body looks the same as those scales, then YES! My original texture mapping doesn't cause the numbers to repeat quite as often on the Y axis (maybe 4 times across the entire width of the snake), but since that depends on the vector settings, it may not be a problem at all. I'd like the texture on body and scales to look nearly the same so that when the snake stretches and the scales move away from each other, the "skin" between them kinda matches the rest of the pattern. It doesn't have to be exact, just close enough. How did you do it? Does it work when animating? – CBarr Oct 19 '20 at 18:12
  • 1
    It works when animating (it is UV based)... will provide details asap. Two approaches could work: this one (from the image above) or applying all and data transfer. For now, have not compared them. A decisive point would be: could you provide a real snake skin texture so that we can see the result? – lemon Oct 19 '20 at 18:18
  • So awesome.... You need me to paint a more realistic texture for my model, right? I've uploaded a new file, let me know if it's working (never sure if the packed images are ok). It's just a low quality ball python-ish texture, nothing fancy but should be be enough.

    BTW using "from instancer" on the texture coordinates USED to apparently work decently, but not anymore! Guess you were right and it's not really useable, but somehow it fooled me for a long time! moving on....

    – CBarr Oct 19 '20 at 18:51
  • Hmm... Object texture coordinates might help, but that would probably break upon deformation. It looks like you did some vector mapping, so maybe try converting between world and object space with the vector transform node, and then map after that. Idk, Lord help. – TheLabCat Oct 20 '20 at 00:16
  • 2
    https://i.stack.imgur.com/f5GJj.jpg so far... not accurate enough... But the bad news are the following: have imagine 2 ways to do it. Though, in both the limitation is about they need a seamless texture in at least one dimension for the snake texture... Do you think you can manage it? (eventually, we can continue in chat if we're proposed to here). – lemon Oct 20 '20 at 17:34
  • Wow, it's awesome! And seems accurate enough. I'd have to see at what happens when the snake flexes so hard that the scales come apart, and experiment with different sizes (real snakes have many more, and smaller, scales than this quick mockup) but it looks great so far. The underlying texture is definitely there!

    Seamless texture meaning repeatable, like tiles? Then that won't work for most cases at all, they're even more irregular than this one.

    But it's already so good as it is! Can you post an answer? I wanna upvote and try it! (and yeah, chat would be fine, how do I do that?)

    – CBarr Oct 20 '20 at 18:43
  • @CBarr, when the snake flexes. Each scale keeps its texture part (and is underformed). Can you confirm this is effectively what you want? – lemon Oct 21 '20 at 06:34
  • Yes, that's correct. Real scales are transparent but they're stuck to their portion of skin (which gives them color) so they keep their texture as they move around, and never deform. – CBarr Oct 21 '20 at 09:24
  • @CBarr :: This might be a partial solution (use Animation Node add-on) : https://blender.stackexchange.com/questions/97095/animation-nodes-how-to-create-faces-from-a-particle-system . Then, you will probably need to allocate UV (via Animation Node) for all generated scales. The UV of every scale should be reside in a single image but rarely overlap. After that, bake from original snake to scales. I didn't test it yet. This problem is harder than I thought. – cppBeginner Oct 24 '20 at 01:09
  • 1
    @CBarr, I won't answer as what I've done so far is not good enough. Though, this is a result. So here is the file with some comments in it. Hope that will help. https://blend-exchange.giantcowfilms.com/b/PjwQd8v6/ – lemon Oct 25 '20 at 07:59
  • @lemon Thank you, you're awesome! I won't pretend to understand even half of those nodes (my knowledge of node coordinates begins and ends with height-mapping landscapes) but the idea seems spot on, expanding the sampled area around the central point of origin. I'll have to study this more deeply to try and replicate the result. Oh, in the file comment you wonder if the scales have been combed - yes, they have (and there's weight painting to make them smaller near the tail, if that matters). Just one thing bugging me - what are those 900 new scales? They don't seem to serve any purpose. – CBarr Oct 25 '20 at 10:39
  • @cppBeginner That sounds pretty reasonable, I'll have to look into that when I have the time! Never used animation nodes, there's some learning to do. So, for that to work all of the scales have to be "real" independent objects (not copied on the fly from a single scale used as an object in the particles), right? – CBarr Oct 25 '20 at 10:46
  • @CBarr this 900 scales are maybe some tests I did converting PS to individual meshes. But that lead to nothing. – lemon Oct 25 '20 at 10:48
  • @CBarr :: I don't really know if those scales have to be "real" objects. I just guessed the easiest approach (e.g. for me - to try). Perhaps, there might be a better solution. Sadly, even with the bounty, there is still no answer. By the way, in the add-on, the concept of "real" objects becomes a bit obscure. – cppBeginner Oct 25 '20 at 11:49
  • @lemon Ah, ok. I figured they couldn't be doing anything important, because deleting them had no effect! Thank you so much, I definitely have something to work from, now. – CBarr Oct 25 '20 at 14:07
  • @cppBeginner Right. Since you mention that every scale needs their UV to be in the same image, I don't know how that could be done except with the scales being actual meshes. But I should probably learn some more about animation nodes before trying to guess anything! Will look into that, thanks. – CBarr Oct 25 '20 at 14:10
  • @CBarr :: Yes, you are right. In a partial solution I proposed, because of UV, the scales should be real objects. – cppBeginner Oct 26 '20 at 00:44
  • @cppBeginner As I suspected. Still, that idea might work, so I'll try to figure it out! – CBarr Oct 26 '20 at 14:35
  • 3 weeks later, do you have any progress? I am curious. – cppBeginner Nov 19 '20 at 03:28
  • 1
    @cppBeginner sorry! I wanted to keep this updated but work became real tough all of a sudden and I won't be touching this until at least the end of this month.

    I will be trying every option suggested and hopefully post a definitive answer. This is my sole priority when I can get back to blender (I absolutely NEED to be able to make realistic snakes!)... just not right now.

    – CBarr Nov 19 '20 at 10:24

2 Answers2

1

Use UV From Instancer to offset a large UV gradient. So a scale shows not just one point from the texture but a small area around.

enter image description here

unwave
  • 1,643
  • 5
  • 14
0

I've simplified the node tree from unwave's solution above by changing the "Texture Mapping Type" from "Point" (which scales the coordinate system) to "Texture" (which scales the texture itself). In order to achieve the same relative movements between the texture and the texture coordinate system, the rotation around the z-axis had to be inverted from 90° to -90° and the scaling factor from 1/3000 to 3000. The scaling factor of 7 for the y-axis in the "Mapping Node" (set to "Point") had to be taken as divisor for the scaling factor 3000 in the new mapping node (set to "Texture") giving the value 428.571, but here for x and not for y which gets the undivided scaling factor of 3000. I've further simplified 428.571 to 300: enter image description here

Duerer
  • 96
  • 5