- Home /
Question by
Kinnefix · Nov 18, 2017 at 03:00 PM ·
camerashaderrendertexture
Best way to render specific area darker?
Greetings.
I'm currently working on a project where I need to render specific area darker.
The area A is determined by the following rules:
Point data T, and a list of Point data S[] are provided.
For each pixel P on the screen, draw a closed line that starts from P and ends at T. If resulting line passes any one of points in S[], point P is determined to be in the area A.
The final result should render area A with gradient around it.
I've succeeded to render S[] as white dots on black texture, and pass the texture to shader.
I also can pass T to shader as vector, so that my shader is provided with required data.
Now, how will I be able to achive step 2 and 3 as written above?
Any help would be appreciated !
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612143004im_/https://answers.unity.com/themes/thub/images/avi.jpg)