Dynamic Shading question

Hi everyone!

I’m working on a game that’s designed to teach angles by having you aim a turret and fire at incoming asteroids. Below the turret is half of a sphere (shaped like a protractor) that I would like to have highlight the angle the turret is being aimed at by having the area shade in while you move the turret.

So for example, if I’m aiming the turret straight up, half of the sphere would be shaded in. Then if I moved it to 45 degrees, only the region under 45 degrees on the protractor sphere would be shaded in.

How on earth can I do this?

hard to imagine without scribbles. Couldn’t you do that simply with geometry? If not, you can probably do it in a custom fragment shader. Let us know a bit more and we might be able to help further.


I want to do something like the above, but as you drag A along the circle, the shaded region would change. I’ve only ever dropped textures on objects, so I’m not sure how this sort of stuff works.

Personally, I would do it in a shader, but if you haven’t ever touched a shader than this can be a bit of a challenging task. On the other hand, this would be the perfect task to learn shader programming. There are tons of good tutorials out there, and even unity’s documentation isn’t to bad in that area.

Without shaders, I can’t think of a simple way unfortunately. :frowning:

You can use unity’s gui “Image”. Change the type from Simple to Filled - Radial 360.

1 Like