Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 01 Mar 2011
Offline Last Active Oct 16 2016 06:27 AM

#5200241 Blending problems on alpha enabled render target

Posted by on 27 December 2014 - 07:15 AM



I want to make a scene that is made of several layers. Every layer has it's own render target(frame buffer object) and textures are rendered on it. Obviously I need a FBO that can be cleared to (0,0,0,0), so at the end when I render it all to my final scene(backbuffer) they don't cover each other.




To be able to clear the FBO to (0,0,0,0) the texture that is bind to the FBO supports alpha channel glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,data). The problem is when I render something transparent(like a water bubble) on this type of FBO it makes the FBO transparent there, like in this picture:




This is what I want, a normal result using glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA). I don't know what is the problem here, the created texture for the FBO, blending mode... ?



#4829764 How to make "light" in a 2D game ?

Posted by on 30 June 2011 - 02:49 PM

I like your second response better . In all honesty I felt like "but that is easy" kind of came across as a confrontational tone of voice for the "for beginners" section of the forum. I didn't understand at the time that you were saying that you didn't know how to use them yet. I think I realize now that it was bad reason to decrease reputation though, sorry.

I'm just a noob looking for some help :wink:

#4829694 How to make "light" in a 2D game ?

Posted by on 30 June 2011 - 12:08 PM

If you've looked into it at all, could you give me any information that you've found? I'm obviously kind of a beginner but I'm just trying to exchange any information I can as I search around. Sorry if it wasn't that helpful.

Why -1 if I don't know how to use them ?
I am a beginner myself, working with normal maps is too advanced for me for now. I only know that NM images can be made in GIMP, but I never did it myself.

#4829566 How to make "light" in a 2D game ?

Posted by on 30 June 2011 - 07:36 AM

I remember watching that link-dead video and him saying he has a normal map or something for each texture in the game. Do you think this tool for gimp might help?

You can use gimp to make normal maps, but that is easy ,it is different story to know how to use them when rendering stuff.

#4829093 Hopeless

Posted by on 29 June 2011 - 09:04 AM

He wants to show his work, whats so bad about that?
And whats with the 3D story?

I do agree that OP should at least put a picture or more info about the game here, and not just a link to the site.

#4827990 Silentcraft Hill ( 2D light tech-demo )

Posted by on 26 June 2011 - 02:44 PM

Hey hey hey! I love this kind of stuff. So is this true 2D or is it 3D with a camera movement on a flat plane?

It is genuine 2D :wink:

#4824071 Silentcraft Hill ( 2D light tech-demo )

Posted by on 16 June 2011 - 07:32 AM

In this video you can see my new 2D light system in action, I am very proud since I made it myself (DX9,C++).

It took me some time to make this level and record the video, but I think it was worth every second.
No gameplay, just atmosphere ... Silent Hill atmosphere.

Notice the big light flickering... pretty cool effect if I might say :lol:

Posted Image

#4819831 Simply2D - a platform game

Posted by on 05 June 2011 - 01:24 PM

Hi again !

I managed to get the game working on another computer, don't know why doesn't it work on this one. When I saw Super Mario and the editor I realized that we are basically working on a same thing. I am also using DX9 and C++, even though I am modifying an existing engine.

I made a Mario style game/level few months ago: Super Serious Bros. but I didn't have an editor then. It was all "hardcoded".

I recently started making an editor, it has just some buttons, but I can add enemies and platforms. And I store and read level data from a text file :unsure:, how do you do it ?

I had some issues with double jumping, it is like I can double jump only one per level/life. It took me some time to get to the pistol without double jump.
Also when I went to credits and pressed escape the game would crash.

BTW, how do you think to cross this ?

Posted Image

#4814274 My new game just published!

Posted by on 22 May 2011 - 10:41 AM

I got 8/10. Very interesting game. To bad FIFA doesn't allow "replay", because I wasn't sure about some situations :lol:

#4811905 My conceptual Game: Attr-X

Posted by on 17 May 2011 - 06:30 AM

I need to admit I was scared away when I saw the system requirements since I have a very old PC. Today I finally installed it and played in single player mode.

AMD Athlon64 3000+ (2000 MHz)
ATI HD3650 (512 MB)

