Sign in to follow this  
DemonLord

2D sprites and ambient light

Recommended Posts

Hi.

I want to make all sprites that are not in my spot light to be hardly visible.
Only when I come near enough to light them up with my spot light should
they be fully visible.

This is how it looks:
[media]http://www.youtube.com/watch?v=1IRtth-Ro2M[/media]

Question is: How do I make sprites less visible when not in my spot light?

Thanx for help.

Share this post


Link to post
Share on other sites
I have a question about BlendState.

Is it possible to make sprites outside of my spot light blend into dark ambient light with BlendState?

[img]http://shrani.si/f/2g/xo/1uGIilZy/alpha.png[/img]

I kinda made sprites in my spot light translucent and those far away normal but I don't really know if I can make them blend with the ambient light [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]

This is what I use to make the effect on the screenschot:

[CODE]
private Color _ambientLight = new Color(.1f, .1f, .1f, .1f); // for HLSL

public static BlendState BlendBlack = new BlendState
{
ColorBlendFunction = BlendFunction.Add,
ColorSourceBlend = Blend.One,
ColorDestinationBlend = Blend.One,

AlphaBlendFunction = BlendFunction.Add,
AlphaSourceBlend = Blend.SourceAlpha,
AlphaDestinationBlend = Blend.One
};
[/CODE]

Any help or tip would be helpful.
Thanx

Share this post


Link to post
Share on other sites
Well, for one, I don't think you want to toy with the Alpha (bringing that down is what'll make them translucent).

Additionally, if that's a 3d light (as I assume it is) you could just render the sprites on textured quads. Could be more effort up front, but give you the visual effect you're after.

Share this post


Link to post
Share on other sites
It looks like your drawing the lighting fx then the sprites on top of it. Play with the order of what you're drawing, if you haven't.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this