Replies: 1 comment 3 replies
-
Basically I want to make that image look red when the position of the image on the target image has red color values on it. I want to keep the original shape of the image, but maybe give it a background color and the alpha channels will make it appear red. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a program that recreates an image from other images using evolution. I want to calculate the average rgba-value of the area of a random object on the target image inside a fragment shader. Basically check the average color value underneath the object. I also don't want to render these objects to the screen. I need the average color value to be calculated inside the fragment shader and I also want to give the image that color. However, I don't know if that is even possible and how one would do that. Any help is appreciated!
Here is an example image of an object:
![image](https://user-images.githubusercontent.com/99501993/169697818-ce89b7b3-a9b5-4b81-a3e5-607d3bdae251.png)
Here is my current shader.wgsl file (basically copied from the wgpu tutorial):
![image](https://user-images.githubusercontent.com/99501993/169697852-82bdc16b-9788-4025-8a98-8293613d9d1c.png)
Beta Was this translation helpful? Give feedback.
All reactions