On default settings (1280x768,shadows,high detail) I get only 9 FPS, so I turned off shadows and set the resolution to 1024x768, and lowered detail to get around 20 FPS.
Weird, since I played Half Life 2 Episode 2 with around 30-40 FPS.

I took the liberty to make some screen shoots of some areas I really liked (note this is on low detail):

Posted Image

Posted Image

Posted Image

This "game" is really an experience. Alone in a strange world, surrounded with weird sound and noise I felt like I was in Silent Hill again. When I found a group of balls together, the sound they produced gave me the creeps. I like the whole atmosphere and the graphical style even though I don't know how will it look in the end.

It would be interesting to see some caves in this game since caves have interesting acoustical properties. Maybe some ancient architecture, forests, swamps,watterfalls as well. You could really get creative if you have the time.

#4806505 What is humanity going to do about race?

Posted by on 04 May 2011 - 11:59 AM

You want me to tell you the real reason for most of the social problems in the world?

The real reason is the common human stupidity and that doesn't have anything to do with race.

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. [Albert Einstein]

#4805887 Noob making a 2D shooter

Posted by on 03 May 2011 - 05:46 AM

It is hard to find people who understand that making a game can be a hobby. I am starting this thread to show you what I am working on and to get some feedback, tips, comments...
It is a little project with uncertain future which I work on in my spare time.
I am at the stage in which I just try to make certain stuff work properly, so the game has just one test level for now.

The "game" uses a modified version of Advanced2D engine (J.S. Harbour). I just might rename it because of all the changes I am making to it.

I am using textures from my third year college project ( SS 2D TLGH ) , and some textures that I made myself or found using Google. Don't think that final version (if I ever finish it) will look like this or it will have anything to do with Serious Sam or Super Mario.
My inspiration are indie games like Soldat , Seal Hunter and Facewound.

Added pixel shader abbility

Changed entity management and collision (this is a "stress test")

To see my other videos or progress you can visit my imaginary software company's Facebook and Youtube page: :D
My YouTube channel
My Facebook page

My stuff that seems to work:
- pixel shaders (for individual sprites or the whole scene)
- multiple layer entity/sprite management
- updated bounding rectangle collision detection (works with "point" sprites, "line" sprites (two-three points :P), multiple collision boxes)
- scrolling textures (works with only one texture per "scroller")
- tile based large sprites (ground in the video is a large sprite drawn with a smaller texture)

My stuff that doesn't quite work:
- platforming (what an irony :() - colliding with platforms, walking on them, scrolling world objects... I will need help with that in "For Beginners" subforum.
- realistic bouncing

My wishlist:
- skeletal animation
- moving platforms...

#4795118 Basic DirectX 9 shader tutorial

Posted by on 06 April 2011 - 11:01 AM

I made a short video of some pixel shader examples and my vector mode (not a shader) which draws sprite's bounding box instead of the texture.

#4793895 Basic DirectX 9 shader tutorial

Posted by on 03 April 2011 - 12:22 PM


Yes, I use D3DXSprite to draw everything.
It ended up being really straight forward. This is the sprite draw method that I updated to use shaders. Sprite has a string "shader" which is used to set shader technique, if ShaderOn==true.
This way I can apply a different shader on every sprite I draw.

All sprites are drawn on the texture using this method, then that texture is drawn on the backbuffer (using the sprite handler (D3DXSprite) with a shader applied or not ) , and then I call Present.

void Sprite::draw()
		//sprite transformation stuff

        int fx = (this->curframe % this->animcolumns) * this->width;
		int fy = (this->curframe / this->animcolumns) * this->height;
		RECT srcRect = {fx,fy, fx+this->width, fy+this->height};

		if (this->ShaderOn)
                	UINT passes = 0;
     				g_engine->p_effect->Begin(&passes, 0);
         			if (passes>0)


#4780609 My 2D games

Posted by on 01 March 2011 - 12:13 PM


this is my first post here.

I want to show you my 2 games made using Advanced2D engine ( + some of my stuff ).
None of them are finished, it is just made for fun ;)

Serious Sam 2D The Last Game Hero


Super Serious Bros.

- realistic bouncing (more or less),
- scrolling background and world,
- jumping and gravity,
- attachments,
- gore ;),
- picking up objects ...