Procedurally Rotate Textures Randomly

Поділитися
Вставка
  • Опубліковано 28 жов 2024

КОМЕНТАРІ • 53

  • @kameleongreen
    @kameleongreen 4 роки тому +35

    Wait a second... this was my suggestion!

    • @gregblendsmakes9348
      @gregblendsmakes9348  4 роки тому +8

      eyupp!

    • @kameleongreen
      @kameleongreen 4 роки тому +6

      This was actually a lot more complicated than I had anticipated, wouldn't of come up with this on my own!

  • @0LoneTech
    @0LoneTech 4 роки тому +10

    The formula (x-x%n)/n can also be written floor(x/n). More conveniently, the Math node (both vector and scalar) has a Snap operation that does x-x%n, and "To Radians" to do x*pi/180.
    I fiddled a little bit with instancing. Here's my current mosaic recipe:
    1 mesh object with the plate design and shading, named Plate.
    1 mesh object to place the mosaic, holding a single square quad, named Grid.
    2 Array modifiers on Grid, making it configurable number of rows and columns.
    Grid is parent to Plate, and in Grid's object properties, Instancing is set to Faces.
    All the fancy shading is in Plate's material:
    Logo mapping: Object Info/Random Map Range 0-1 to 0-360, Math Snap increment 90, Math To Radians, Vector Rotate texture coordinate about Z axis offset 0.5,0.5 angle from To Radians, into Vector Mapping Texture, Texture lookup, the usual.
    Base colour per instance: Texture Coordinate Object from Grid Object, Vector Math Snap to grid spacing, Vector Mapping Texture to mosaic size, texture lookup.
    It's not terribly elegant, I still have to feed in the grid size in multiple places, but the instancing makes for a very efficient way to generate the distinctly shaded objects.

    • @gregblendsmakes9348
      @gregblendsmakes9348  4 роки тому

      Can you share a screen shot of the set up? Excellent work btw

    • @0LoneTech
      @0LoneTech 4 роки тому

      @@gregblendsmakes9348 www.reddit.com/r/blender/comments/hvl242/simple_shaderbased_instanced_mosaic_no_uv_maps/

    • @0LoneTech
      @0LoneTech 4 роки тому +3

      @munuc Certainly; and fraction, truncate and floor are much cheaper operations than modulo. Division by constant is typically optimized into multiplication by inverse. With an input range of [0..1) like the random generator produces, it's probably best to do truncate(value*steps)*stepsize, which as Hoyt Eternal pointed out is already available in the Stepped Linear mode of the Map Range node (which calculates step size from the output range). Modulo is quite likely to be implemented as m*frac(x/m).

    • @Camper_Lv
      @Camper_Lv 4 роки тому +2

      @munuc I was internally screaming that the whole video.

  • @monsieuralexandergulbu3678
    @monsieuralexandergulbu3678 4 роки тому +2

    wow, you already have 3.47 thousand subscribers, keep it up, 4 thousand is just around the corner!

  • @tigransafaryan6619
    @tigransafaryan6619 4 роки тому +3

    "-I will try not to get too technical..."
    *pulls up three calculators
    me: oookay
    :D

  • @DapiroStanislav
    @DapiroStanislav 4 роки тому +1

    Nice video, thanks. Also very handy 'Mod' explanation, can be helpful at many tasks

  • @gennalipkin5639
    @gennalipkin5639 4 роки тому +4

    Another Lego one!! Man, this guy is great!

  • @adlerkampf
    @adlerkampf 4 роки тому +3

    yesterday i congratulate you to 2k subs and this week i congratulates you to 1k subs and now you have 3k!

  • @danielamora3d
    @danielamora3d 19 днів тому

    This works for geometry nodes as well! Great tutorial, thanks

  • @marshmallow_fellow
    @marshmallow_fellow 4 роки тому +2

    I would've multiplied the random value by 4, rounded and multiplied by 90 to get the same result.
    Also: The Geometry node has a Random per Island output which gives the same effect as random from the object info but per mesh. this only works in cycles though

  • @ph0n1xz
    @ph0n1xz 4 роки тому +2

    Watching videos like these make me have some kind of passion to blender
    But then I try to do something, it gets hard or doesn't work, and I quit lol

  • @r.k.b2055
    @r.k.b2055 4 роки тому +2

    Time to publish a book on Blender 1.0.😊

  • @Danimineiro
    @Danimineiro 4 роки тому +1

    4K when?

  • @aimanghazi7043
    @aimanghazi7043 2 роки тому

    Damn, wasn't expecting a math lesson

  • @Akkaren79
    @Akkaren79 4 роки тому +1

    Wouldn't it be possible to get a rnd between 0 and 4, round it, and then convert it to rad? Seems more easy to me

  • @tiagotiagot
    @tiagotiagot 4 роки тому

    For the number snapping thing, I think it would require less mental gymnastics if you first make the range go from 0 to 4, then use a Floor math node, and then convert the range to the intended range.

    • @gregblendsmakes9348
      @gregblendsmakes9348  4 роки тому +1

      Good idea. My engineer side was leaking and I totally over-engineered this. There's lots of ways to accomplish the same thing, however, other people have had other suggestions as well.

  • @Kasmuller
    @Kasmuller 4 роки тому +5

    23 minutes ago
    Thats about as long ago as i discovered this channel
    But what happened to 2.8x versions why are you using 2.7x?
    Is there a specific reason for it or just personal preference?
    I stayed with 2.79 for a while becaus ei couldnt quite get a hang of the new ui but i have moved over now, but i also see more people than you staying behind, and i wonder ehat the reason for that is.
    Als you are at almost 3k subs
    Almost 1k subs in 1 day
    _you better get started on your 3k special or you'll be late_

    • @gregblendsmakes9348
      @gregblendsmakes9348  4 роки тому +2

      This was in 2.82. I use a custom theme because I hate the dark/light options that ship with 2.8+. In fact, I used a variation of this custom theme in the 2.7x days as well.

    • @Kasmuller
      @Kasmuller 4 роки тому +2

      @@gregblendsmakes9348 thanks for the answer, sure is convincing though, it really looks like 2.7x

    • @gregblendsmakes9348
      @gregblendsmakes9348  4 роки тому +1

      ​@@Kasmuller Yea I like a medium gray theme, and teal is my favorite color so I made a 2.8 theme with medium grays and teal :P

  • @drakomatic
    @drakomatic 4 роки тому

    if blender is expecting a value in degrees just plug in the x - mod(x)
    correct me if im wrong because it looks like you just put it into radians and then degrees again

  • @ivanprice9313
    @ivanprice9313 4 роки тому +2

    love the vids! keep it up

  • @badobada4541
    @badobada4541 4 роки тому +3

    yee (that mean your videos is good, continue like that !)

  • @Freeze014
    @Freeze014 4 роки тому +1

    for some reason the bump map doesnt rotate in place for me, it shifts position. Any idea what could be wrong? Like the pivot point is not centered?

    • @gregblendsmakes9348
      @gregblendsmakes9348  4 роки тому

      My UVs were centered since the lego logo was in the center of the map. Did you put the vector into the rotation slot of the map?

    • @Freeze014
      @Freeze014 4 роки тому

      @@gregblendsmakes9348 ua-cam.com/video/W9gCWe7_DbQ/v-deo.html is what happens. And this is my (way to big) logo + UV i.imgur.com/Xzy8aOC.png

  • @ii_r_ftw
    @ii_r_ftw 4 роки тому

    is there a reason you generated a random multiple of 90 that was less than 360 that you then divided by 90 to get a integer of the range [0,3) instead of just directly generating a random integer of the desired range then multiplying by ᴨ/2 to get the rotation amount

    • @gregblendsmakes9348
      @gregblendsmakes9348  4 роки тому

      As an engineer, I was probably over-engineering it. My goal was to use the division to get an integer, but someone later told me you can set the map-value node to be stepped, so I could have just gone from the 0.0-1.0 random integer to 0-3 as whole ints and used that. But because I didn't know about that stepped setting, I ended up doing it more of a coder-brain way of thinking.

  • @kendrili
    @kendrili 4 роки тому +2

    Be responcive!

  • @le_paludo
    @le_paludo Рік тому

    thank you, you save me

  • @monsieuralexandergulbu3678
    @monsieuralexandergulbu3678 4 роки тому +1

    hey you cool guy, Cool videos

  • @jonasgenova
    @jonasgenova 4 роки тому +1

    I'm bad at math what does modulo do?

    • @gregblendsmakes9348
      @gregblendsmakes9348  4 роки тому

      returns a remainder.
      So 76%25 would be 1, because 25 goes into 75 3 times evenly with 1 left over.
      265.73 % 90 gives 85,73 because 180 is two 90's with 85.73 remainder

    • @jonasgenova
      @jonasgenova 4 роки тому

      @@gregblendsmakes9348 ohhh thanks, I get it now

  • @NICK....
    @NICK.... 4 роки тому

    Blender 2.8 with a 2.79(?) skin is utterly cursed

    • @gregblendsmakes9348
      @gregblendsmakes9348  4 роки тому +1

      It's not a 2.79 skin. It's just a 100% custom skin. I hate blender 2.8's dark theme (too dark) and it's light theme (too light), so I made a medium gray theme with teal as an accent color.

  • @guys-in9vd
    @guys-in9vd 4 роки тому +2

    8th like, 3 comment, love your vids, and keep them up !!!

  • @SUBSCRIBERSWITHOUTVIDEOS-dj7vo
    @SUBSCRIBERSWITHOUTVIDEOS-dj7vo 4 роки тому +2

    do dis wit video

  • @JULIUSCOOLX
    @JULIUSCOOLX 4 роки тому +2

    What the hell... I can’t 😭😭😭

    • @MMmmmVarley
      @MMmmmVarley 4 роки тому +1

      You can. I was two years behind in maths when I graduated high school, it made me feel dumb, I hated it and never wanted any part of it. Problem was, I loved animation and 3D and holy hell, I need to understand maths for this?! Forget the ways school tried to "teach" you. Dig around youtube or elsewhere on the web for a better understanding. I have been relatively successful in the industry for 20 years and I should have failed maths in high school. I am pretty sure Kev from Blender Binge was in the same boat. Don't underestimate yourself. Go check out Khan Academy, look at some TED talks, dig through youtube. Someone has a way to make maths click for you. Okay, old man rant over.