Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Evan Bowman

Pages: 1 ... 3 4 [5]
61
General / Re: Question about GLSL alpha blending
« on: February 16, 2016, 03:46:06 am »
It appears that shaders are applied before the entire thing is drawn to the target so no, I don't think a shader would have access to target area. (otherwise the shaders would be applied to the entire target too, right?)

I'm not sure of your process here. Are you drawing the objects and then applying the glow on the entire render texture?
Is it possible to just draw to that render texture each object using the shader individually?
If not, and you need to do the entire render texture at once, you may need an intermediary render texture.
I may be missing something obvious though.

Have you attempted this yet? What were the results and how did you go about it?

I was just attempting to implement this when I ran into the exact problem that you describe, that a shader does not appear to have access to pixels already drawn to the buffer. I had thought to first draw the background texture and then apply the glow over top of it, but I'm running into the problem of how to mask the glow to only show up over parts of the background that are opaque (ie nonzero alpha channel, ie the parts in the picture that aren't black).

I'm reading through the sfml documentation, and I'm having trouble finding any built in features that were meant to do this, but maybe there's some sort of workaround that I'm not thinking of? Am I missing something?

62
General / Question about GLSL alpha blending
« on: February 16, 2016, 02:18:46 am »
For a project I'm working on I'm trying to add simple lighting to a top-down game map, such that projectiles have an underglow that gets projected onto the game map but not in areas of the over world map texture with an alpha channel of 0 (see image). I would do this by drawing the map texture to an empty sf::RenderTexture with blend add, and then drawing glow images with a shader that works sort of like Blend-alpha, but that ignores source pixels where the corresponding destination pixels have a zero alpha channel.

For the shader, it seems like if I only wanted to color pixels with non-zero alpha channels, it would be as simple as doing this:

if (destColor.a > 0)
     destColor = sourceColor * sourceColor.a + destColor * (1 - sourceColor.a)

Having never written any GLSL, I'm not so sure how both the destination and source pixels get passed from SFML to the fragment shader as inputs, and I was wondering if someone who has implemented this sort of thing before could give me some suggestions. When looking at source code for fragment shaders, it looks like the inputs and outputs are declared globally outside a main function with no arguments or return value?

**EDIT: I guess my main issue is this: It appears easy to access values for pixels yet to be drawn, but how do I go about reading values from pixels that SFML has already drawn to the buffer? If doing so is non-trivial, is there a better way to achieve the same effect?


63
SFML projects / Re: Blind Jump: Space Themed Roguelike
« on: February 15, 2016, 03:17:06 pm »
Looks great!

I don't really see any relation to rogue though or any roguelike elements for that matter. I don't want to sound picky but seems like every other developer for some unknown reason wants to slap word roguelike on any game involving procedural tilebased levels  :-\

Thanks!

I guess I didn't really go to far into the mechanics in my original post; the game also features permanent death and will require the player to do some sort of resource management, so I was referring to that as well. From the Berlin Interpretation it's only really missing the turn-based gameplay and grid based movement, but I guess a better description on my part would be "a space themed action-adventure game with roguelike elements". Fixed subject line.

Edit: I'm not really a professional game developer, just a college student who wanted to make a video game, so I guess I was less concerned with what genre I described it as. I agree that 'Roguelike' feels like a buzzword right now (or maybe it's just become a looser definition).

64
SFML projects / Re: Blind Jump: Space Themed Roguelike
« on: February 15, 2016, 02:22:45 pm »
Nice! Good job so far. Reminds me of Risk of Rain, if it was played from a 2.5D perspective.

Thanks! I've heard of Risk of Rain but never actually played it, maybe I'll check out out.

Looks neat. If you change the YouTube link from https to http it will even be embedded directly.

Edit:

At 1:02 there's a z-ordering problem, i.e. the player sprite is on top of the enemy despite the enemy being in front.

What I'm personally missing is some sense of depth for the projectiles. While a drop shadow might be odd for them, how about adding some glow that's reflected by the ground (i.e. a colored shadow)? This way it would be easier to properly judge projectiles' positions more easily.

Yeah it's in its pretty early stages so it does have some bugs. Have you run into z ordering before and had to solve it? Off the top of my head it seems like I'd want to push references to all of the sprites in the window to a stack, encapsulated with y-position and image height, and then sort it before drawing.

I actually have been thinking of adding a glow below projectiles, but haven't done it yet because I'd have to check if each effect if over a platform before drawing the glow (don't have to with shadows, because enemies and the player can't leave the platforms  :) ).

I appreciate the suggestions!

65
Blind Jump is a procedurally generated space themed adventure game that I've been developing with SFML over the past few months, and now It's progressed to a point where I wanted to share some pictures and videos of it and maybe get some feedback from other people who like making games.

The object of the game is to navigate a series of randomly generated waypoints while fighting enemies and collecting items.

Gameplay video:


Screenshot:




Enemies (so far):

Drone: Wanders around and shoots sometimes, fairly weak.


Critter: Chases you.


Valkyrie: Dashes back and forth and fires projectiles.


Turret: Rapidly Fires patterns of projectiles.



Pages: 1 ... 3 4 [5]