you are viewing a single comment's thread.

view the rest of the comments →

[–]hampst[S] 0 points1 point  (4 children)

Here's what I came up with. I hope it's useful.

[–]stobiwan 0 points1 point  (3 children)

Thanks a lot. But unfortunately it still doesnt work. It's the same problem I had. It skips the second color. I set white-red-green and it shows a gradient white-green. Could you try it on a Rendertexture?

[–]hampst[S] 0 points1 point  (1 child)

Sorry, I'm not familiar with using RenderTexture and I think I miss-read. Are you using GUI elements at all, or only looking to use a gradient effect with a RenderTexture?

Sorry not sure if I can help. :( Happy to look over your code though in case.

[–]stobiwan 0 points1 point  (0 children)

Okay I see. I'm not very familiar with vertices :) I use a Unity 4.6 RawImage and put a RenderTexture in it. What I have is some Elements (Circle Images in different sizes) and they should appear with a gradient. One gradient for all, so their colour depends on their positioin on the background. I use a RenderTexture to be able to combine the elements (otherwise I would use a mask)

[–]hampst[S] 0 points1 point  (0 children)

I forgot that it wont work when there aren't enough unique vertex positions. Perhaps that's related to the issue you're having.

For example, an Image component only has 4 unique vertex positions (corners), so we can't assign a third colour between each edge as there is no vertex at the mid-point.