What kind of shader is this?

Hi! Some years ago I made a proof of concept of a game that I never ended. I lost all the code, but I have a short video in which I see an effect that I can’t reproduce, I only remember I loaded a sort of grayscale texture to achieve it!

If you see near the end, when he jumps, the white electronic parts seem like to have an HDR effect as the light touches them.

Do you have an idea of what kind of shader could do that effect? I’m not very strong with shaders, so it should be something very simple!


Edit That answer wasn’t even close, probably because I watched the video on my cracked phone screen. :slight_smile:

1 Like

But yeah I still don’t see what the effect you’re referencing is. It looks like you just took away the shadow to me from what I can tell from that 480p video. Maybe you increased the brightness more for parts that already were bright? I guess that would make the dark parts look like they absorbed more light, leading to a higher contrast and “HDR” effect.

1 Like

Yes, was talking about the small metallic parts. It seems that the brightest parts got even more bright.

I tried to replicate thst effect by multiplying the base texture with a grayscale texture, but It didn’t work.

Thanks for your opinion!

It looks like you just did a point light shader where the intensity of the colour is higher the closer it is to the light source?

(Look cool by the way :D)

1 Like

Thanks a lot Trinith! :slight_smile:

That’s just my best guess, anyway. You also look like you have something in there to handle shadow casting, which is neat as well!

1 Like

That “old” shader looks like a Specular Mapping shader was added.
Those shaders will read a gray scale image and determine how shiny to draw the image.

“New” standard shaders have all that plus HDR etc.

1 Like

I have too say … it could be as simple as having 2 textures, one with the green stuff and one with just the lights/highlights

Now for the effect you want you just use a faded circle as some kind of “mask” for the background, while that mask is just bigger when applied to the highlights-background

I did that sort of “lightning” in the original “Robo Miner” Game for android, which was using only SpriteBatch and no (custom) shader/lights at all. I basically painted the background and the light was just a mask for that.

I am just guessing, but to mimic the effect you showed in your post, I would do exactly that - but just with two “lights” and 2 backgrounds. But yes - if you wanna go with shaders, you’d have 2 actual lights, where one is bigger and applies only to the highlights-map

1 Like

Thanks a lot reiti, as usual you are very kind! I’m going to download your game!