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 - Peteck

Pages: [1] 2 3 4
1
Network / Re: Is SFML network enough for making MMO game
« on: August 21, 2014, 04:19:47 pm »
But yes, SFML network module is enough for you to make a MMO game like that. All you need is a tcp socket.

2
I did some searching when I saw that I couldn't bind the depth buffer to another framebuffer.

glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GL_DEPTH_BUFFER_BIT, GL_NEAREST);

For me it looks like I just can blit the depth bits into the default frammebuffer. Don't know if it will work, haven't tested it yet.

3
SFML projects / Re: FlapBoy [#gbjam3] [Flappy Bird Clone]
« on: August 07, 2014, 04:01:24 pm »
Cool little game. But I really hate the jump sound! It's too loud!

4
General / OpenGL: Use depth buffer from Gbuffer in default framebuffer
« on: August 07, 2014, 03:13:20 pm »
So I am making a deferred rendering application with OpenGL. After doing the geometry and light passes I want to render some particles. But I need some depth testing on those. So what I want to do is to use the depth buffer binded to my GBuffer to do some depth testing when drawing to the default OpenGL framebuffer.

I make and bind the depth buffer/texture to the framebuffer/GBuffer like this
glGenTextures(1, &_depthTextureID);
glBindTexture(GL_TEXTURE_2D, _depthTextureID);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, _width, _height, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, nullptr);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE);
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, _depthTextureID, 0);

My question then is: How do I bind the Gbuffer depth buffer to the default framebuffer for depth testing on the geometry pass?

5
SFML projects / Re: Unnamed "Tug-Of-War" Strategy Game
« on: August 07, 2014, 01:48:53 pm »
Any updates on this project?

6
Feature requests / Re: ability to use rotated images with setTextureRect
« on: August 06, 2014, 05:59:01 pm »
Hmm there are some problems by making this rotation function. First of all, what point should it rotate around? Lets say that it should just rotate around the center. If you then say the coordinates are like this

x: 0, y: 0, width: 50, height 25

When rotating this around the center you will get a wrong x coordinates outside the texture.

7
Feature requests / Re: ability to use rotated images with setTextureRect
« on: August 06, 2014, 04:54:22 pm »
One could just make a rotation calculation on the coordinates or just get the new coordinates from the packed texture. In my opinion its better to use the right coordinates than start rotating them to get right ones. But of course, its not up to me to make that decision.

8
General / Re: Problem with uniform in GLSL shader
« on: August 06, 2014, 12:02:14 am »
The first habit you should develop when writing GL code is to check for GL errors. If you don't, you will waste a lot of time looking for the error in the wrong places. Take a look into SFML's source and you will see that every GL call is surrounded by SFML's glCheck() macro that automatically checks the enclosed GL call. This will tell you exactly what line produced what error so that you can easily fix them when they happen.
Well, I took your advice and used glGetError() to see if there was any errors. And and got only one. So I tracked it down, fixed it, and then all was fine. I was screwing up some uniform locations on the samplers, which I didn't need to do anyways.

Actually I was like "well, I check for errors on shaders, frame buffers..." and so on and was ready to say I wasn't doing anything wrong in my c++ code. But I was wrong, so thank you for the advice to check for OpenGL errors. Didn't even knew anything about the glGetError() function. This may will help me alot in the future developing OpenGL.

9
General / Problem with uniform in GLSL shader
« on: August 05, 2014, 09:55:32 pm »
So right now I'm playing around with some OpenGL stuff. Well I'm trying to make a deferred rendering application to better learn what deferred rendering is and how it works. But I have a wierd problem. I think it may be some kind of problem with the size of different floats. Hmm but well here we go with some code.

First of all I create my textures and add them to a framebuffer.
(click to show/hide)

And my fragment shader look like this.
(click to show/hide)

But I have problem when I'm setting "texCoords" right after main in my fragment shader. When using an uniform to pass the values. If I use the uniform I get the first and bad looking image attachment. If I just hard code the value instead of using the uniform, I get the second and good looking image attachment.

And function for setting the uniform look like so.
(click to show/hide)

So are there any out there on this forum that may have an idea why this happens?

10
SFML projects / Re: Witch Blast (dungeon crawl shooter)
« on: August 05, 2014, 12:00:39 pm »
Hello!
Some news from Witch Blast, with damage's display in game, and a new monster: rat with helmet.
This game keeps looking better and better. Nice addition with the damage display :-)

Maybe you should turn down the volume on the rat-die sound. Just a little bit.

11
Graphics / Re: Large arrays of sprites crashing
« on: July 29, 2014, 05:57:23 pm »
for(int i=0; i<10; ++i)
{
    twoDimVec[i] = std::vector<sf::Sprite>(20);
}
And to make it even more simple, use "std::fill"
std::vector<std::vector<sf::Sprite>> twoDimVec(10);
std::fill(twoDimVec.begin(), twoDimVec.begin()+10, std::vector<sf::Sprite>(20));

12
SFML projects / Re: Run time error sfml-network-d-2.dll is missing
« on: July 29, 2014, 02:21:06 pm »
Please read the error.  "sfml-network-d-2.dll" is missing.


You have added the "sfml-network-2.dll" to the directory.

13
Graphics / Re: SFML Game Development, Movement
« on: July 28, 2014, 01:39:18 pm »
It would be more straightforward if you put your keyboard handling directly into update function instead passing bools around. Something like this:
Well it depends on what you're trying to accomplish with your code. I normally have alot of instances of a character-class which also is the class the client should control. So when I'm doing that, all the booleans becomes extremely useful!

14
Graphics / Re: Basic questions
« on: July 21, 2014, 04:00:24 pm »
1.
sprite.setColor(sf::Color(255, 255, 255, n));

Please notice that n should go from 0 to 255 in the Laurent example :-)

15
General / Re: Making Consistent Physics with Delta Time
« on: July 02, 2014, 09:13:20 am »
jumpTime += deltaTime.asSeconds();
return maxJumpTime / jumpTime * -jumpControl;
Try putting a clamp on the jumpTime which will clamp the value to the maxJumpTime.
And then also change this
(jumpTime > maxJumpTime)
to be
(jumpTime >= maxJumpTime)

The problem I see in your code is that jumpTime don't get limited. So if you max is 5, jumpTime can be 5.5 before resetting, or it could be 5,4 and so on. This is what I think is the cause of your bug.


No need to be picky about that.
Didn't mean to be picky, just to give a friendly advice.

Pages: [1] 2 3 4