Page MenuHome

Shading: Add UV output to Brick node
Needs RevisionPublic

Authored by Charlie Jolly (charlie) on Mar 6 2020, 12:36 PM.

Details

Summary

Adds an output which contains the brick coordinates.

This does not factor in mortar size.

Diff Detail

Repository
rB Blender

Event Timeline

Fix after recent node changes in master

Ray Molenkamp (LazyDodo) requested changes to this revision.EditedMar 6 2020, 2:48 PM

Experience from bricktricks, UV alone is not enough, you'll have to know the size of the brick (or aspect ratio) to adjust for texture stretching

ie if the next shader block down makes rounded corners you're gonna need more information to make sure the corners stay as wide as they are tall.

This revision now requires changes to proceed.Mar 6 2020, 2:48 PM

Experience from bricktricks, UV alone is not enough, you'll have to know the size of the brick (or aspect ratio) to adjust for texture stretching

ie if the next shader block down makes rounded corners you're gonna need more information to make sure the corners stay as wide as they are tall.

@Ray Molenkamp (LazyDodo) the brick texture already has width and height values which can be used for the next texture. It wasn't the intention of this patch to add round corners. Have you got an example of what you mean?

I Think you are suggesting i manually copy the data from one node to another like this

Initially yeah, that seems to solve the problem, but...

now what? Now it's easy to go, well yeah, that's just bricktricks being difficult.

Same example using a image texture..

Copy the size...

Nope also messed up...... all-right, ....that's clearly still a problem, then...... how about we normalize the UV's in the 0..1 range that'll clearly sidestep this issue!

(used bricktricks here to demonstrate the issue)

Now you end up in a situation where the bigger bricks have texture stretch issues

In the end it comes down to this:

To make effective use of the UV's you have to know something about the size of the brick

I Think you are suggesting i manually copy the data from one node to another like this

@Ray Molenkamp (LazyDodo) Thanks for the feedback, I understand what you mean. I'll update to include a brick size output. What's the preference here? Two float or a vector output?

I played with both, having a single socket has less clutter in the UI, but separate sockets was easier to do math with (although that was before the vector math node actually had useful things in it) I'm leaning slightly towards single socket, but have no real strong opinion there, given what we choose here will have to carry forward to any future nodes that may expose UV maps, perhaps we should ping the UI guys? cc: @William Reynish (billreynish)