Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


2D sprites and ambient light


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 DemonLord   Members   -  Reputation: 344

Like
0Likes
Like

Posted 21 April 2012 - 09:00 AM

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:


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

Thanx for help.

Sponsor:

#2 DemonLord   Members   -  Reputation: 344

Like
0Likes
Like

Posted 25 April 2012 - 12:27 PM

I have a question about BlendState.

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

Posted Image

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 Posted Image

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

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
};

Any help or tip would be helpful.
Thanx

#3 Jutaris   Members   -  Reputation: 478

Like
0Likes
Like

Posted 18 May 2012 - 03:35 PM

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.

My Site -- My Music  -- My Ramblings -- My Game

 Basic Flying Rules:Try to stay in the middle of the air. Do not go near the edges of it. The edges of the air can be recognized by the appearance of ground, buildings, sea, trees and interstellar space. It is much more difficult to fly there.

Come join us for some friendly game dev discussions over in XNA Chat!


#4 Nokame   Members   -  Reputation: 153

Like
0Likes
Like

Posted 18 May 2012 - 04:46 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS