Shader to compensate for wear

I have a CRT projector that has come pretty ugly wear.
I want to compensate for that by modulating the video output to match the strength of the wear.
The problem is that I don’t know how to program a shader.

I basically want to take in a static texture the size of my video output and use that to modulate my output.
Like a final post process before the image is sent out to the PJ.

I think a simple multiply of the burn factor would work as I only want to darken the non burnt spots down to the level of the most burnt spot. Or a tradeoff within reason.

For the setup I figure a DSLR would work to capture the pattern and then use photoshop to align the image properly to the projected image.

Oh and it has to be RGB texture as the wear is different for each tube. Or at least one texture for each color.

Also in a related matter. Would it be possible to add a non linear gamma correction? Or even per pixel?
The important is the original problem though.
Unless it can’t be solved without further correction.

You could try chaining some existing shaders. It sounds like your problem can be solved by sending the output through 3 pairs of ‘RGB Adjust’ and ‘Mask’, one for each color channel, and blending them back together afterwards.

I even believe, that you do not need some strange shareware like photoshop at all.
In case you have a windows accessible camera with a decent resolution it should be even possible to patch (and/or code HLSL) something like an “automatic adjustment”.
this might be pretty advanced, but not impossible at all.

well, in that seldom case me being bored this indeed could be a challenge for another module…

Thanks.
That page somehow slipped me by.

Gimp could be used instead for PS.
It’s just to align the photo of the screen to match the projected exactly. A one time deal only. Unless the setup is changed.
I will poke around and see if I can get something working. Don’t seem that hard.
What values do I calculate on? Is is automatically a float between 0 and 1 or int between 0 and 255?

It might not be a bad idea to make a module that can correct the image for different kinds distortions and reflectivity of a surface etc. Like projecting a image on an uneven surface.

edit I made something that might work.
Wasn’t that hard.
I just multiply a texture with the original.
it seems to work in 0 to 1 range so that works nicely.
I have to test it later though.