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.
@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).
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
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.
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.
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_
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.
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
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
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.
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
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.
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.
Wait a second... this was my suggestion!
eyupp!
This was actually a lot more complicated than I had anticipated, wouldn't of come up with this on my own!
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.
Can you share a screen shot of the set up? Excellent work btw
@@gregblendsmakes9348 www.reddit.com/r/blender/comments/hvl242/simple_shaderbased_instanced_mosaic_no_uv_maps/
@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).
@munuc I was internally screaming that the whole video.
wow, you already have 3.47 thousand subscribers, keep it up, 4 thousand is just around the corner!
"-I will try not to get too technical..."
*pulls up three calculators
me: oookay
:D
Nice video, thanks. Also very handy 'Mod' explanation, can be helpful at many tasks
Another Lego one!! Man, this guy is great!
no you're great
yesterday i congratulate you to 2k subs and this week i congratulates you to 1k subs and now you have 3k!
This works for geometry nodes as well! Great tutorial, thanks
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
As an engineer, I probably over engineered this, haha.
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
Stick at it, you'll be a pro in no time.
Time to publish a book on Blender 1.0.😊
4K when?
Damn, wasn't expecting a math lesson
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
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.
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.
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_
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.
@@gregblendsmakes9348 thanks for the answer, sure is convincing though, it really looks like 2.7x
@@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
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
I tried with degrees and it didnt work
love the vids! keep it up
yee (that mean your videos is good, continue like that !)
bahba bah-bah bahbah baaahhh BAHBAH
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?
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?
@@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
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
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.
Be responcive!
thank you, you save me
hey you cool guy, Cool videos
I'm bad at math what does modulo do?
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
@@gregblendsmakes9348 ohhh thanks, I get it now
Blender 2.8 with a 2.79(?) skin is utterly cursed
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.
8th like, 3 comment, love your vids, and keep them up !!!
do dis wit video
Like, animate the bricks?
@@gregblendsmakes9348 precisely
What the hell... I can’t 😭😭😭
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.