Results 1 to 6 of 6

Thread: Using Normal maps to rotate instances - help !

  1. #1

    Using Normal maps to rotate instances - help !

    Hi all,
    i'm trying a setup to get vegetation instances to bend outwards like in real world.

    For several reasons i need to use planar geometry to place instances - otherwise i could just use a curved surface and use Normals in instance's rotation to get the fall-apart effect.

    In attached scene, i use a small twig and i instance it on a plane, then i try to use a Normal map (created from a bulged geometry) to rotate the instances, but i cannot get it working.

    In attached image you see a setup i did time ago with the help of someone (sorry but i do not remember who), it works somehow but instances fall outwards on one axis, on the other they fall *inwards*. Anyway this setup (you can find it in the scene attached here) tries do derivate rotation informations from Normal Map's RGB output, and not from vector output. This has other flaws i will not describe here, but i think using Normal Map's vector output can give a better result.

    So i am trying to derivate rotation for instances directly from Normal map's vector oputput but up to now i had no luck. You can find the starting setup (not working) in the Attempt_NRM.ZIP scene attached.

    In both scenes you will find both normal map in world space and in geometry space, in case this can help.
    Thanks to anyone willing to try

    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Image.jpg 
Views:	51 
Size:	305.9 KB 
ID:	142411  
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Jan 2005
    Colorado Springs
    I don't know about using the Normal Map 2D texture, but you can get splay in both X and Z in the Attempt_RGB scene by negating the Z channel in your final vector:

    Click image for larger version. 

Name:	NegateZOnFinalVector.jpg 
Views:	18 
Size:	1.01 MB 
ID:	142420


  3. #3
    Registered User
    Join Date
    Jan 2005
    Colorado Springs
    BTW, I don't know if you're interested in potential alternative methods, but you could use two Turbulence procedurals in the Y axis for the Instance rotation, one adding and one subtracting a particular value. Sample scene attached.

    Click image for larger version. 

Name:	FieldGrass_TexturedRotation.jpg 
Views:	20 
Size:	1.18 MB 
ID:	142421

    I added a Random Scale to the field grass instances to give them varying heights, and on the Rotation Texture, one of the Turbulence procedural's value is 3.0, while the other is -3.0. As long as the other parameters (Scale, Position, Rotation) are the same, they will nullify each other. The interesting stuff happens when you use the sliders to change the scale, position or rotation in any axis. When the Turbulence procedurals are "offset" from each other in scale, position or rotation, the field grass will rotate in interesting patterns, which you can see "live" as you use the sliders.

    It may not be as much control as you want, but might be worth a try. Besides, if you animate one or more of the Turbulence parameters, you'll get the grass "waving in the wind".

    Attached Files Attached Files

  4. #4
    Thanks, chekcing it ! It seems the vector tranformation you set works great.
    Anyway, beside randomizations, i was looking precisely for the fall-apart effect because i'm working on something more comples than this example.
    See below images - i'm creating some presets of Perennial plants, using a colored map + Nodemeister + DB&W color key node to have each plant instanced on a given color (se the small map on top-right in image editor) and then a normal map of "bulges" to have each group of plant to fall-apart. As you see from the compound, it somehow works already but that setup is limited, because if i need to rotate the distribution map and the normal, the fall-outwards effect gets messed. I was looking for a simpler and more reliable way to get intance rotation from Normal map. From my tests, i see that using RGB output from Image node gives this kind of issues, so i thought that using vector output from Norma Map node could bring to more coherent results.

    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Compound.jpg 
Views:	15 
Size:	100.0 KB 
ID:	142424   Click image for larger version. 

Name:	Screenshot_3.jpg 
Views:	26 
Size:	817.7 KB 
ID:	142425  
    Last edited by Pavlov; 08-02-2018 at 03:47 AM.

  5. #5
    I see two things in your node setup:
    To remap the range from -0,5 to 0,5 from the normal map to -90° to 90° for the rotation you need to scale the vector with 18000% (multiply with 180). And the Rotation Input wants radians not degrees (1° = 0,017453293 rad).
    I have attached a modified version of your scene file:


    I hope it helps.


    I use two pieces of the three-piece application with mocap module.

  6. #6
    hi, thanks for the tip !
    Anyway, sadly this does not solve main issue of rotating the map. See attachment - when you rotate normal map (which is something i may need to do in the complete example i posted above), all rotation get broken. That's why i was looking for a more consistant method which already keeps track of rotation in proper space, but it seems there is not a simple way to get instance's rotations out of Vector output from Normal Map node.

    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot_1.jpg 
Views:	19 
Size:	137.7 KB 
ID:	142429  


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts