Quantcast
Channel: Questions in topic: "shader programming"
Viewing all articles
Browse latest Browse all 169

Changing color of crosshair based on color underneath using shaders

$
0
0
I'm new to shaders in general. What I want is to create a crosshair where the colors of it change depending on the color of what is being moused over. I've seen examples for shaders that have a crosshair that inverts colors, this is similar to what I want except I want to change specific colors into specific other colors.

I'm not familiar enough with how to code shaders so while I thought I could modify one of these invert shaders I've not been successful. Instead, I've been trying to explore how to do this via shader graph.

My understanding is that if I can sample the screen colors, I can just run the output through some change color nodes to do what I want. I don't know how to sample the screen colors: Most discussions I've found point towards the scene color node, but my problem is that I specifically want this as a UI effect, and the scene color seems to bypass the UI canvas entirely. I've seen references to grab pass, but only in code form, and I'm not familiar enough with how to work with raw shader code, I've tried to look up how I would do that in the shader graph but I haven't found anything.

Help about this specific issue or help about writing the exact shader I want would be great.

Currently using Unity 2020.3.17f1, specifically installed URP to try and work with shader graph.

Viewing all articles
Browse latest Browse all 169

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>