Object coordinate behaves unexpected with shader displacement

Hello,

I am using the experimental feature in blender 2.81, to add displacements within the shader editor using the “displacement node”.

The problem is, for some reason, the color map and height map do not match up when using the object coordinate. It works fine with “generated” though.

I searched for a possible explanation/solution to this, online and tried on my own too. But I couldn’t find a valid one. It might be a pretty silly thing that I’m missing, but it breaks my current workflow so any help is deeply appreciated. I have attached the renders and node setup for a simple example.

generated_vs_object

Node setup :

BTW I’m using a subdivided sphere, have adaptive turned on, experimental on GPU and have enabled both displacement and bump for the shader.

Thanks in advance,
-Sayan.

With object the non diplace textures seem to me mapped after displacing while generated are mapped before. I noticed that a while ago, too.

What exactly do you want to do? If it is about getting constant coordinates with generated coordinates in different objects you can turn off auto texture space in the data properties of each object and set each of them to, for example, 1, 1, 1.

No, I’m actually creating procedural shaders from texture coordinates using vector manipulations. I have provided the noise texture example to keep things simple. So I have the complete displacement in place now. Then when I tried to create a mask from the displacement texture to color different parts of the texture. The colors do not match up. That breaks the realism of the shader.

Thanks for your input, and I kind of guessed that might be a reason. I tried to take the vector out from the displacement node and feeding it into another noise texture like this :

I have the same noise texture settings, and have tried directly feeding it into the noise, using vector addition & subtraction. Nothing worked. I guess it is more complicated than that. I hope somebody can explain exactly what vector transformation the displaced coordinates go through so that I can reverse it with back-calculation. It would still mean having double the initial number of nodes. But it would at least work IMO.

Otherwise, if somebody knows a more elegant solution to this issue? This makes it impractical to use the object coordinate in conjunction with shader/vector displacement.

Not sure if I fully understand what your are trying to do but perhaps the following way is a solution:

What is the reason for plugging the displacement output into the diffuse?

edit: bah, you had that in your first post and obviously don’t want it with generated. What is the reason for needing object coordinates?

I appreciate your feedback. It isn’t like generated won’t work for my case at all. But when you have an object with non-uniform shape, like scaled only along Z-axis. The texture gets stretched. It also happens with object coordinates but it can be solved by “applying transformation” with CTRL+A. It doesn’t get fixed even with transformation applied if you are using generated coordinate. That is the main motive to use object. It keeps the shader flexible and portable.

That is what I meant in my first post with “auto texture space”
See the image. Both objects have the same shader and scale applied but the left one has “auto texture space on” and the right one has auto texture space off and all scale values set to 1.

Oh! My bad, how did I miss that in your first post. This is perfect. At least until the object coordinate thing is fixed by the devs. Fantastic. Thank you so much :smiley:

I am not sure if this is not intended behavior. The thing is, sometimes you want the current behavior. It would be best if there was an option for this in the Texture Coordinates node.

For sure. I meant like if they come up with an intuitive workflow for working in vector/shader displacement with the object coordinate. Right now there is no easy way to make it work.