XYZ Mask Help

Started by WAS, July 22, 2021, 02:24:26 PM

Previous topic - Next topic

WAS

I am trying to accurately mask a sphere based on XYZ. What is the best way to do that?

Additionally, I'd need the XYZ masks not including displacement. Just the spheroid and XYZ faces.

Matt

#1
Method 1: "Get Normal in Geometry".

If you only need to texture a sphere or planet, use "Get Normal in Geometry". This gives you the surface normal of the undisplaced surface. For a sphere or spherical planet this is equal to the direction from the centre of the sphere.

https://planetside.co.uk/wiki/index.php?title=Get_Normal_in_Geometry

Method 2: "Get Position in Geometry", transform/offset, and "Normalize Vector".

If you use additional objects and want to merge them according to their position on the planet, you'll need use their shared world position. "Get Position in Geometry" gives you the undisplaced surface position in world space. You can follow this node with "Normalize Vector" to produce the direction from the origin, but not from the centre of the planet. If your planet is centred at 0,0,0 this gives you the same result as "Get Normal in Geometry". If your planet is NOT centred at the origin you'll need to use a transform or subtract the centre position before the normalize.

https://planetside.co.uk/wiki/index.php?title=Get_Position_in_Geometry
https://www.planetside.co.uk/wiki/index.php?title=Normalize_Vector
Just because milk is white doesn't mean that clouds are made of milk.

WAS

Thank you for taking time to reply, Matt. I've been working with planets at 0,0,0 to try and save from issues from forgetting my POO. I think method 1 should probably suffice. I always forget get normal/position in geometry is the original base for displacements. The "geometry" always ques me to think after displacements and the current state of geometry after disp.

Feel like I'm a kid trying to memorize something. Repeat: "geometry is NOT displaced state". Lol

WAS

I guess my only follow up question is how would I go about now (through method 1) getting the accurate negative faces? When I complement my scalars, they naturally extend up to the end of the base scalar. So Y is the top of the planet, which does match the transition to stretched Y disp/texture, but the complement extends like 3/4 the planet.

Matt

Use Negate instead of Complement. Or if you are already planning to use a Colour Adjust Shader, use negative white points and black points.

Negate(v) = -v
Complement(v) = 1-v
Inverse(v) = 1/v
Just because milk is white doesn't mean that clouds are made of milk.

WAS

#5
Oh, ok. That explains that. Thank you.

Image attached for the visual people.

WAS

Huh. So another weird thing. I thought I could just Add Scalar the positive/negative sides into one scalar, but when you do that, you lose both scalars. Was hoping to compact the rig but I don't think it's possible? Even mixing scalars will result in no data.

Dune


WAS

Even if you add/multiply to the base scalars, there is nothing. No 1+ or -1. Just nothing.

Ex. If I add 1 to the positive, that should be a range of  1 - 2, but if you add the range negate, there is no data again. That should be a range of 0-1 and.

Dune

Strange. Sorry, can't help you solve that. Maybe use conditional scalar?

Mid-Knight Acchan

I'm not sure how to use the function. I made it with reference to the image, but the result is not accompanied. Am I doing something wrong?
test1.jpg
I started 3D landscape with "Bryce" and am currently editing Japanese Wiki as a Terragen user. I am riding the Kawasaki ZEPHYR1100. I am a reader.

WAS

#11
X to Scalar and Z to Scalar need their input from Get position in Geometry, not from Y to Scalars Negate.

Get Normal in Geometry is supplying a 0-1 range of scalar data which represents X, Y, and Z axis. We use the convert X|Y|Z Scalars to separate this data to use individually.

I have to say though, with what you did do, you seemed to create a Y based gradient masking system for different colours, possibly useful for gas giants.