light amplification mask?

Hello all!

Just got done fiddling with my first alpha-blendery to produce some ligts…
Its an all black render-target, and I use reverse-subtractive blending to remove alpha-value where the lights are…

Then draw the mask on top of the scene, here some rocks…

So far:

Now… The next thing I want to do, is add another layer that amplifies or dampens the reflection of light, so that the same light may be more effective on highlights, protrusions, polished bits, etc…
And less effective in cracks, further back bits etc…

I want to be clear that I want these highlights to only be visible in connection with a light… The base texture must remain the same…
Imagine stones that only gleam once you bring a torch near-by… Something like that.

Can anybody help me with this?

You an create a map of how much light should be applied where (black and white or using alpha) and multiply your light map with that before the subtraction. Or you create a bump map/normal map and write a shader :slight_smile:

Hello again Jjagg…

And thanks again. As you know, I have been using what I learned from your example in the other guys thread… Many interesting things can be achieved through tweaking or running multiple passes of things… GREAT!

I have a “reflective” mask… Several to choose from.

How do I multiply it with the darkness image?

Looking at blending, I only have options to add, min, max, sub, and rev-seb…

I am not quite ready to go full sharders ATM… Havent gotten ONE hlsl file to load, despite tutorials…

So, I see I must construct my own multiplicative blend thingy… I found this (and will test it):

BlendState blend = new BlendState();
blend.ColorBlendFunction = BlendFunction.Add;
blend.ColorSourceBlend = Blend.DestinationColor;
blend.ColorDestinationBlend = Blend.Zero;

This will result in out.rgb = source.rgb * destination.rgb + 0;

Looks right?

I’m not entirely sure how this all works myself. I toyed with it yesterday, but didn’t get exactly what I expected. Trial and error is the way to go I guess :slight_smile: Unless someone else here has experience with all the BlendState options

Got THIS now…

Yeah, seems blending is all about experimentation, frustration, and mindless brute-forcing…
And then some things begin to register…

I feel like I’m learning again! YIKES!

Check out this scary shit! So many options…

1 Like