This stumped me quite a bit during this section of the lecture. As you can see the scale of my mountain object is set to 1 and I did my best to situate the object origin at its base, in a good location. Still, I can’t seem to achieve a nice gradient even with additional color points added in.
When set to “Generate” mode in Texture Coordinate, it works just fine and I’ve seen other forum members discuss this in previous post. While I’m okay improvising and finding a way around the problem, I would really like to understand why I couldn’t get the gradient to work right from the get go. I should mention I applied a secondary material slot for the mountain range, so I’m wondering if that has anything to do with the issue?
At a first glance, I think your mountain object has also a negative z-vertices (bottom of the mountain.
The color ramp is based on 0…1 input values (0%…100%).
Your lowest vertices z-value can be negative ( < 0) because the origin point (orange dot) lies in the middle of the mountain. Blender does not give you an input error. It just tries to make the best from it.
Move the orange dot to the bottom of the mountain.
In edit mode move all the mesh
OR in object mode, use the 3D cursor and set the object origin point to 3D cursor location. right mouse click > set origin > 3D cursor
EDIT: If your mountain is higher than 1 blender unit (a cube is 2!), the your z-value is higher than 1 and out of the range of 0…1. Which makes the gradient looks wrong.
To fix this you need high math calculations in the material node editor. Which is out of the scope of the beginner’s lessons.
Yes, it seems that my mountain object has some negative vertices. I took too much liberty in modifying the terrain and didn’t realize that this would impact the performance of the gradient texture. I understand your explanation as to how the color ramp works, but I am puzzled because in the lecture example the mountain object definitely seems like it exceeds 1 blender unit (if we’re to assume a blender unit is measured in meters?).
According to Blender my mountain object has a z-value of 11.7 m which would be 11.7 blender units, correct? Please let me know if I am mistaken on this.