#how do i make this be 3d?
1 messages · Page 1 of 1 (latest)
Can branch based on the direction the normal vector is facing, though which combination of scale X/Y/Z in Width/Height ports would depend on how the object is UV mapped
its a primitive cube
Projecting the rectangles from each axis by using something similar to triplanar mapping might be easier. That would involve 3 Rectangle nodes and using Position node (object space) -> Swizzle ("xy", "yz" or "xz") in each UV port
That way I think you can use anotherSwizzle (with same components) for the scale (and Split R/G -> Width/Height)
no wait
this is not the whole shader
that part that i showed is just the mask
i dont know if u missunderstood or i just dont understand 
let me just take a ss of the whole thing if you want
i have no idea where i would change that to using position honestly..
Sure, but you have the same problem with the other rectangles right? The spacing/gaps between each one is inconsistent on each face. Or is that intentional?
let me show you
this is intentional
but if we go on the left or right
then that face is not scaled up and also goes the wrong way
uh, cyan, still here?
Had stuff to do, but also put together a graph of how I'd handle this. As mentioned earlier, I've used Position node instead of the model UVs. That way we don't need to figure out what components to use for each face due to how the face is rotated in the UV map, the position & scale just uses the same swizzle.
Used a Custom Function node to branch the position & scale, based on the normal vector :
Normal = abs(Normal);
[flatten]
if (Normal.x > 0.8){
FaceUV = Position.yz;
FaceScale = Scale.yz;
}else if (Normal.y > 0.8){
FaceUV = Position.xz;
FaceScale = Scale.xz;
}else{
FaceUV = Position.xy;
FaceScale = Scale.xy;
}
(Could be done in nodes instead but would be a bit messy)
Also rather than using Rectangle nodes I've handled calculations myself (e.g. Absolute -> Step) to keep the horizontal/vertical sides in separate channels (as shown by red/green in previews), so we can subtract dashes, then Maximum later to combine them. (Halves the amount of nodes needed and probably makes the shader cheaper too)