Hello everybody,
I have tried creating a ball gradient material as the photo I have attached but had no luck, I am a complete noob in the material editor and have no experience. So can somebody help me create the ball material based on the picture below. I am using no lights in my game as it is a mobile game so if it is possible using unlit that would be appreciated .Thanks
http://is2.mzstatic.com/image/thumb/Purple118/v4/e4/1e/41/e41e4198-f173-b6aa-8ae4-4254d1bec205/source/1200x630bb.jpg
You could probably use the dot product of the VertexNormalWS and a couple different 3-vector constants to lerp between the different colors. To see what I mean, drop in a 3 vector constant and set the B value to -1, plug it into a dot product with VertexNormalWS also plugged into the dot product, and then the output from the dot product plugged into the final material color. What you should end up with is the top of the sphere being black and fading to white towards the bottom. Try entering different values in the R, G, and B pins on your constant to change the direction of the gradient.
Hi,
thank you for the response, I tried what you told me but it was too confusing (I am a beginner), because the texture is 3D I will have to look from different angles at the gradient, also, the picture has mutliple gradients, so how do you combine them all. Can you kindly reproduce the material and show me how it is done?
You can combine the gradients using lerp (linear interpolation). Ensure that your material shading model is set to unlit.
2 Likes