"position node" as a texture coordinates?

Could someone please tell me if such a thing exists?
I mean, when we use the position node as texture coordinates versus using the UV map as texture coordinates, they both generate completely different sets of numbers. However, in the rendering, they both result in very clean renders. How is this possible unless there is a different set of functions to deal with these different sets of numbers?

The position node in gn is basically the same thing as Object cords in the shader editor. It outputs vectors in all directions from the objects origin.

UV’s are different (they are different calculations)

UV’s are 2d, they only map on the faces in x and y directions.

Object cords are 3d, and can be used to map volume inside the object.

2 Likes

Thank you DNorman :heart: :heart:
But shouldn’t the texture coordinates be between 0 and 1? What if the object’s size is greater than 1?

1 Like

Cords go over (and under 1).

3 Likes

Each axis is handled modulo 1. So 1.01 on an axis is the same as 0.01.

There are some other modes like clamping or running the range1…0 backwards when the coords are 1…2 but typically its modulo. And they all keep it in final uvcoord in range 0…1

3 Likes

If you scale a cube up in edit mode the values mapped to the faces go over 1 (and become emisive)

Which is why I was normalizing them in the other thread for the colour ramp.

The Black is emitting negative light

3 Likes

Yeah.thats a cycles thing with the emission, but careful that you dont confuse it now. What you have there are 3d coordinates, they are rather the input values.

UV mapping and uv coords are how that is applied to texture space. Thats clamped to 0…1 not the input.
You can also use the input values you showed above and use it in a 3dimensional target colorspace like eg 3d voronoi noise. Then you have no clamping.

Its another thing for 2d textures. their range is defined in the 0…1 space.

1 Like

To describe the initial question a bit more. Think of it in term of source space and target space. As I described above, both can be 3d, and if the target space is 2d, then what you want is a continous mapping a set of values that goes stepwise from point a to b. ( what is in your position case a projection from top down while just skipping the third axis) That continuity of the target space values is the important part. So if you eg use the position on a cube then vertical face has no “space” its just a line in the uvmap because of the projection used. So whats drawn on such a faces is typically just stretched lines.

There are too much possible mappings out there to describe them all. But thats what they have in common and thats why both methods have their usecases where they work.

Texture space is 0…1 not more. UV coordinates can be set via higher or lower values to eg align them in separate areas in a uv editor ( there are more benefits). But the final appliance is 0…1 for texture space.

2 Likes

Coords can be in any range. Even UV coords. DNorman is correct.

3 Likes

Good point! UV’s too.

2 Likes

Wow! Thank you all so much :heart::heart::heart:. This forum is full of amazing people. Thanks again.

3 Likes

How the coordinates get interpreted is a separate concern…

Compare the Image Texture node’s Clip and Repeat modes:


2 Likes

You got the point that we are talking of texture mapping? What you do there is using a 3d target system (rgb) to display a the color interpretation of these values.

To be honest, I think I’ve bitten off more than I can chew. I’ve learned most of what I know about Blender through AI. I don’t know if its wrong or right but this is part of its answer :

. The texture coordinates are used to map a texture onto a 3D object. The texture coordinates can be arbitrary values, but they will be clamped or repeated/wrapped into the range 0 to 1 depending on the texture coordinate wrap or clamp settings

Well the problem is that too many people here are cross talking. A 2D texture is defined in the range 0…1 for each of its 2 axes. There are no larger values interpreted ( but thats nothing you have to care about, you can still define them outside 0…1) as I described above. But UV maps are not just used with textures and even more not just 2d textures. They are also used with generators (eg 2d voronoi, 3d voronoi, 2d textures, 3d texture(arrays) ). For 2d and 3d textures their range must finally be 0…1, but storagewise quite some editors store it in a intermediate space that is unclamped.
And to be clear about this some target spaces are not clamped at all.

But for texturemapping that unclamped intermediate space still has to be clamped to be in the final texture space. Its not important if the gpu does this internally or if it happens earlier.

Same is true for 3d. It could be a clamped target space or not.
And if its clamped then there are different modes for that. Things like clamp repeat, mirror, etc.

UV mapping is mathematically a transform function. Typically it maps from 3D to 2D (just not always).

The thing is that this doenst answer your main question. You wanted to know how such different input values lead to valid output values.

Thats what I tried to explain above. Using the “position” has to be mapped to uv and range 0…1 aswell, to determine the final texel color.
And a top down projection leads to problems like here:

topdownproj

There are other generic mappings like triplanar mapping that try to adress that, or you use unwrapping to give a custom per face varying mapping from 3d to 2d.

I hope that helps you a bit to grasp it. My internet connection is terrible today. Its always an on and off. So I cant guarantee I’ll be able to anwswer in time.

2 Likes

Thank you Debuk and zeroskilz :heart:

My internet connection is terrible today. Its always an on and off.

We both have something in common :joy:

They are also used with generators (eg 2d voronoi, 3d voronoi, 2d textures, 3d texture(arrays) )

Does Blender use UVW maps for Procedural Textures?

2 Likes

Your original question was basically the following: How can 3D coordinates and 2D coordinates produce renders?

It helps to note that the orange circled textures require 2D coordinates. and the blue ones work with 3D coordinates:
image
Environment and all the “Image” textures are in the (0,0)-(1,1) coordinate range but have convenience options that allow the input coordinates to be clipped, repeated, etc.

No… the convention is 2D = UV, 3D = XYZ, 4D = XYZW. No reason for this… it is just historical convention… and, really, there is no difference between using XY or UV coordinates for 2D, the “UV” naming merely exists to distinguish between the texture space (the unwrapped image) and how the texture is projected in 3D. (internally you will just use a 3D vector with the Z component set to 0)

1 Like

Thank you zeroskilz :heart:

As I said I think I’ve bitten off more than I can chew. I need to enhance my fundamental understanding of texturing.

Thank you again for your help,:cherry_blossom: and I apologize for any inconvenience I may have caused

1 Like

No inconvenience caused.
Yes. Fundamentals are important.
Check out that Wiki article I linked in that earlier thread and experiment with some materials. It is mainly through experience that you’ll learn.

Nah, this stuff is easy… Play around with some examples and you’ll get it soon enough.

1 Like

Yes, but they they are true un-clamped values. The brick texture is 2D, this plane is 8 metres wide.

The object cords are giving values from 0 (the center) to 4 and -4 on the edges.
To map the spherical graient on one side of the plane I set the location to 4m.

This is the same result with UV’s (with exactly the same material (location mapped to 4m).

The difference is that I scaled the UV’s in the UV editor by 8 (so they cover the 8 m of the object dimensions.) and I centered the UV’s at xy o.

The brick texture is mapping with values that go from -4 to .4 in both cases.

You can place a 2d image at the same spot too. The image data is clamped 0 to 1 so You can fit 8*8 images if you set it to repeat.

Also worth noting that I had the mapping node set to point, if you set to texture then the location needs to be set at -4 to put it at the left and 3 to place it at the right (4 would take it outside the plane).

1 Like